Skip to content

Conversation

@XiaofeiCao
Copy link
Contributor

@XiaofeiCao XiaofeiCao commented Jun 6, 2025

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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@XiaofeiCao
Copy link
Contributor Author

@microsoft-github-policy-service rerun

@XiaofeiCao XiaofeiCao marked this pull request as ready for review June 6, 2025 09:07
Copilot AI review requested due to automatic review settings June 6, 2025 09:07
Copy link
Contributor

Copilot AI left a 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-plane and resource-manager folders under specification/…
  • Adjust exit logic in sdk_automation to 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-plane and resource-manager matches 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 the if packages and len(packages) == 1: condition (or the earlier logic) so that multi-package runs still write results.
sys.exit(1)

@XiaofeiCao
Copy link
Contributor Author

/check-enforcer override

@XiaofeiCao XiaofeiCao merged commit 5a3acc7 into main Jun 6, 2025
18 checks passed
@XiaofeiCao XiaofeiCao deleted the automation_folderv2 branch June 6, 2025 09:20

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)"
Copy link
Member

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)

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java Automation] Fatal errors should be configured or script should return non-zero exit code [Java] Maven build failure for a brand-new library

4 participants