2020-05-15 17:19:08 -04:00
|
|
|
import {MergeConfig} from '../dev-infra/pr/merge/config';
|
2020-05-15 11:21:47 -04:00
|
|
|
|
2020-05-04 15:34:55 -04:00
|
|
|
// The configuration for `ng-dev commit-message` commands.
|
|
|
|
const commitMessage = {
|
|
|
|
'maxLength': 120,
|
2020-07-06 17:27:19 -04:00
|
|
|
'minBodyLength': 20,
|
2020-06-30 18:10:01 -04:00
|
|
|
'minBodyLengthTypeExcludes': ['docs'],
|
2020-05-04 15:34:55 -04:00
|
|
|
'types': [
|
|
|
|
'build',
|
|
|
|
'ci',
|
|
|
|
'docs',
|
|
|
|
'feat',
|
|
|
|
'fix',
|
|
|
|
'perf',
|
|
|
|
'refactor',
|
|
|
|
'release',
|
|
|
|
'style',
|
|
|
|
'test',
|
|
|
|
],
|
|
|
|
'scopes': [
|
|
|
|
'animations',
|
|
|
|
'bazel',
|
|
|
|
'benchpress',
|
|
|
|
'changelog',
|
|
|
|
'common',
|
|
|
|
'compiler',
|
|
|
|
'compiler-cli',
|
|
|
|
'core',
|
|
|
|
'dev-infra',
|
|
|
|
'docs-infra',
|
|
|
|
'elements',
|
|
|
|
'forms',
|
|
|
|
'http',
|
|
|
|
'language-service',
|
|
|
|
'localize',
|
2020-04-02 05:11:00 -04:00
|
|
|
'migrations',
|
2020-05-04 15:34:55 -04:00
|
|
|
'ngcc',
|
|
|
|
'packaging',
|
|
|
|
'platform-browser',
|
|
|
|
'platform-browser-dynamic',
|
|
|
|
'platform-server',
|
|
|
|
'platform-webworker',
|
|
|
|
'platform-webworker-dynamic',
|
|
|
|
'router',
|
|
|
|
'service-worker',
|
|
|
|
'upgrade',
|
|
|
|
've',
|
|
|
|
'zone.js',
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
// The configuration for `ng-dev format` commands.
|
|
|
|
const format = {
|
|
|
|
'clang-format': {
|
|
|
|
'matchers': [
|
2020-05-05 16:07:48 -04:00
|
|
|
'**/*.{js,ts}',
|
|
|
|
// TODO: burn down format failures and remove aio and integration exceptions.
|
|
|
|
'!aio/**',
|
|
|
|
'!integration/**',
|
|
|
|
// Both third_party and .yarn are directories containing copied code which should
|
|
|
|
// not be modified.
|
|
|
|
'!third_party/**',
|
|
|
|
'!.yarn/**',
|
|
|
|
// Do not format d.ts files as they are generated
|
|
|
|
'!**/*.d.ts',
|
2020-05-04 15:34:55 -04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
'buildifier': true
|
|
|
|
};
|
|
|
|
|
2020-05-15 11:21:47 -04:00
|
|
|
/** Github metadata information for `ng-dev` commands. */
|
2020-05-12 18:26:30 -04:00
|
|
|
const github = {
|
|
|
|
owner: 'angular',
|
|
|
|
name: 'angular',
|
|
|
|
};
|
|
|
|
|
2020-05-15 11:21:47 -04:00
|
|
|
// Configuration for the `ng-dev pr merge` command. The command can be used
|
|
|
|
// for merging upstream pull requests into branches based on a PR target label.
|
|
|
|
const merge = () => {
|
2020-05-21 13:51:21 -04:00
|
|
|
// TODO: resume dynamically determining patch branch
|
|
|
|
const patch = '10.0.x';
|
2020-05-15 11:21:47 -04:00
|
|
|
const config: MergeConfig = {
|
|
|
|
githubApiMerge: false,
|
|
|
|
claSignedLabel: 'cla: yes',
|
|
|
|
mergeReadyLabel: /^PR action: merge(-assistance)?/,
|
2020-06-22 13:40:04 -04:00
|
|
|
caretakerNoteLabel: 'PR action: merge-assistance',
|
2020-05-15 11:21:47 -04:00
|
|
|
commitMessageFixupLabel: 'commit message fixup',
|
|
|
|
labels: [
|
|
|
|
{
|
|
|
|
pattern: 'PR target: master-only',
|
|
|
|
branches: ['master'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
pattern: 'PR target: patch-only',
|
2020-05-20 06:50:18 -04:00
|
|
|
branches: [patch],
|
2020-05-15 11:21:47 -04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
pattern: 'PR target: master & patch',
|
2020-05-20 06:50:18 -04:00
|
|
|
branches: ['master', patch],
|
2020-05-15 11:21:47 -04:00
|
|
|
},
|
|
|
|
],
|
|
|
|
requiredBaseCommits: {
|
|
|
|
// PRs that target either `master` or the patch branch, need to be rebased
|
|
|
|
// on top of the latest commit message validation fix.
|
2020-06-09 11:46:58 -04:00
|
|
|
// These SHAs are the commits that update the required license text in the header.
|
2020-06-03 17:46:51 -04:00
|
|
|
'master': '5aeb9a4124922d8ac08eb73b8f322905a32b0b3a',
|
|
|
|
[patch]: '27b95ba64a5d99757f4042073fd1860e20e3ed24'
|
2020-05-15 11:21:47 -04:00
|
|
|
},
|
|
|
|
};
|
|
|
|
return config;
|
|
|
|
};
|
|
|
|
|
2020-05-04 15:34:55 -04:00
|
|
|
// Export function to build ng-dev configuration object.
|
|
|
|
module.exports = {
|
|
|
|
commitMessage,
|
|
|
|
format,
|
2020-05-12 18:26:30 -04:00
|
|
|
github,
|
2020-05-15 11:21:47 -04:00
|
|
|
merge,
|
2020-05-04 15:34:55 -04:00
|
|
|
};
|