guardian / homebrew-devtools

A homebrew tap containing dev tools for the Guardian
2 stars 3 forks source link

ci: Split homebrew setup steps #93

Closed akash1810 closed 1 year ago

akash1810 commented 1 year ago

Warning I've cherry-picked the changes from #84 and #88 into this branch to confirm the changes to the CI process fixes things. Before merging this PR, these cherry-picks should be removed to follow single responsibility changes.

What does this change?

The builds in #84 and #88 are failing with messages that suggest a git conflict:

Error: guardian/devtools/ssm: /usr/local/Homebrew/Library/Taps/guardian/homebrew-devtools/Formula/ssm.rb:4: syntax error, unexpected <<, expecting end
<<<<<<< HEAD
^~
/usr/local/Homebrew/Library/Taps/guardian/homebrew-devtools/Formula/ssm.rb:8: syntax error, unexpected ===, expecting end
=======
^~~
/usr/local/Homebrew/Library/Taps/guardian/homebrew-devtools/Formula/ssm.rb:12: syntax error, unexpected >>, expecting end
>>>>>>> c7fbe61 (Merge dac26abe...
^~
/usr/local/Homebrew/Library/Taps/guardian/homebrew-devtools/Formula/ssm.rb:12: syntax error, unexpected tIDENTIFIER, expecting ')'
...ec66d58337ac276f718186ac0c8a059)
...^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Indeed, this is confirmed via #92, which demonstrates that somewhere in the build homebrew is making changes to the checked out code in a way that causes git conflicts. This results in the above error message being witnessed when we attempt to install from the checked out code.

In this change, we split the CI steps up, changing the ordering.

Before

  1. Checkout branch
  2. Apply AWS CLI work-around
  3. Update homebrew
  4. Install from local file system

After

  1. Apply AWS CLI work-around
  2. Update homebrew
  3. Checkout branch
  4. Install from local file system

This should guarantee that homebrew does not mutate the checked out branch, and therefore make the build more deterministic, and stable.

How to test

Observe CI.

How can we measure success?

The PRs #84 and #88 become mergeable.

shtukas commented 1 year ago

Amazing @akash1810 . Well done !

akash1810 commented 1 year ago

For prosperity, the build log is here - logs_89.zip.

akash1810 commented 1 year ago

This is proven to work now (as CI has successfully completed). Closing, in favour of #94.