Skip to content

Commit

Permalink
Merge branch 'main' into feat/firebase-messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathansoufer authored Jul 1, 2024
2 parents 62e8dfb + d528b81 commit 1eda810
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .github/guidelines/LABELING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ It's essential to ensure that PRs have the appropriate labels before they are co
### Mandatory QA labels:
Every PR shall include one the QA labels below:
- **needs-qa**: If the PR includes a new features, complex testing steps, or large refactors, this label must be added to indicated PR requires a full manual QA prior being merged and added to a release.
- **No QA/E2E only**: If the PR does not require any manual QA effort, this label must be added. However, prior to merging, you must ensure end-to-end test runs in Bitrise are successful.

- **Spot check on release build**: If PR does not require feature QA but needs non-automated verification, this label must be added. Furthermore, when that label is added, you must provide test scenarios in the description section, as well as add screenshots, and or recordings of what was tested.

Once PR has been tested by QA (only if the PR was labeled with `needs-qa`):
To merge your PR one of the following QA labels are required:
- **QA Passed**: If the PR was labeled with `needs-qa`, this label must be added once QA has signed off
- **No QA Needed**: If the PR does not require any QA effort. This label should only be used in case you are updating a README or other files that does not impact the building or runtime of the application.
- **Run E2E Smoke**: This label will kick-off E2E testing and trigger a check to make sure the E2E tests pass.

### Optional labels:
- **regression-develop**: This label can manually be added to a bug report issue at the time of its creation if the bug is present on the development branch, i.e., `main`, but is not yet released in production.
Expand Down
13 changes: 11 additions & 2 deletions .github/scripts/check-pr-has-required-labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,38 @@ async function main(): Promise<void> {
'DO-NOT-MERGE',
];
let hasTeamLabel = false;
let hasQALabel = false;

// Check pull request has at least required QA label and team label
for (const label of pullRequestLabels) {
if (label.startsWith('team-') || label === externalContributorLabel.name) {
console.log(`PR contains a team label as expected: ${label}`);
hasTeamLabel = true;
}
if (label.includes('Run Smoke E2E') || label.includes('No QA Needed') || label.includes('QA Passed') ) {
console.log(`PR contains a QA label as expected: ${label}`);
hasQALabel = true;
}
if (preventMergeLabels.includes(label)) {
core.setFailed(
`PR cannot be merged because it still contains this label: ${label}`,
);
process.exit(1);
}
if (hasTeamLabel) {
if (hasTeamLabel && hasQALabel) {
return;
}
}

// Otherwise, throw an arror to prevent from merging
// Otherwise, throw an error to prevent from merging
let errorMessage = '';
if (!hasTeamLabel) {
errorMessage += 'No team labels found on the PR. ';
}

if (!hasQALabel) {
errorMessage += 'No \'Run E2E Smoke\' or \'No QA Needed\' or \'QA Passed\' label. ';
}
errorMessage += `Please make sure the PR is appropriately labeled before merging it.\n\nSee labeling guidelines for more detail: https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md`;
core.setFailed(errorMessage);
process.exit(1);
Expand Down

0 comments on commit 1eda810

Please sign in to comment.