Repository navigation
Incorrect message when checking for extension upgrades #8535
Description
Activity
After reviewing some code, I think it may just be better to not display any tty message after running the command with
--dry-run.- addedpriority-3Affects a small number of users or is largely cosmeticAffects a small number of users or is largely cosmeticgh-extensionrelating to the gh extension commandrelating to the gh extension commandhelp wantedContributions welcomeContributions welcomeand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Jan 8, 2024 @ngoue Thanks for writing in. I was able to reproduce this bug, definitely a confusing message. Rather than change the output completely, I think we can just fix this message to instead state that there were no extensions that needed to be upgraded.
Reacted by George Yermulnik (Georgii Iermulnik)Can I work on this one?
Reacted by Sam CoeThis has been bugging me since ever and I needed to add this workaround to my crontab entry that monitors updates:
gh extension upgrade --dry-run --all | egrep -v ": already up to date$"
Given this help message--dry-run Only display upgradesit would be really beneficial if--dry-runindeed showed only whether an extension needs upgrading. Or maybe adding--quietto suppressalready up to datemessages would be enough.Also trailing message in interactive mode (when the output is not piped) is confusing:
> gh extension upgrade --dry-run --all […] [userfetch]: already up to date [users]: already up to date [webhook]: already up to date ✓ Would have upgraded extensions > gh extension upgrade --dry-run --all | egrep -v ": already up to date$" -c 0
The
✓ Would have upgraded extensionsline, that indicates there are some upgrades pending, is erroneous.Given this help message --dry-run Only display upgrades it would be really beneficial if --dry-run indeed showed only whether an extension needs upgrading
This is a very confusing help message. What it means is "Only display upgrades (rather than actually applying the upgrade)".
The other part is the bug that this issue is capturing.
Just to double check, is the purpose of your cron job simply to determine whether and extensions could be upgraded?
Just to double check, is the purpose of your cron job simply to determine whether and extensions could be upgraded?
Yep, exactly (assuming you mean any rather than and). It simply reports whether any of extensions need upgrading (by listing those that need upgrading) so that an operator can decide what to do with this information.
Reacted by William Martin
Describe the bug
When checking for an extension upgrade with the
--dry-runflag,cliincorrectly reports that the extensions would have upgraded even though it reports it's already up-to-date in the same message.I believe this change is related: 88cae9f
Steps to reproduce the behavior
cliversion 2.40.1 (2023-12-13)gh extension install HaywardMorihara/gh-tidygh extension upgrade HaywardMorihara/gh-tidy --dry-runExpected vs actual behavior
I would expect a message indicating the package is up-to-date instead of a message saying the extension would have upgraded.
Logs