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

Add option to retain tmpdir on pr-pull #16530

Merged

Conversation

josephsweeney
Copy link
Contributor

@josephsweeney josephsweeney commented Jan 25, 2024

This option will be used to generate build provenance in the publish-commit-bottles.yml workflow in Homebrew/homebrew-core. It adds a single flag that controls whether or not the temporary directory where bottles are downloaded is retained.

Necessary for adding build provenance to Homebrew/homebrew-core. This must be merged first.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This option will be used to generate build provenance in the
`publish-commit-bottles.yml` workflow in `Homebrew/homebrew-core`. It
adds a single flag that controls whether or not the temporary directory
where bottles are downloaded is retained.
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Library/Homebrew/dev-cmd/pr-pull.rb Outdated Show resolved Hide resolved
Co-authored-by: Bo Anderson <mail@boanderson.me>
@josephsweeney josephsweeney marked this pull request as ready for review January 25, 2024 16:45
@josephsweeney
Copy link
Contributor Author

I am not sure exactly how I can test this change before merging, so please let me know if you have any ideas!

Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

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

It might be possible for a maintainer to test with --dry-run and --no-upload but I'm not sure.

@@ -501,6 +504,15 @@ def self.pr_pull
upload_args << "--root-url-using=#{args.root_url_using}" if args.root_url_using
safe_system HOMEBREW_BREW_FILE, *upload_args
end
ensure
if args.retain_bottle_dir? && ENV["GITHUB_ACTIONS"]
ohai "Bottle files retained at:", dir
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ohai "Bottle files retained at:", dir
ohai "Bottle files retained at: #{dir}"

Nit: style

brew(main):003:0> dir = "/tmp"
=> "/tmp"
brew(main):004:0> ohai "Bottle files retained at:", dir
==> Bottle files retained at:
/tmp
=> nil
brew(main):005:0> ohai "Bottle files retained at: #{dir}"
==> Bottle files retained at: /tmp
=> nil

This makes sure the output stays on one line.

Copy link
Member

Choose a reason for hiding this comment

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

@apainintheneck ohai will truncate long output and doesn't need the colon if on one line so I think this is actually better as-is.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Seems reasonable, thanks @josephsweeney!

@@ -501,6 +504,15 @@ def self.pr_pull
upload_args << "--root-url-using=#{args.root_url_using}" if args.root_url_using
safe_system HOMEBREW_BREW_FILE, *upload_args
end
ensure
if args.retain_bottle_dir? && ENV["GITHUB_ACTIONS"]
ohai "Bottle files retained at:", dir
Copy link
Member

Choose a reason for hiding this comment

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

@apainintheneck ohai will truncate long output and doesn't need the colon if on one line so I think this is actually better as-is.

@MikeMcQuaid MikeMcQuaid merged commit 8c2dcba into Homebrew:master Jan 26, 2024
24 checks passed
@woodruffw woodruffw deleted the joesweeney/provenance-on-publish branch January 29, 2024 15:38
@github-actions github-actions bot added the outdated PR was locked due to age label Feb 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants