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 #6794

Merged
merged 10 commits into from
Aug 2, 2023

Conversation

gauthierpetetin
Copy link
Contributor

@gauthierpetetin gauthierpetetin commented Jul 12, 2023

Description

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.

Screenshots/Recordings

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

Issue

Progresses https://github.com/MetaMask/mobile-planning/issues/1122

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

Other

@gauthierpetetin gauthierpetetin requested a review from a team as a code owner July 12, 2023 20:48
@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.

@gauthierpetetin gauthierpetetin self-assigned this Jul 12, 2023
@gauthierpetetin gauthierpetetin changed the title Automatically check if PR has requested labels before being merged feat: github action to check if PR has requested labels before being merged Jul 12, 2023
cortisiko
cortisiko previously approved these changes Jul 12, 2023
Copy link
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

🌮 🌮 🌮

@gauthierpetetin
Copy link
Contributor Author

gauthierpetetin commented Jul 18, 2023

Hi @cortisiko and @sethkfman ,
I'm not sure how to proceed with this PR, as @sethkfman mentioned last Friday, that enforcing the addition of a QA label on every PR might introduce a habit where contributors rely on Core Mobile QA team when contributing to Mobile code base, while we want to progressively get away from this.
@cortisiko what do you think?
Does it make sense if I update this PR such that it:

  • Forces the addition of a team label, i.e. a label starting with team- string (or external-contributor label)
  • Forces the addition of QA label, i.e. either QA Passed or No QA Needed/E2E Only or Spot Check on the Release Build
  • Forbids PR to be merged if they have the following labels: needs-qa, QA'd but questions, issues-found.

@gauthierpetetin
Copy link
Contributor Author

@cortisiko @sethkfman, here's a new proposal, where I removed the QA label check in this commit.

@cortisiko
Copy link
Member

@gauthierpetetin Using QA labels on PRs is not limited to the mobile core team; all teams utilize these labels to communicate the type of testing conducted or needed during release testing to the QA engineer. The QA labels help guide us during release testing. We identify based on the label applied to a PR what level of testing is needed during releases. However, if we decide to stop using QA-specific labels, we should have an alternative labeling system to inform the release QA engineers about whether testing has been performed or not. Ideally, engineers would apply this label once testing has been done. For instance, we can use labels to indicate if testing has been completed (automated and or manual), or if the PR doesn't require any testing, such as for documentation or unit test changes.

Anyways what you proposed is fine. We will iron out the details on the proper label soon.

@gauthierpetetin
Copy link
Contributor Author

gauthierpetetin commented Jul 25, 2023

As discussed with @danjm @sethkfman @cortisiko @PeterYinusa @vpintorico last Friday, I updated this PR to:

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

Here's the corresponding commit.

NicolasMassart
NicolasMassart previously approved these changes Jul 27, 2023
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me. Added only an error message improvement suggestion.

.github/scripts/check-pr-has-required-labels.ts Outdated Show resolved Hide resolved
@gauthierpetetin gauthierpetetin added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 28, 2023
@sethkfman sethkfman removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 28, 2023
@gauthierpetetin gauthierpetetin added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 28, 2023
cortisiko
cortisiko previously approved these changes Jul 31, 2023
Copy link
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

🥇 🥇 🥇

@Cal-L Cal-L dismissed stale reviews from cortisiko and NicolasMassart via a396cc0 July 31, 2023 19:22
@Cal-L
Copy link
Contributor

Cal-L commented Jul 31, 2023

Updated PR with main

Cal-L
Cal-L previously approved these changes Jul 31, 2023
Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@Cal-L Cal-L added No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Jul 31, 2023
@sonarcloud
Copy link

sonarcloud bot commented Aug 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@gauthierpetetin gauthierpetetin merged commit 8c0959b into main Aug 2, 2023
11 checks passed
@gauthierpetetin gauthierpetetin deleted the feat/check_pr_labels branch August 2, 2023 13:31
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2023
@metamaskbot metamaskbot added the release-7.6.0 Issue or pull request that will be included in release 7.6.0 label Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. release-7.6.0 Issue or pull request that will be included in release 7.6.0 team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants