upgrade local extension and up-to-date are not failures#4857
upgrade local extension and up-to-date are not failures#4857
Conversation
Signed-off-by: tison <wander4096@gmail.com>
mislav
left a comment
There was a problem hiding this comment.
Hi, thank you for the contribution. Could you tell us more about what exactly is this fixing?
|
@mislav thanks for your reply. After #4442 merged, if you upgrade all extensions, gh extension upgrade --allbut not: gh extension upgrade some-extThis PR follows up to update the logics for |
But we already don't count local extension upgrade error nor up-to-date error as failures. To demonstrate: $ gh extension upgrade --all && echo SUCCESS
[branch]: local extensions can not be upgraded
[dependents]: already up to date
[repo-topic]: local extensions can not be upgraded
[screensaver]: already up to date
...
✓ Successfully upgraded extensions
SUCCESSFrom what I can see, |
|
@mislav not if you upgrade a specific extension and thus it creates inconsistency: After this change it becomes: |
|
Aah, I see. So this change is about making |
|
@mislav yes. |
There was a problem hiding this comment.
Sorry for the wait; I had to mull this over.
A few things stood out to me: that the upgradeExtensions() logic had to change, which felt odd because the goal of the PR was not to change how upgrade --all worked, and that error handling and printing was suddenly the responsibility of upgradeExtension(), when I believe that errors should be best printed in the body of the upgrade CLI command itself. Finally, the localExtensionUpgradeError should still result in a failing exit status for the command, since the extension was unable to be upgraded (the local extension author is fully responsible for handling those repos).
I have pushed changes to illustrate what I mean. I believe the updated approach is simpler. I have also touched up some error printing from the command.
|
@mislav thanks for your review and follow ups. I also thought of error handling things but failed to get a result as you did. Thanks for the insights :P |
Signed-off-by: tison wander4096@gmail.com
This is a follow-up to #4442.