Skip to content

[TypeSpecValidation] Add support for folder structure v2 #34348

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

Open
mikeharder opened this issue Apr 29, 2025 · 0 comments
Open

[TypeSpecValidation] Add support for folder structure v2 #34348

mikeharder opened this issue Apr 29, 2025 · 0 comments
Assignees

Comments

@mikeharder
Copy link
Member

mikeharder commented Apr 29, 2025

Examples

New Spec: #34050
Existing Spec: #34049

Policy

  1. All new TSP specs (totally new services, initial conversions to TSP) must use folder structure v2
  2. Existing TSP specs are allowed to use folder structure v1 in main/RPSaaSMaster. However, they will be required to upgrade to folder structure v2 in their next PR.
    A. The error will include a link to a document explaining how spec authors should migrate to v2.
  3. The scoping will be the top-level folder under "specification". So, all of "specification/contosowidgetmanager" must use either v1 or v2, they cannot be mixed in sub-folders.
  4. There will be no dedicated exception mechanism for the requirement to upgrade to v2. However, EngSys can always merge PRs with checks failing as our "break-glass" solution.

Implementation

  1. TSV will internally support both v1 and v2.
  2. By default, TSV requires v2.
  3. Specs can opt-in to v1 (only during TypeSpecValidation-All) using the existing suppressions mechanism to "suppress" v2
  4. When run as part of "TypeSpecValidation - All", the suppressions are honored.
  5. When run as part of PR validation, or by running TSV locally on your dev machine, the suppression is "ignored", and v2 is required regardless.

The suppression would look something like this:

specification/contosowidgetmanager/suppressions.yaml
- tool: TypeSpecValidationAll
  rules: [FolderStructure]
  sub-rules: [FolderStructureV2]
  reason: Existing spec using folder structure v1
  paths:
    - Contoso.WidgetManager
    - Contoso.Management

When the spec is converted to v2, the suppression must also be removed, otherwise the check will fail in the opposite direction (expected structure v1, actual structure v2).

@mikeharder mikeharder self-assigned this Apr 29, 2025
@mikeharder mikeharder moved this from 🤔 Triage to 🐝 Dev in Azure SDK EngSys 🥧📅 Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant