azure-sdk-tools: [Breaking Change][PR Workflow] Use more granular labels for Breaking Changes approvals
Implementation plan
Implementation plan for the design in this gist with extra details in this Word design doc (see also this comment):
- Add support for the new approval labels suppressing the relevant GitHub breaking changes checks.
- It must be possible to suppress via label prefix.
- There must be two separate suppressions: one for breaking changes, one for versioning issues.
- Provide GitHub “PRs with labels” queries for analytics reports (see here)
- Add support for the new “review required” labels.
- Update the check text when it is suppressed to mention the label name used to suppress.
- Review and update the workflow-bot .yml rules as necessary.
- Docs: update the automated PR guidance re breaking changes approval process.
- Update https://aka.ms/azsdk/pr-diagram. See this comment.
- Update the breaking changes doc linked from PR description, this one
- Document how PR authors can self-serve “bugfix” approval labels.
- Update Next Steps to Merge comment.
- Update the PR description, section on breaking changes.
- Write an official doc explaining the new breaking change labels
- Pull Request 932: Add breaking changes process deep-dive article
- Review ARM wiki article about breaking changes
- Review https://eng.ms/docs/products/azure-developer-experience/design/api-specs/api-versioning
- Review https://eng.ms/docs/cloud-ai-platform/azure-core/azure-core-pm-and-design/trusted-platform-pm-karimb/service-lifecycle-and-actions-team/service-lifecycle-actions-team/apex/media/azure_versioning_policy
- Update delegated to APEX team. See this update
- https://github.com/Azure/azure-sdk-tools/issues/7915
- Review https://armwiki.azurewebsites.net/rp_onboarding/process/api_review.html
- Pull Request 9848988: Updated api_review.md: fix and update various links, primarily to Azure SDK d…
- Review https://armwiki.azurewebsites.net/rp_onboarding/process/api_review.html
- Migrate from and remove source for the
Approved-BreakingChangelabel - Migrate from and remove source for the
NewApiVersionlabel - Update the
requiredLabelsRules.tsfile to use the new labels abstractions (base it on the relevant open PR by Tianen) - Iron out all the cases where both
VersioningReviewRequriedandBreakingChangeReviewRequiredare present.- https://github.com/Azure/azure-rest-api-specs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3A"BreakingChangeReviewRequired"++label%3A"VersioningReviewRequired"
- https://github.com/Azure/azure-rest-api-specs-pr/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc+label%3A"BreakingChangeReviewRequired"++label%3A"VersioningReviewRequired"
- https://github.com/Azure/azure-sdk-tools/issues/7860
Prerequisite implementation tasks
- Deduplicate relevant
openapi-alpscode, likeLabelorPrKey, intoswagger-validation-commonpackage.
No-op docs work
- ~Update the “Automated Merging Requirements Met” GitHub check pane.~ (no work was necessary here)
- ~Update the Breaking Changes / Same Version GitHub check pane.~ (no work was necessary here)
- ~Update the Breaking Changes / Same Version ADO build logs.~ (no work was necessary here)
- ~Update the Breaking Changes / Cross-Version GitHub check pane.~ (no work was necessary here)
- ~Update the Breaking Changes / Cross-Version ADO build logs.~ (no work was necessary here)
Most recent proposal
For most recent proposal, see the most recent comment on this issue.
Original description 6/20/2023
By @mikekistler:
The current breaking change process uses the “BreakingChangeReviewRequired” or “NewApiVersionRequired” labels to signal that a breaking change review is required, but only one label “Approved-BreakingChange” for approval by the Breaking Change review board. But there are several different reasons that the board may approve, and we’d like to use the label to designate the reason for approval.
- The changes to the REST API definition are not breaking at the REST API level and have at most minor impact to generated SDKs, so the change is allowed.
- The changes to the REST API definition appear to be breaking but are actually correcting the definition to correctly describe the actual service behavior.
- The PR updates an existing API version, which violates the Azure versioning policy, but is allowed because either
- the target API version has not yet been made available to customers, or
- the target API version is in private preview and the changes are not breaking
- The PR describes actual breaking changes to the service. This is the only case that triggers customer notifications, a 3 yr migration period (possibly shorter), etc.
- Within this set we may want to distinguish changes for security or legal compliance, which may be granted a shorter migration period.
Related work:
- https://github.com/Azure/azure-sdk-tools/issues/6184
- https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/1009/Breaking-Changes-Overview
- https://github.com/Azure/azure-sdk-tools/issues/6344
- https://github.com/Azure/azure-sdk-tools/issues/7860
- https://github.com/Azure/azure-sdk-tools/issues/7915
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 24 (24 by maintainers)
@mikekistler @JeffreyRichter @weshaggard overall this was tons of work, mostly in writing, updating and clarifying the relevant docs. I am waiting for Shashank to update relevant APEX wiki about breaking changes intake process (see here). But my part of the work is finally done! Migration to new labels is done, code is done and deployed, etc.
Closing.
This is a good summary but I have a few minor tweaks:
I find that many teams do not have a clear understanding of what “private preview” means. I’ve had to explain this often enough that I captured my explanation so I don’t have to recreate it every time:
So before a team self-approves “SameApiVersion” because they claim it is in private preview, we need to make sure they are really in private preview.
Following on the previous point, I think we need a separate label for the case of “testing in a production branch”. This happens all the time and we have to tell teams that they should not be doing this, but they still do. In some cases it is justified but ARM is working on new support that should make it possible to test effectively without merging to RPSaaSMaster.
Some suggestions for this label: “SameApiVersion-InTest”, “SameApiVersion-NotReleased”.
Likewise, I think we need a “BreakingChange-NotReleased” label, and maybe this can replace the “BreakingChange-NoCustomers” label.
Please don’t use the term “swagger” in the text of the PR comments — use “API defintion” or something similar. “Swagger” is a trademark of the SmartBear company and while I know many at Microsoft use it as a synonym for “API definition” I think we should set an example of using correct terminology particularly in public spaces such as the azure-rest-api-specs repo.
https://swagger.io/blog/api-strategy/difference-between-swagger-and-openapi/
As for your questions:
I think we still want the self-service approval.
Yes, it should be offered on every PR with a “NewApiVersionRequired” or “BreakingChangeReviewRequired” label.
And yes, it could easily be abused, but
Regarding your second question, we should clarify what qualifies as a “BugFix”. A “BugFix” means that the behavior of the service at the time of the original GA of the feature was not correctly described in the API definition. Another way to say this is that the API definition does not correctly describe the service behavior at any point in time.
@mikekistler @JeffreyRichter after my chat with @weshaggard we have few questions.
First off, here is the more recent proposal from the email thread with subject
RE: Streamlining Breaking Change reviews:=== Proposal start ===
A PR showing NewApiVersionRequired means a non-breaking change to an existing api-version:
A PR showing BreakingChangeReviewRequired means a breaking change introduced to an existing or new api-version:
In PR, have a comment with 2 (or 3) links:
=== Proposal end ===
Question 1: handling auto-approval (self-service)
I see some scenarios can be auto-approved, but some can not. From the implementation point of view, we cannot clearly delineate these cases. For example, if the breaking change is a bugfix then the automation cannot know “ah, this is a bugfix, so the PR author can auto-approve”. All the automation knows it is a breaking change, and all we can do is to either allow to auto-approve all the breaking changes [1] or none of the breaking changes. Similar with non-breaking changes to given API version (like a optional property addition). Either we allow to auto-approve all the non-breaking same-API-version changes or none of them.
Knowing that, do you still want for us to implement the auto-approval / self-service capability?
Question 2: abusing auto-approval by always snapping API spec to service implementation
If we allow people to auto-approve changes to given API version to match service behavior, they can abuse it in the following way:
This scenario kind of completely circumvents the system, and yet is not obviously wrong in any way.
Given this, do you still want for us to allow people to auto-approve same-API version changes under this pretense?
Question 3: clarification of breaking change and same-API version change
Is the following correct?
“Same API version change” means: this change is allowed, but you must create a new API version for it [2]. E.g. new property.
“Breaking change” means: this change is not allowed, not even in a new API version [3]. E.g. a property removal. If it really has to happen, it must follow the strict approval process and the deprecation policy must be followed.
Footnotes
[1]: For example, if there would be
BreakingChangeReviewRequired, the PR author could always addBreakingChange-BugFixand the automation has no way of determining this is actually not a bugfix, but other kind of breaking change that cannot be auto-approved.[2]: Except the same API version changes that are allowed by the special cases as listed in the proposal.
[3]: Except the breaking changes that are allowed by the special cases as listed in the proposal.
I am thinking that the automation, once it detects that the breaking changes have been approved (due to any of the scenarios you listed above) should have another mechanism to determine the PR author can proceed to the next stage, which, in case of ARM PRs, is ARM review. I am thinking a PR that requires ARM review but has unaddressed breaking changes should have a (new) label
NotReadyForARMReviewwhich get removed when the breaking changes are approved.Re implementation, the work I see to get this done includes:
and support for the new approval labels in:
Related doc:
Here’s my proposal for revised/expanded labels for breaking change approvals:
BreakingChange-Benign
BreakingChange-Correction
SameApiVersion-Approved
BreakingChange-Approved
cc: @JeffreyRichter @josefree