-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Upgrade} Fix KeyError: 'pypi' when auto upgrade #26106
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
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @bebound, |
|
Core |
Can't agree more. |
| get_cached_latest_versions() | ||
| from packaging.version import parse | ||
| if parse(VERSIONS['versions']['core']['local']) < parse(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long | ||
| if 'pypi' in VERSIONS['versions']['core'] and parse(VERSIONS['versions']['core']['local']) < parse(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long |
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.
I think we should fix the invalid ~/.azure/versionCheck.json, instead of here, since it is the file that introduces inconsistency and complexity.
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 file is refreshed after 11 days, so I'd like to leave it there.
Skipping it or setting a dummy value for pypi produces the same result. I don't want to make the logic more complicate.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Approving in 2025. Looking at my comments, they seem to be from my past life. |
️✔️AzureCLI-BreakingChangeTest
|
Description
Fix #20473
The full error is
So it's easy to fix. But the cause is pretty tricky.
CLI gets latest version from GitHub.
azure-cli/src/azure-cli-core/azure/cli/core/util.py
Lines 316 to 330 in 5757778
pypiis added in line 327. Ifcheck_connectivityorget_latest_from_githubfails, this key does not exist.A wrong
~/.azure/versionCheck.jsonis also generated with this content:{"versions": {"azure-cli": {"local": "2.47.0"}, "core": {"local": "2.47.0"}, "telemetry": {"local": "1.0.8"}}, "update_time": "2023-04-11 17:30:11.402751", "check_time": "2023-03-22 18:05:23.331052"}PS:
I think
az upgradecauses more issues than it resolves.__main__.pycomplicated.This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.