-
Notifications
You must be signed in to change notification settings - Fork 2.1k
SDK automation, support TypeSpec folder structure v2 #45617
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
|
@microsoft-github-policy-service rerun |
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.
Pull Request Overview
Adds support for TypeSpec repository layout v2 and refines error handling in sdk_automation.
- Introduce regex-based detection for
data-planeandresource-managerfolders underspecification/… - Adjust exit logic in
sdk_automationto consistently signal failures for single-package runs - Maintain existing v1 folder matching as a fallback
Comments suppressed due to low confidence (2)
eng/automation/generate.py:256
- New v2 folder-structure parsing logic has been added but no corresponding tests were included. Adding unit tests for both
data-planeandresource-managermatches will help ensure this works as intended.
folder_structure_v2_pattern = r"specification/.*/(data-plane|resource-manager)"
eng/automation/generate.py:139
- The
sys.exit(1)call is now unconditional in the exception handler, causing premature exit before writing the output file. It should be indented under theif packages and len(packages) == 1:condition (or the earlier logic) so that multi-package runs still write results.
sys.exit(1)
|
/check-enforcer override |
|
|
||
| for tsp_project in tsp_projects: | ||
| # folder structure v2: specification/{service}/[data-plane|resource-manager]/{provider}/ | ||
| folder_structure_v2_pattern = r"specification/.*/(data-plane|resource-manager)" |
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.
@XiaofeiCao {service} folder in V2 is only one level. So the regex should be specification/[^/]+/(data-plane|resource-manager)
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.
Got it. This is only for TypeSpec, and in v1 we don't have data-plane or resource-manager segment for TypeSpec. I think it should be fine.
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines