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
Add option to retain tmpdir on pr-pull #16530
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Co-authored-by: Bo Anderson <mail@boanderson.me>
I am not sure exactly how I can test this change before merging, so please let me know if you have any ideas! |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
This option will be used to generate build provenance in the
publish-commit-bottles.yml
workflow inHomebrew/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.brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?