Merging Pull Requests with ngOfficeUIFabric - In Action

A while ago I blogged about the continuous delivery process we have put in place with the ngOfficeUIFabric library of Angular 1 directives for the Office UI Fabric . In that post I referenced another post that explained how we handle pull requests in a very repeatable fashion. Combining these two things, we can usually quite quickly merged multiple pull requests (PR’s) into the dev branch (and ultimately to the master branch) ensuring all code quality remains high and tests are passing.

In that second post about merging pull requests, I shared with you a script, check-pr.sh we use that does 99% of the work in making sure a PR is good. The other 1% involves squashing multiple commits into one and rewriting commit messages to ensure they follow our guidelines (these are two things I don’t always have to do, but they are things we check).

What’s cool about that script is that once I start it, I can go do something else while it does a ton of work for us. It creates a new branch off of dev and pulls in the code in the PR. It then cleans up the folder by removing the node_modules folder and reinstalling all npm packages to ensure we are using the latest version of npm references. This ensures that even if someone cloned the project after this update, they would have the same experience we have. The script them runs through transpiling all the TypeScript to JavaScript, vets all the code and runs all our tests.

It took me a little while to get the script set up just right, but once it was done it make checking PRs a piece of cake. This is hard to express unless you see it in action, so I recently recorded my terminal to show you what I see when I merge PRs. Yesterday this script allowed me to merge seven (7) open PRs in about 15 minutes… and I was only involved in about 2 of those minutes. The remainder of the time was handled by the script mostly downloading npm packages.

Check it out! It’s just under five minutes long:

asciicast

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a web & cloud developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to helping you be the best Microsoft 365 web & cloud developer. He lives with his wife & two kids in Florida.

Share & Comment