Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Perform brew update before checkout #94

Merged
merged 1 commit into from
Apr 4, 2023
Merged

ci: Perform brew update before checkout #94

merged 1 commit into from
Apr 4, 2023

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented Apr 4, 2023

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; it should pass.

How can we measure success?

The PRs #84 and #88 are unblocked.

Copy link
Contributor

@shtukas shtukas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing. Thank you!

@akash1810 akash1810 changed the title ci: Perform homebrew update before checkout ci: Perform brew update before checkout Apr 4, 2023
The builds in #84 and #88 are failing with messages that suggest a git conflict:

```log
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 dac26ab...
^~
/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.
@jonathonherbert
Copy link
Contributor

jonathonherbert commented Apr 4, 2023

Bit concerned that #84 was not failing when rebased from this branch, despite having an incorrect hash. The logs seem to indicate that it's pulling an older version of ssm-scala – the branch specifies 2.4.0, but in the CI output, we get:!

==> Fetching guardian/devtools/ssm
==> Downloading https://github.com/guardian/ssm-scala/releases/download/v2.3.0/ssm.tar.gz
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/117272170/d3bf2580-9df5-11eb-8610-956d5a221677?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230404%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230404T081223Z&X-Amz-Expires=300&X-Amz-Signature=16c0300f073d3760a38070e2e66399c54b31973e5621c0057f0dd94ca5b96612&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=117272170&response-content-disposition=attachment%3B%20filename%3Dssm.tar.gz&response-content-type=application%2Foctet-stream
==> Installing guardian/devtools/ssm
🍺  /usr/local/Cellar/ssm/2.3.0: 3 files, 27.8MB, built in 7 seconds

Are we definitely testing what we think we're testing with this order of ops? Hold up, I think this is me misreading GH's interface and a rebase hasn't yet occurred, I'm rebasing myself to verify that the behaviour is as expected.

@shtukas
Copy link
Contributor

shtukas commented Apr 4, 2023

Are we definitely testing what we think we're testing with this order of ops?

@jonathonherbert
The fetch only get the latest available version (not the version that is being released), which when the CI runs was 2.3.0.

@jonathonherbert
Copy link
Contributor

Yep, my mistake, manually rebased and looks great! 🎉

@akash1810 akash1810 merged commit 73ec795 into main Apr 4, 2023
@akash1810 akash1810 deleted the aa/ci branch April 4, 2023 09:36
@akash1810 akash1810 mentioned this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants