-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Core} doc_string_source
must be full path
#27824
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🔄AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
microsoft-github-policy-service
bot
requested review from
wangzelin007 and
yonzhan
November 13, 2023 03:11
CI |
microsoft-github-policy-service
bot
requested review from
jiasli,
kairu-ms and
jsntcy
November 13, 2023 03:11
bebound
force-pushed
the
self-test-import
branch
from
November 13, 2023 03:30
b2dd346
to
6ce9dad
Compare
bebound
changed the title
{CI} Improve doc loading
{Core} Nov 13, 2023
doc_string_source
must be full path
bebound
commented
Nov 13, 2023
if method_name: | ||
model = getattr(model, method_name, None) | ||
if not model: | ||
raise CLIError("command authoring error: source '{}' not found.".format(doc_string_source)) |
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.
model
can't be empty, so this code is unreachable.
I use the same logic to concat the full path, but I'm not sure whether it will raise error when import.
bebound
requested review from
zhoxing-ms,
evelyn-ys,
calvinhzy and
necusjz
as code owners
November 13, 2023 06:21
Solved by #27848 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes the errors when running
az self-test --debug
The
doc_string_source
incommands.py
must be full path now.Before this PR, in
azure-cli/src/azure-cli-core/azure/cli/core/__init__.py
Lines 707 to 718 in 1fdda16
doc_string_source
isazure.mgmt.netapp.models#Snapshot
,APIVersionException
is raised. Run line 718doc_string_source
isazure.mgmt.keyvault.v2023_02_01.models#VaultProperties
, it tries to importazure.mgmt.keyvault.v2023_02_01.azure.mgmt.keyvault.v2023_02_01.models
in_get_attr()
and fails. Run line 718doc_string_source
isfile#FileService.list_directories_and_files
in azure stack, it finally importsazure.multiapi.storage.v2017_04_17.file#FileService.list_directories_and_files
In case2, lots of
ModuleNotFoundError: No module named 'azure.mgmt.keyvault.v2023_02_01.azure'
is raised.In CLI and extension, the
doc_string_source
is full path except azure stack. I change thedoc_string_source
to full path, so CLI does not need to callget_models
to concat thesdk_path
andclass_path
andmodel = self.get_models(doc_string_source)
can be eliminated.Close #27793
Testing Guide
Run
az self-test --debug
to check the outputThis 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.