Skip to content
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

[PR Workflow] Add TypeSpec label if appropriate files are changed #7353

Closed
konrad-jamrozik opened this issue Nov 29, 2023 · 1 comment
Closed
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team. openapi-alps Items pertaining to https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps/ Spec PR Tools Tooling that runs in azure-rest-api-specs repo.

Comments

@konrad-jamrozik
Copy link
Contributor

konrad-jamrozik commented Nov 29, 2023

As in title. We need this for several reasons, including:

Implementation-wise, we want to implement this in openapi-alps PR summary task (recent example PR touching relevant code files), following rules as expressed in this PR:

description:
- if:
  - payloadType: Pull_Request
  then:
  - if:
    - filesMatchPattern: # any files, not necessarily all
        pattern: specification/.*(\.tsp|tspconfig.yaml)
    then:
    - addLabel:
        label: TypeSpec

Note that the above-given PR doesn't work as expected because the filesMatchPattern selector requires for all files to match the pattern [1]. We want to ad the label when any files match the pattern.

One situation to consider is: what if given PR has both OpenAPI specs created by hand, and also generated from TypeSpec? In such case we also add the TypeSpec label. The assumption here is that such cases should be very rare and can be handled manually, while automation can approximate such PR to being TypeSpec-only PRs.

Related work:

[1]:
source of filesMatchPattern
doc for filesMatchPattern
issue we filed

@konrad-jamrozik konrad-jamrozik added Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo. openapi-alps Items pertaining to https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps/ labels Nov 29, 2023
@konrad-jamrozik konrad-jamrozik self-assigned this Nov 29, 2023
@konrad-jamrozik konrad-jamrozik moved this from 🤔 Triage to 📋 Backlog in Azure SDK EngSys 🤖🧠 Nov 29, 2023
@konrad-jamrozik konrad-jamrozik moved this to 📋 Backlog in Spec PR Tools Nov 29, 2023
@konrad-jamrozik konrad-jamrozik moved this from 📋 Backlog to 🐝 In Progress in Spec PR Tools Nov 30, 2023
@konrad-jamrozik konrad-jamrozik moved this from 📋 Backlog to 🐝 Dev in Azure SDK EngSys 🤖🧠 Nov 30, 2023
@konrad-jamrozik
Copy link
Contributor Author

Closing as implemented and deployed. For example, this PR got the TypeSpec label:

You can see a call to the newly modified processTypeSpec function in this build log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team. openapi-alps Items pertaining to https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps/ Spec PR Tools Tooling that runs in azure-rest-api-specs repo.
Projects
Archived in project
Status: 🎊 Closed
Development

No branches or pull requests

1 participant