Skip to content

build: use new labeling and branching in merge script #20295

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

Merged
Show file tree
Hide file tree
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
38 changes: 5 additions & 33 deletions .ng-dev/merge.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import {MergeConfig} from '@angular/dev-infra-private/pr/merge/config';
import {determineMergeBranches} from '@angular/dev-infra-private/pr/merge/determine-merge-branches';
import {DevInfraMergeConfig} from '@angular/dev-infra-private/pr/merge/config';
import {getDefaultTargetLabelConfiguration} from '@angular/dev-infra-private/pr/merge/defaults';
import {github} from './github';

/**
* 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 merge = (): MergeConfig => {
const currentVersion = require('../package.json').version;
// We use the `@angular/cdk` as source of truth for the latest published version in NPM.
// Any package from the monorepo could technically work and result in the same version.

// TODO(devversion) Clean this up once the label/branching has been finalized.
// let {minor, patch} = determineMergeBranches(currentVersion, '@angular/cdk');
const patch = '10.1.x';
const minor = 'master';

export const merge: DevInfraMergeConfig['merge'] = async api => {
return {
// By default, the merge script merges locally with `git cherry-pick` and autosquash.
// This has the downside of pull requests showing up as `Closed` instead of `Merged`.
Expand All @@ -30,26 +22,6 @@ export const merge = (): MergeConfig => {
mergeReadyLabel: 'merge ready',
commitMessageFixupLabel: 'commit message fixup',
caretakerNoteLabel: 'caretaker note',
labels: [
{
pattern: 'target: patch',
branches: ['master', patch],
},
{
pattern: 'target: minor',
// TODO: Clean this up after the labels/branching has been finalized.
branches: minor === 'master' ? ['master'] : ['master', minor],
},
{
pattern: 'target: major',
branches: ['master'],
},
{
pattern: 'target: development-branch',
// Merge PRs with the given label only into the target branch that has
// been specified through the Github UI.
branches: (target) => [target],
}
],
labels: await getDefaultTargetLabelConfiguration(api, github, '@angular/cdk'),
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@angular/bazel": "^10.0.8",
"@angular/benchpress": "^0.2.1",
"@angular/compiler-cli": "^10.0.8",
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#0612a30aaf7a7e7eb2a4a5a9fa0f58622ce59590",
"@angular/dev-infra-private": "https://github.com/angular/dev-infra-private-builds.git#d0855af987db4e426477da1780bcd02941c31271",
"@angular/platform-browser-dynamic": "^10.0.8",
"@angular/platform-server": "^10.0.8",
"@angular/router": "^10.0.8",
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@
dependencies:
tslib "^1.9.0"

"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#0612a30aaf7a7e7eb2a4a5a9fa0f58622ce59590":
"@angular/dev-infra-private@https://github.com/angular/dev-infra-private-builds.git#d0855af987db4e426477da1780bcd02941c31271":
version "0.0.0"
resolved "https://github.com/angular/dev-infra-private-builds.git#0612a30aaf7a7e7eb2a4a5a9fa0f58622ce59590"
resolved "https://github.com/angular/dev-infra-private-builds.git#d0855af987db4e426477da1780bcd02941c31271"
dependencies:
"@angular/benchpress" "0.2.0"
"@octokit/graphql" "^4.3.1"
Expand All @@ -149,6 +149,7 @@
inquirer "^7.1.0"
minimatch "^3.0.4"
multimatch "^4.0.0"
node-fetch "^2.6.0"
node-uuid "1.4.8"
semver "^6.3.0"
shelljs "^0.8.3"
Expand Down