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

feat: github action to check if PR has requested labels before being merged #19984

Merged
merged 6 commits into from
Jul 28, 2023

Conversation

gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Jul 12, 2023

Explanation

The purpose of this new Github action is to check if PRs have the requested labels before they get merged:

  • A team label, i.e. a label starting with team- string (or external-contributor label)
  • A QA label, i.e. either QA Passed or No QA Needed/E2E Only or Spot Check on the Release Build

Furthermore, it forbids merging PRs with the following labels: needs-qa, QA'd but questions, issues-found, need-ux-ds-review, blocked, stale, DO-NOT-MERGE. A consequence is that we can get rid of this github action.

Progresses #12345

Screenshots/Screencaps

Recording for missing team label: https://recordit.co/U38NvBpIIj
Recording for missing QA label: https://recordit.co/jowmkvMkCh

Manual Testing Steps

  1. Add a team label and a QA label on this PR, the job shall turn to green
  2. Remove either team label or QA label from this PR, the job shall turn to red

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

Other

@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

DDDDDanica
DDDDDanica previously approved these changes Jul 13, 2023
@gauthierpetetin
Copy link
Contributor Author

@PeterYinusa @danjm as discussed last Friday, I removed the QA label check from this PR, in this commit.

// Retrieve pull request labels
const prLabels = await retrievePullRequestLabels(octokit, prRepoOwner, prRepoName, prNumber);

const preventMergeLabels = ["needs-qa", "QA'd but questions", "issues-found"];
Copy link
Contributor

@DDDDDanica DDDDDanica Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can also add labels such as need-ux-ds-review (which i see a lot of this one), blocked (provided but maybe not used as many , stale, DO-NOT-MERGE, for now, wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a CI workflow to prevent merging DO-NOT-MERGE labelled PRs. Though we may want to consolidate it here, that's a good point.

Though... we could move in the other direction as well. The DO-NOT-MERGE workflow is a lot simpler. We can access the necessary information (PR labels) purely using GitHub Actions context, no queries needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making blocked block merging might make sense, if only to force someone to remove it when it's no longer applicable. In theory if a PR is blocked, it must not be mergable, so if it's remaining it's inaccurate. Perhaps we could automatically remove it instead though, not sure.

Not sure about stale. If a PR was marked as stale, but then is ready to merge, then... that sounds good? Maybe I don't understand the workflow though, e.g. maybe we want people to explicitly remove that label? Here it seems reasonable to consider automatic removal as well though.

Copy link
Contributor Author

@gauthierpetetin gauthierpetetin Jul 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedbacks @DDDDDanica and @Gudahtt . We've discussed this with @danjm @sethkfman @cortisiko @PeterYinusa @vpintorico last Friday and agreed on:

  • adding checks for these labels in this new Github action: need-ux-ds-review, blocked, stale, DO-NOT-MERGE
  • removing the old DO-NOT-MERGE Github action as duplicate of this new Github action

Here's the corresponding commit.

@metamaskbot
Copy link
Collaborator

Builds ready [aa6c269]
Page Load Metrics (1601 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1192231512814
domContentLoaded1535174916005426
load1536174916015426
domInteractive1535174916005426
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@gauthierpetetin gauthierpetetin merged commit 0c25193 into develop Jul 28, 2023
@gauthierpetetin gauthierpetetin deleted the feat/check_pr_labels branch July 28, 2023 18:15
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2023
@metamaskbot metamaskbot added the release-10.36.0 Issue or pull request that will be included in release 10.36.0 label Jul 28, 2023
@Gudahtt Gudahtt added release-11.1.0 Issue or pull request that will be included in release 11.1.0 and removed release-10.36.0 Issue or pull request that will be included in release 10.36.0 labels Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.1.0 Issue or pull request that will be included in release 11.1.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants