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

Build: Update dangerfile temporarily to check for patch label #21945

Merged
merged 2 commits into from
Apr 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion scripts/dangerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import { fail, danger } from 'danger';
import { execSync } from 'child_process';

execSync('npm install lodash');
execSync('npm install lodash ts-dedent');

const flatten = require('lodash/flatten.js');
const intersection = require('lodash/intersection.js');
const isEmpty = require('lodash/isEmpty.js');
const { dedent } = require('ts-dedent');

const pkg = require('../code/package.json'); // eslint-disable-line import/newline-after-import
const prLogConfig = pkg['pr-log'];
Expand All @@ -20,6 +21,23 @@ const Versions = {
const branchVersion = Versions.MINOR;

const checkRequiredLabels = (labels: string[]) => {
if (!labels.includes('patch')) {
fail(dedent`
A 'patch' label is required to merge during stabilization.
Patch PRs are small bug fixes, build updates, and documentation changes.
They do not include new features or more disruptive bugfixes.
These changes will be first released on 7.1-alpha, then patched back to 'main'
after they have been verified to be correct and released as 7.0.x patch releases.
After the stabilization period ends (ETA 2023-04-12), the 'patch' label
will no longer be required to merge into next, and we will merge ALL accepted
PRs to 'next' and release them on 7.1-alpha. Patch PRs will be
patched back to 'main' and released in 7.0.x patch releases.
`);
}

const forbiddenLabels = flatten([
'ci: do not merge',
'in progress',
Expand Down