Coding Stephan

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.

Finally success after so many tries

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:

  1. Create a new branch
  2. Change the trigger to also include this new branch, remember to also change the conditions if needed
  3. Make your changes
  4. Let the pipeline run
  5. Make more changes (you wouldn’t be the first one to make a YAML typ-o!)
  6. Let the pipeline run (repeat previous step if needed)
  7. Remove the trigger for the new branch, and revert the changes to conditions if needed
  8. Create a PR to the main branch
  9. Choose to squash all changes to a single commit

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)