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

cmd/update-report: report outdated count & suggest brew upgrade #10581

Merged
merged 1 commit into from
Feb 11, 2021

Conversation

Bo98
Copy link
Member

@Bo98 Bo98 commented Feb 9, 2021

  • 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?
  • Have you successfully run brew man locally and committed any changes?

I've been wanting to do this for a while now.

This helps with the confusion people may have with the differences between brew update and brew upgrade.

With this change, brew update (via update-report) will now report how many installed formulae and casks are outdated and points the user to brew upgrade to update them.

@BrewTestBot
Copy link
Member

Review period will end on 2021-02-10 at 20:51:22 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 9, 2021
@MikeMcQuaid
Copy link
Member

With this change, brew update (via update-report) will now report how many installed formulae and casks are outdated and points the user to brew upgrade to update them.

Can you benchmark (ideally with hyperfine) the speed difference here? The reason we've held off doing this historically is that outdated? checks are pretty slow.

We should definitely ensure this code isn't run on autoupdates.

@Bo98
Copy link
Member Author

Bo98 commented Feb 10, 2021

If there has been updates (and thus ReporterHub's updated formula report has printed) then this costs <0.1s because caching.

It's ~0.45s without but it perhaps depends on the number of formulae installed. (Tested with ~250 formulae, though only 2 casks)

@MikeMcQuaid
Copy link
Member

If there has been updates (and thus ReporterHub's updated formula report has printed) then this costs <0.1s because caching.

It's ~0.45s without but it perhaps depends on the number of formulae installed. (Tested with ~250 formulae, though only 2 casks)

Cool. I'd suggest skipping when there's not been updates, then, or at least skipping when there's not been updates and it's an autoupdate.

@Bo98
Copy link
Member Author

Bo98 commented Feb 10, 2021

I'd suggest skipping when there's not been updates, then, or at least skipping when there's not been updates and it's an autoupdate.

I was leaning on the latter if we could afford it because "Already up-to-date" might be seen as confusing, but then I realised that message can be printed through update.sh (if HOMEBREW_DEVELOPER is not set) so it'll have to be the former.

@Bo98 Bo98 force-pushed the update-report-outdated branch from 50e99a1 to 0e732d3 Compare February 10, 2021 15:37
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.

Looks good so far!

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 10, 2021
@BrewTestBot
Copy link
Member

Review period ended.

@Bo98 Bo98 merged commit effe4ac into Homebrew:master Feb 11, 2021
@Bo98 Bo98 deleted the update-report-outdated branch February 11, 2021 12:53
@dkav
Copy link
Contributor

dkav commented Mar 5, 2021

Could this message be excluded if --quiet is used?

@dkav dkav mentioned this pull request Mar 5, 2021
1 task
@Bo98
Copy link
Member Author

Bo98 commented Mar 5, 2021

Possibly. The --quiet checks in update-report are quite sparse, but I wouldn't personally be against expanding that a bit. Best way is to guage opinion is to open a PR.

@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Apr 5, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Apr 5, 2021
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.

4 participants