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

Documentation: Spec PR tools suppressions mechanisms reference #8133

Closed
konrad-jamrozik opened this issue Apr 19, 2024 · 0 comments
Closed
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.

Comments

@konrad-jamrozik
Copy link
Contributor

konrad-jamrozik commented Apr 19, 2024

Important

This document was written on 4/19/2024. Hence "current state" refers to this date.

In this issue I describe current state of various kinds of "suppressions" work for the spec PR tools on the specs repos.

Official documentation for spec PRs authors

The official document describing to the PR authors the various kinds of PR suppressions is:

It is linked from, among other places:

File-based suppressions kinds

AutoRest config README.md files suppressions:

By looking at https://aka.ms/pr-suppressions you can observe that he AutoRest README.md config file can be used to suppress several different checks like Swagger LintDiff or Swagger ModelValidation. Aa a result, SuppressionReviewRequired label will be added. The logic adding this label lives in prSummary.ts / processSuppression.

To unblock a PR once it has this label, one has to add Approved-Suppression, per this line in requiredLabelRules.ts

suppressions.yaml

On 3/4/2024 in the PR Azure/azure-rest-api-specs#28043 a support for file-based suppressions for TypeSpec Requirement has been added.

As of current state:

sdk-suppressions.yaml

On 3/19/2024 in the openapi-alps PR 524197 and few other PRs around that time a new file-based suppression mechanism has been added for suppression SDK generation issues. The new suppressions live in the sdk-suppressions.yaml file and are supported by a set of labels described in this gist:

For example, there are labels like BreakingChange-Go-Sdk-Suppression or BreakingChange-Go-Sdk-Suppression-Approved

You can read more about the general design of these here:

Caution

sdk-suppressions.yaml and related labels are not yet documented in https://aka.ms/pr-suppressions
See #8134
@raych1 @JackTn FYI

Suppression labels for the file-based suppressions

To summarize the suppression labels for File-based suppressions kinds:

Design considerations

Before we took over the system the dominant way to suppress check failures was to add Approved-*** label to given PR. E.g. Approved-LintDiff. We are moving away from this model. This is because such approvals are transient. As such, we often have to re-approve the same exception when the same code gets reviewed again. Instead, we are moving to file-based model which persists the suppression.

Furthermore, previously the existing file-based check suppression model was via AutoRest config README.md entries like suppressions: or the legacy suppression directives. Going forward, for all the newly supported suppresions we move away from this model for several reasons:

  1. The README.md file is already overloaded with too many responsibilities.
  2. This is an AutoRest suppressions sub-system and so it only works on AutoRest-based tools.
  3. This syntax is hard to get right.

Instead, we introduced suppressions.yaml file for clean and easy suppression syntax for all other tools. We also introduced sibling sdk-suppressions.yaml file owned by our partners in Shanghai. The SDK suppressions are materially different as they pertain to suppressing compilation violations from varied languages for which we generate suppressions. The suppressions.yaml file instead pertains to all other spec PR GitHub checks suppressions.

Note that for existing checks using the README.md suppressions: syntax we still continue to use it. We may migrate away from it into suppressions.yaml at one point into the future.

Suppressions work backlog

There are several items on the backlog with relevant discussion about improving the labelling.

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. 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