Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
brew.rb: tell more people to not report issues. #17003
brew.rb: tell more people to not report issues. #17003
Changes from all commits
21d99c5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 151 in Library/Homebrew/brew.rb
Codecov / codecov/patch
Library/Homebrew/brew.rb#L151
Check warning on line 194 in Library/Homebrew/brew.rb
Codecov / codecov/patch
Library/Homebrew/brew.rb#L194
Check warning on line 197 in Library/Homebrew/brew.rb
Codecov / codecov/patch
Library/Homebrew/brew.rb#L197
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.
This is probably a pre-existing issue, but: not sure these categories should be treated as mutually exclusive (which is kinda what happens as a consequence of the if-elsif-else structure).
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.
@carlocab which ones do you think should not be exclusive? The first two are broadly "don't report this", the latter two are "here's where to report it" (in different places).
I could see it being worth actually checking when the last
brew update
was done and, if e.g. today, then we don't print the auto-update message?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.
Yea, I was thinking something along those lines. Because a user who still has
HOMEBREW_NO_AUTO_UPDATE
set but has runbrew update
in, say, the last 5 minutes would never see the last two messages even when they are relevant.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.
Opened PR for this in #17018
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 looks like refactor is causing this message to be output more often? Like on a non-existent formula, e.g.
In my opinion, it seems a little odd to tell users to report this given I consider this a user issue (mistyping formula name or using wrong name).
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.
@cho-m I agree this is a regression and we should not tell users to report this. However, it's late here and I cannot obviously figure out what specific change causes this. If you can: I'd love a PR or even just a comment ❤️
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.
Regression is probably from no longer just exiting on
RuntimeError
. We do classify a bunch of exceptions asRuntimeError
(in this case,FormulaUnavailableError < FormulaOrCaskUnavailableError < RuntimeError
).If there are
RuntimeError
s that should output message, then need torescue
oris_a?
detect specific Errors to restore previous behavior and exit before reporting message.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.
@cho-m Thanks, will take a look.
Check warning on line 40 in Library/Homebrew/utils/backtrace.rb
Codecov / codecov/patch
Library/Homebrew/utils/backtrace.rb#L40
Check warning on line 43 in Library/Homebrew/utils/backtrace.rb
Codecov / codecov/patch
Library/Homebrew/utils/backtrace.rb#L43