Skip to content

Instantly share code, notes, and snippets.

@mikekistler
Last active February 20, 2024 18:32
Show Gist options
  • Save mikekistler/85e9cd2e19c1b224f755805be14d8c9a to your computer and use it in GitHub Desktop.
Save mikekistler/85e9cd2e19c1b224f755805be14d8c9a to your computer and use it in GitHub Desktop.
Logic for adding breaking change labels

The PR pipeline checks every PR to determine if it (potentially) introduces breaking changes or violates Azure Versioning policy.

The main tool for this is "openapi-diff" which checks two versions of an OpenAPI doc (old and new) and identifies all the "substantive changes" (changes in descriptions and such are ignored).

Our versioning policy requires that any "substantive change" be done in a new API version.

A subset of the "substantive changes" are also considered a "breaking change"

We add labels to the PR as follows:

  • IF any change is classified as breaking AND the "old" OpenAPI doc is GA (same or different than new API version)
    • Add the BreakingChangeReviewRequired label (Note that this may include cases that need a new API version)
  • ELSE IF there are any substantive changes AND the "old" and "new" OpenAPI docs have the same version
    • Add the VersioningReviewRequired label
  • ELSE no label
    • breaking change and old version was preview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment