Azure / azure-sdk-tools

Tools repository leveraged by the Azure SDK team.
MIT License
114 stars 180 forks source link

[Breaking Change][PR Workflow] Use more granular labels for Breaking Changes approvals #6374

Closed mikekistler closed 7 months ago

mikekistler commented 1 year ago

Implementation plan

By @konrad-jamrozik

Implementation plan for the design in this gist with extra details in this Word design doc (see also this comment):

Prerequisite implementation tasks

No-op docs work

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.

  1. 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.
  2. The changes to the REST API definition appear to be breaking but are actually correcting the definition to correctly describe the actual service behavior.
  3. 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
  4. 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:

konrad-jamrozik commented 1 year ago

@mikekistler to go and propose the labels. Plus mention that "new api version required" approves a change, not a breaking change.

mikekistler commented 1 year ago

Here's my proposal for revised/expanded labels for breaking change approvals:

BreakingChange-Benign

BreakingChange-Correction

SameApiVersion-Approved

BreakingChange-Approved

cc: @JeffreyRichter @josefree

konrad-jamrozik commented 1 year ago

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 NotReadyForARMReview which 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:

konrad-jamrozik commented 1 year ago

TODO: I need to compile the final guidance from all the various conversations I had. Specifically see email thread with Subject: RE: Streamlining Breaking Change reviews and Re: "one pager" on Breaking Changes for CTO Forum.

konrad-jamrozik commented 1 year ago

We will also add another label for issue with the tool, as explained in:

konrad-jamrozik commented 1 year ago

We may also need a label like Approved-TentingInProduction. For context, see email thread Re: Requesting review and approval for the breaking change in Enterprise Billing Service.

konrad-jamrozik commented 12 months ago

There is a related idea of having BreakingChange-ToolingIssue mentioned in the email thread with subject RE: REST API Tools planning. In addition, there is more infor about preview from on the thread Re: API versions: What is the policy for releasing updated private or public API preview when there is no GA?.

konrad-jamrozik commented 11 months ago

To elaborate on "self-served" based on my chat with Jeff R.: appropriate message should be added to the PR, so that PR author knows they can add appropriate comment, resulting in appropriate approval, like e.g. label or suppression file, thus unblocking the PR.

The implementation of such flow must play well with:

konrad-jamrozik commented 10 months ago

@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:

  1. Starting situation: both API definition and service behavior match.
  2. An engineer changes the service behavior introducing a change, so now the API spec is out of sync with it.
  3. They update the API spec and auto-approve, because "the API spec was not matching the service behavior".

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?

Footnotes

[1]: For example, if there would be BreakingChangeReviewRequired, the PR author could always add BreakingChange-BugFix and 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.

mikekistler commented 10 months ago

This is a good summary but I have a few minor tweaks:

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.

konrad-jamrozik commented 10 months ago

@mikekistler thank you! I consolidated my understanding of all the requirements for this work and proposed a new convention for label naming. Can I kindly ask you to review the document and provide your input? I want to get your sign-off before I start the implementation work to avoid rework.

Link to the doc.

CC @JeffreyRichter @weshaggard @heaths

konrad-jamrozik commented 10 months ago

Per our chat on 1/4/2024, we concluded that for now we will implement the support for the labels and perhaps add additional support for suppressions later. Details here:

I also updated the issue description with an implementation plan:

mikekistler commented 10 months ago

I left comments in the doc and also tried to summarize my (loosely held) opinions on label names and descriptions in this gist.

konrad-jamrozik commented 10 months ago

Per our chat today:

konrad-jamrozik commented 10 months ago

There have been few more updates. Newest proposals:

Note the documents above are parts of the suppressions logic discussion. All relevant docs:

konrad-jamrozik commented 9 months ago
konrad-jamrozik commented 8 months ago
konrad-jamrozik commented 8 months ago

Pull Request 9668189: Updated guidance around breaking changes process and relevant labels | Updated file(s) from Engineering Hub for content: Service Lifecycle & Actions Team

konrad-jamrozik commented 8 months ago

Related breaking changes confusion matrix:

konrad-jamrozik commented 8 months ago

Related work:

konrad-jamrozik commented 8 months ago

Doc capturing info from this thread, and more:

konrad-jamrozik commented 7 months ago

I reached out over email to APEX team and Sharif Abassi about deduping these two docs:

Update: over email Shashank said he will deduplicate the docs.

konrad-jamrozik commented 7 months ago
konrad-jamrozik commented 7 months ago

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