Skip to content

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

@konrad-jamrozik

Description

@konrad-jamrozik

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

Metadata

Metadata

Labels

Central-EngSysThis issue is owned by the Engineering System team.Spec PR ToolsTooling that runs in azure-rest-api-specs repo.openapi-alpsItems pertaining to https://devdiv.visualstudio.com/DevDiv/_git/openapi-alps/

Type

No type

Projects

Status

🎊 Closed

Status

🎊 Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions