Umbraco Migrations Viewer: My First Step Into Package Creation

I made a startling discovery the other week. I realised that this old Umbraco dog can learn some new tricks. Okay, so I’m only 31 but I’ve been developing with Umbraco for 9 of those years. It’s been a huge part of my life, from day one of my first job I took on this CMS and have never looked back no matter how dark those days deciphering XPath may have looked... but I digress. What I’d learnt is that I could make that step and share an Umbraco package with the community.

I’m a big fan of gists, if I see someone on the forums or Twitter that has a problem I’ll be there with a gist of how I think things might work. I love gists, they’re a fairly no pressure way of chucking some code or markup to the world without saying “Hey world, this is how I do things!” Gists are the “Let’s grab a coffee”, not “Let’s have dinner.“ I never feel too self-conscious about putting out code snippets to my fellow developers because they’re more of a hint rather than code guidelines.

So what caused me to make that step? To jump into the unknown? To boldly go where this guy has never been before?

I love gists, they’re a fairly no pressure way of chucking some code or markup to the world without saying “Hey world, this is how I do things!”

Migrations. Umbraco Migrations aren’t anything new, in fact they’ve been kicking around in the Core since v6. If you’re interested in learning about Migrations I recommend reading Sebastiaan Janssen’s rather excellent blog article on the topic. It’s what got me where I am right now.

However, since v7.3.0 we’ve been able to write custom migrations. I wanted to use custom migrations so that I wouldn’t have to write SQL scripts for each schema change I had. This would allow me to upgrade my Peta POCO powered backoffice app fairly painlessly. Each Schema change became a versioned entry in the umbracoMigration table.

I’m a big fan of Umbraco plugins that allow me to see stuff so I don’t have to log on to a server. Logging on to a server, browsing to a Windows folder or running a SQL query takes time. Opening up Umbraco and loading the Developer section not so much. Especially when you may not have access to said server checking data in a database is going to be tricky. I thought it’d be great if I had a back office extension which could show me this information.

I’m a big fan of Umbraco plugins that allow me to see stuff so I don’t have to log on to a server.

Having been inspired by Dan Diplo’s Umbraco Log Viewer, I hacked together (read: carefully and considerately put together) some code, baked into the current project I was working and had gotten it to a pretty good place. For some reason, I was feeling pretty energetic after going to the gym (I was as surprised to hear I go to the gym as much as you were) and thought, let’s do this. Let’s make this the time when I actually turn something into an Umbraco package. I’d toyed with the idea in the past but never to the stage where it was deployable or reusable. I’d always get cold feet.

For me the greatest challenging wasn’t writing the code which works with Umbraco. I churn out C#, JavaScript and dollops of HTML with ease. No, the part which trips me up is the build process. It’s always been a bit of a concern. Taking that leap and submitting something that might break. Seeing all those failing builds and unlike something which lives on a private build CI these were out there for the world to see! Oh my… but I thought no, I don’t care. I have to make this jump and “put my code on my sleeve” as it were.

Knowing there was already a rather fantastic community that had been there and done that before me. I reached out to my inspirations. Looking into the Dan’s code and asking if I gave credit would he mind me using his deployment code. Fortunately, Dan is a top bloke and was very cool about it all, going one step further and suggesting I credit Jeavon Leopold as it was his work that had gone into creating the deployment code. I was elated, I would finally have that missing link I required to get my code out there to other people as a deployable package.

That evening I had spent time going through the deployment script, making sure I understood every bit of it. Despite having a tried and tested method of deployment I was still apprehensive about actually firing off the code without knowing the ins and outs. It was amazing how much I had learnt in this step; I was prepared to learn something but all the new platforms & technologies I’d picked up will no doubt help in the future. AppVeyor, Github, NuGet publishing, how to get a package up on Our Umbraco. These were almost entirely new to me as a developer who spends his time in Jenkins, Bitbucket and not dealing with package development.

I feel very fortunate to be part of such an amazingly supportive community, no matter what you’re doing there are people from all skills levels and skills sets who are willing to help you out.

Like a boss, Jeavon was on hand to help me out making that with first hectic release. Despite the fact he should have been enjoying Denmark as this was the week building up to Codegarden he still found time to direct message me through the process. I feel very fortunate to be part of such an amazingly supportive community, no matter what you’re doing there are people from all skills levels and skills sets who are willing to help you out. When you’re a part of our community you’re never alone.

So finally, I was able to take my idea which sat as some code baked into an Umbraco app not only into an Our Umbraco package but also a nuget package too! Scratch those off my developer bucket list, thank you very much. Achievement(s) unlocked (20 Gamer Score).

So, what does it do then?

Get ready for the fairly dry bit of this article. Migrations Viewer adds in an additional tree to the Umbraco CMS developer back office allowing users to view installation data for each product installed in the umbracoMigration table.

As an added bonus because an entry is added to umbracoMigration every time Umbraco updates, Umbraco Migrations Viewer allows you to view exactly when your CMS was updated and to what. So even if your Umbraco application doesn’t use custom Umbraco Migrations there’s some value there to being able to check the history of the CMS. Woohoo!

I’ve already found this to be very useful in a couple of Umbraco solutions we’ve developed for clients, allowing my fellow developers I work with to have transparency in what versions of Umbraco were installed when, no matter if they’re well versed or new to said projects.

Conclusion

Even if you think your idea is “too small”, I encourage you to give it a shot.

Admittedly this has been a rather gratuitous article to say “hey, I made my first Umbraco package, it’s been a great experience. You should give it a try too!”

If you’ve not already, please considering taking that first step! Even if you think your idea is “too small”, I encourage you to give it a shot. It takes a lot of guts to go out there and publish something you think people might want to use, but once you do you might not know where that might take you.

For me it was wanting to know how to deliver my code to other people and now I know how to do that. This is something I can now develop further with other open source work & packages, it’s all invaluable experience and I’m so glad I took the step.

I personally found out it was actually a bit more than just knowledge blocking my progress, it was more a fear of failing publicly. However, once I was determined to not let that fear block me from learning I was able to reach out to others for guidance. My first steps may be small but they were significant in getting over that hurdle. Besides whether it’s 10 commits or 10,000 commits each one is a timestamp of our experience as a developer.

But wait! There’s more!

Since writing the first draft of this article, I’ve taken on more open source Umbraco development, right now it’s the Umbraco Bulk User Admin. Contributing and helping out where I can, hopefully the features I’m adding in will help other people out as well as me, the effort isn’t lost. I doubt I would have gotten here had I not gained the confidence & experience from working with other people on my first Umbraco package. All the knowledge I gain from exposure to new projects, developers & ways of working allow me to improve my own projects, client based or open source, and the circle of learning continues on and on.

Plus, I already have a couple of tweaks I’d like to add in to Migrations Viewer having used it in anger.

This Is where my first steps have led me. I’d really be interested in hearing other people’s stories of their first step into open source development. Umbraco itself such a fantastic open source success story. #MyUmbracoFirstSteps, anyone?

All the knowledge I gain from exposure to new projects, developers & ways of working allow me to improve my own projects, client based or open source, and the circle of learning continues on and on.

About the Author

Jamie hails from a part of England which isn't Birmingham or London. When not developing rather lovely things with Umbraco for the Connect Group, he can be found walking the countryside to burn off all those chocolate biscuits that power the old grey matter.

comments powered by Disqus