Git Product home page Git Product logo

cation's Introduction

cation

Test

cation is Electron's PR monitoring bot, which serves four primary functions - semver label enforcement, PR open time enforcement, API review bookkeeping, and deprecation review. Each of the four are discussed in further detail below.

Semver Label

This bot is responsible for ensuring that all open PRs to Electron are labeled with a label that reflects their effect on Electron's Semantic Version. If a given PR affects no user-facing code, it must be labeled semver/none. The bot will add a pending GitHub Check to the PR, which will only complete successfully when the necessary label is added.

Before a label is added:

Screen Shot 2020-12-16 at 9 16 23 AM

After a label is added:

Screen Shot 2020-12-16 at 9 15 48 AM

PR Open Time

The bot is also responsible for ensuring that any given PR is open for an amount of time that reflects its impact on user-facing code. This is also done to ensure that all potential stakeholders for that PR are given ample time to review it and discuss API ergonomics amongst ways it may affect users.

Timespans:

  • semver/major - 168 hours (7 days)
  • semver/minor - 168 hours (7 days)
  • semver/patch - 24 hours (1 day)
  • semver/none - 24 hours (1 days), but in some cases (depending on the PR and its goals) there is no minimum time.

Backport PRs (PRs to a release branch that is not main) do not require a minimum time, and a fast-track label may be optionally applied to a PR to indicate that it is intended to bypass the expected minimum time if sufficient reason exists to do so.

API Review

The bot controls the API review lifecycle on behalf of the API Working Group.

This group's review is mandated on all API changes, and their goal is twofold:

  1. To guide Electron’s API surface towards a more ergonomic and usable design.
  2. To reduce the incidence of future breaking changes by anticipating such changes and accommodating them ahead of time with future-proofing.

Even changes that seem trivial can often be made more consistent and future-proof with some modifications, and the folks on the API WG have the expertise to spot and suggest those changes.

In accordance with the above goals, this bot performs several bookkeeping duties. When a new PR is opened which is either semver/minor or semver/major, it will automatically add an api-review/requested πŸ—³ label to the PR. To add clarity to whether a review is occurring in a given Electron governance member's capacity as a member of the API WG, this bot then adds a GitHub Check on the PR which will update as members of the API WG indicate their approval statuses.

Members of the API Working Group must indicate their approval by leaving a comment via a PR Review containing API LGTM. This may not necessarily be a full approval with the GitHub API since approval by the API is primarily about the API shape and design. Both a PR review that comments and includes an LGTM indication or which is an approval with LGTM are sufficient.

Screen Shot 2021-11-02 at 10 46 57 AM

Screen Shot 2021-11-02 at 10 49 27 AM

If a PR has passed its minimum open time and has the requisite number of approvals with no outstanding requests for changes, the bot will then switch api-review/requested πŸ—³ to api-review/approved βœ…, and the PR is free to be merged. If outstanding change requests persist, then the group will initiate consensus-seeking procedures and ultimately choose to approve or decline the PR. If the decision is made to decline, the API WG chair will then comment on the PR with API Declined and the bot will update api-review/requested πŸ—³ to api-review/declined ❌.

Deprecation Review

The bot controls the deprecation review lifecycle on behalf of the Releases Working Group.

Proper deprecation of APIs requires several changes: calling out the deprecation in the "Breaking Changes" doc, adding deprecation warnings to usage of the APIs, updating the docs to mark the APIs as deprecated, etc. Removing a deprecated API requires similar changes.

Since it's easy for one of these changes to be missed in a code review, this bot provides a checklist to ensure nothing has been forgotten. When a PR is labeled with deprecation-review/requested πŸ“ the bot will make a comment on the PR with a checklist of items that should be confirmed to follow deprecation policy.

When deprecation review is requested, the bot also adds a GitHub Check on the PR. When all items on the checklist have been checked off (and any non-applicable items are removed) the check will be marked as completed. At that point the bot will update deprecation-review/requested πŸ“ to deprecation-review/complete βœ….

cation's People

Contributors

ckerr avatar codebytere avatar dependabot[bot] avatar dsanders11 avatar erickzhao avatar k-rajat19 avatar marshallofsound avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cation's Issues

Add Specs

We need to mock out the appropriate events and test them in a similar was as we currently do trop.

Premature `new-pr` label for PR Drafts?

cation seems is adding the new-pr label to my unpublished PR drafts. Example: electron/electron#19657

This is slightly problematic to me because I would want the new-pr 24-hour window to be as soon as I publish the actual PR. Ideally, it would instead add the label at that moment.

Rename cation and update logo

What it says on the tin. This bot will be used for api-review purposes so it should be slightly more generic to make its purpose clearer.

Buttons should update labels correctly

If the new-pr label is not present.

LGTM / Request changes should:

  • Check if > 2 approved and exactly 0 people requested changes
    • If so, add api-review/approved label
    • If not, ensure api-review/requested label is present

If new-pr is present, ensure api-review/requested is the current label

new-pr label is not updated if semver label is missing

Seen here: electron/electron#26826

The new-pr label was added but the semver label was missing - per https://github.com/electron/cation/blob/master/src/24-hour-rule.ts#L26-L27 we assume this means that it's semver-major and thus the open time should be a week. However, since the 24 hour rule does not currently listen to the pull_request.labeled event there is no way to tell it that it has a different semver label than initially assumed when one is applied. We should listen to it and update accordingly.

Change Requests do not supersede API LGTMs or API DECLINEs

Refs electron/electron#36606

When a user who has previously given a PR an API LGTM comment or review then chooses to request changes on a PR, the GitHub check should only display the latest salient review, be that the change request, the decline, or the lgtm.

Screen Shot 2023-02-27 at 7 50 31 PM

Once the user's concerns have been addressed and the change request is removed, the most recent salient review would once again be the LGTM, and the output update accordingly.

cc @jkleinsc

Enforce semver/* tags on electron/electron PRs

Every PR to electron/electron should be required to have semver label:

  • semver/patch
  • semver/minor
  • semver/major

This should be enforced via a GitHub Check, which is a required check. If the label is missing, the check will pend indefinitely.

Manage entire state machine of PRs requiring API review.

  • No api-review/* label --> Cancelled check
  • api-review/requested --> Pending check
  • api-review/waiting-for-response --> Pending check
  • api-review/approved --> Green check

Prevent humans from adding api-review/approved manually or removing any api-review/* labels that are not api-review/requested.

If two members of the API Working Group comment "API LGTM", then the bot should switch the existing api-review/* to api-review/approved

Cation adds api-review/requested when PR is labeled with api-review/reviewed

This PR illustrates the problem: electron/electron#40301

When an API WG member has reviewed a PR and added feedback, I think we're supposed to add the api-review/reviewed label and remove the api-review/requested label. However, when we do that it looks like Cation automatically adds back the api-review/requested label (which triggers API WG notifications about a new PR).

If I'm understanding our API WG labeling system correctly, Cation should only be adding the api-review/requested label if no other api-review label (including api-review/reviewed) has been applied.

Improve API review workflow on forks

The GitHub checks API doesn't work on forks essentially at all, so we should ensure that at minimum the api-review/requested label is appropriately updated after the semver-dependent open time has passed and the API is approved or declined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.