Azure Pipelines and commit messages
It’s just a little frustration this time, I was creating a new Azure Pipeline, and I was testing the deployment steps. After 2 PR’s to the main branch, which should be configured as the correct trigger, I was still having issues.
In the mean time my commit messages in the main branch will stay there forever.
Don’t be like me
I started creating the new pipeline on the main branch, after several pipeline failures, I saw this was not the right way. I ended up with a lot of merge commits to the main branch, all related to either yaml issues or other stuff in the pipeline not working as expected.
What to do instead
If you start with a new pipeline, or you want to modify stuff to an existing one do the following instead:
- Create a new branch
- Change the trigger to also include this new branch, remember to also change the conditions if needed
- Make your changes
- Let the pipeline run
- Make more changes (you wouldn’t be the first one to make a YAML typ-o!)
- Let the pipeline run (repeat previous step if needed)
- Remove the trigger for the new branch, and revert the changes to conditions if needed
- Create a PR to the main branch
- Choose to
squash
all changes to a single commit
Other tips
- You have tools that are able to validate your YAML files. That way you can make sure it’s valid yaml before pushing it to your repository.
- Just accept the fact that you won’t get it right the first time, by using a different branch you won’t have to share all the failed attempts with the rest of the team.
YAML abbreviations
You’re not the first one to hate YAML…
Yet Another Markup Language
(official)Yelling At My Laptop
(unofficial)Yelling at Microsoft, Loudly
(unofficial)