angular/.ng-dev/pull-request.mts
Paul Gschwendtner a8139f77ea ci: configure merge tool to enforce mandatory PR statuses (#59749)
The merge tool is currently hard-coded to only check `lint` as a
required status. This was added because at some point the old GitHub
robot was replaced with a so-called `unified-statuses` check GitHub
action; but that one never worked/impacted productivity of the team.

I've added support to the merge tool to require specific jobs/checks to
run, before allowing merge (can be forcibly ignored). We are using this
ability now to enforce a few "common" required jobs, as a safety measure
when GitHub didn't trigger CI runs (e.g. for new contributors).

This recently became a more prominent issue as the GitHub org enforces
that CI doesn't run for e.g. first time contributors.

PR Close #59749
2025-01-28 12:53:33 +01:00

33 lines
1.3 KiB
TypeScript

import {PullRequestConfig} from '@angular/ng-dev';
/**
* Configuration for the merge tool in `ng-dev`. This sets up the labels which
* are respected by the merge script (e.g. the target labels).
*/
export const pullRequest: PullRequestConfig = {
githubApiMerge: false,
requiredBaseCommits: {
// PRs that target either `main` or the patch branch, need to be rebased
// on top of the latest commit message validation fix.
// These SHAs are the commits that update the required license text in the header.
'main': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
'10.0.x': '27b95ba64a5d99757f4042073fd1860e20e3ed24',
},
// `dev-infra` and `docs-infra` are not affecting the public NPM packages. Similarly,
// the `bazel` package is not considered part of the public API so that features
// can land in patch branches.
targetLabelExemptScopes: ['dev-infra', 'docs-infra', 'bazel'],
// enables specific validations during the pull request merge process
validators: {
assertEnforceTested: true,
assertIsolatedSeparateFiles: true,
},
requiredStatuses: [
{type: 'check', name: 'test'},
{type: 'check', name: 'lint'},
{type: 'check', name: 'adev'},
{type: 'check', name: 'zone-js'},
{type: 'status', name: 'google-internal-tests'},
],
};