-
Notifications
You must be signed in to change notification settings - Fork 3.4k
{Core} reduce DevExtension discovery max_depth from 3 to 2 #32994
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -268,7 +268,7 @@ def _collect(path, depth=0, max_depth=3): | |
| for item in os.listdir(path): | ||
| _collect(os.path.join(path, item), depth + 1, max_depth) | ||
| for source in DEV_EXTENSION_SOURCES: | ||
| _collect(source) | ||
| _collect(source, max_depth=2) | ||
|
Comment on lines
270
to
+271
|
||
| # https://docs.python.org/3/library/os.html#os.listdir, listdir is in arbitrary order. | ||
| # Sort the extensions by name to support overwrite extension feature: https://github.com/Azure/azure-cli/issues/25782. | ||
| exts.sort(key=lambda ext: ext.name) | ||
|
|
||
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.
Passing max_depth=2 here prevents discovery of
*.egg-infodirectories that are exactly 2 levels belowsource._collectreturns immediately whendepth == max_depth(before running theglob), so withsource/src/<ext>/*.egg-infothe<ext>directory is reached atdepth=2and will be skipped entirely. Consider either keepingmax_depth=3, or changing_collectso the depth limit is enforced only for recursion (e.g., allow processing atdepth == max_depthbut don’t descend further).