release-please 14.9.0 → 14.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +3 -3
- package/build/src/bin/release-please.d.ts +2 -42
- package/build/src/bin/release-please.js +47 -3
- package/build/src/bootstrapper.d.ts +6 -0
- package/build/src/bootstrapper.js +14 -10
- package/build/src/manifest.d.ts +4 -1
- package/build/src/manifest.js +17 -15
- package/build/src/plugins/linked-versions.d.ts +3 -3
- package/build/src/strategies/base.d.ts +2 -0
- package/build/src/strategies/base.js +2 -1
- package/build/src/strategies/java.js +1 -1
- package/build/src/strategies/php-yoshi.js +1 -1
- package/build/src/updaters/release-please-config.js +3 -0
- package/package.json +1 -1
- package/schemas/config.json +11 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [14.10.1](https://github.com/googleapis/release-please/compare/v14.10.0...v14.10.1) (2022-10-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Put config schema on correct file ([#1678](https://github.com/googleapis/release-please/issues/1678)) ([6edc50b](https://github.com/googleapis/release-please/commit/6edc50b5599180b7ffa83a623559d328527e9274))
|
|
13
|
+
|
|
14
|
+
## [14.10.0](https://github.com/googleapis/release-please/compare/v14.9.0...v14.10.0) (2022-09-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add ability to set extra labels on components ([#1669](https://github.com/googleapis/release-please/issues/1669)) ([e05d43e](https://github.com/googleapis/release-please/commit/e05d43e0e9eb35ea7d9b47d7e0b13effc4c1422a)), closes [#1624](https://github.com/googleapis/release-please/issues/1624)
|
|
20
|
+
* **cli:** Add debug command for loading a manifest config ([#1671](https://github.com/googleapis/release-please/issues/1671)) ([98078a3](https://github.com/googleapis/release-please/commit/98078a3d3fab0eeaf456fbcbe1827dc0185d0424))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **cli:** bootstrap command respects --dry-run argument ([67fcb19](https://github.com/googleapis/release-please/commit/67fcb19cf3a7334092c08b65ae7b2c83b16db5d6))
|
|
26
|
+
* fix schema definition for label and release-label ([e05d43e](https://github.com/googleapis/release-please/commit/e05d43e0e9eb35ea7d9b47d7e0b13effc4c1422a))
|
|
27
|
+
* Manifest config bootstrapper should include schema field ([#1670](https://github.com/googleapis/release-please/issues/1670)) ([67fcb19](https://github.com/googleapis/release-please/commit/67fcb19cf3a7334092c08b65ae7b2c83b16db5d6))
|
|
28
|
+
|
|
7
29
|
## [14.9.0](https://github.com/googleapis/release-please/compare/v14.8.0...v14.9.0) (2022-09-30)
|
|
8
30
|
|
|
9
31
|
|
package/README.md
CHANGED
|
@@ -121,8 +121,8 @@ prefixes: "feat", "fix", and "deps".
|
|
|
121
121
|
Some languages have their specific releasable unit configuration. For example,
|
|
122
122
|
"docs" is a prefix for releasable units in Java and Python.
|
|
123
123
|
|
|
124
|
-
If you think Release Please missed
|
|
125
|
-
with
|
|
124
|
+
If you think Release Please missed creating a release PR after a pull request
|
|
125
|
+
with a releasable unit has been merged, please re-run `release-please`. If you are using
|
|
126
126
|
the GitHub application, add `release-please:force-run` label to the merged pull request. If
|
|
127
127
|
you are using the action, look for the failed invocation and retry the workflow run.
|
|
128
128
|
Release Please will process the pull request immediately to find releasable units.
|
|
@@ -171,7 +171,7 @@ for installation and configuration instructions.
|
|
|
171
171
|
## Bootstrapping your Repository
|
|
172
172
|
|
|
173
173
|
Release Please looks at commits since your last release tag. It may or may not be able to find
|
|
174
|
-
your previous releases. The easiest way to
|
|
174
|
+
your previous releases. The easiest way to onboard your repository is to
|
|
175
175
|
[bootstrap a manifest config](/docs/cli.md#bootstrapping).
|
|
176
176
|
|
|
177
177
|
## Customizing Release Please
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as yargs from 'yargs';
|
|
3
|
-
import { ChangelogSection } from '../changelog-notes';
|
|
4
|
-
import { ReleaseType, VersioningStrategyType } from '../factory';
|
|
5
3
|
interface ErrorObject {
|
|
6
4
|
body?: object;
|
|
7
5
|
status?: number;
|
|
@@ -23,47 +21,9 @@ interface ManifestArgs {
|
|
|
23
21
|
configFile?: string;
|
|
24
22
|
manifestFile?: string;
|
|
25
23
|
}
|
|
26
|
-
interface
|
|
27
|
-
bumpMinorPreMajor?: boolean;
|
|
28
|
-
bumpPatchForMinorPreMajor?: boolean;
|
|
29
|
-
releaseAs?: string;
|
|
30
|
-
lastPackageVersion?: string;
|
|
31
|
-
latestTagVersion?: string;
|
|
32
|
-
latestTagSha?: string;
|
|
33
|
-
latestTagName?: string;
|
|
24
|
+
interface DebugConfigArgs extends GitHubArgs, ManifestArgs {
|
|
34
25
|
}
|
|
35
|
-
|
|
36
|
-
path?: string;
|
|
37
|
-
component?: string;
|
|
38
|
-
packageName?: string;
|
|
39
|
-
releaseType?: ReleaseType;
|
|
40
|
-
}
|
|
41
|
-
interface ReleaseArgs {
|
|
42
|
-
draft?: boolean;
|
|
43
|
-
prerelease?: boolean;
|
|
44
|
-
releaseLabel?: string;
|
|
45
|
-
snapshotLabel?: string;
|
|
46
|
-
label?: string;
|
|
47
|
-
}
|
|
48
|
-
interface PullRequestArgs {
|
|
49
|
-
draftPullRequest?: boolean;
|
|
50
|
-
label?: string;
|
|
51
|
-
skipLabeling?: boolean;
|
|
52
|
-
signoff?: string;
|
|
53
|
-
}
|
|
54
|
-
interface PullRequestStrategyArgs {
|
|
55
|
-
snapshot?: boolean;
|
|
56
|
-
changelogSections?: ChangelogSection[];
|
|
57
|
-
changelogPath?: string;
|
|
58
|
-
changelogHost?: string;
|
|
59
|
-
versioningStrategy?: VersioningStrategyType;
|
|
60
|
-
versionFile?: string;
|
|
61
|
-
extraFiles?: string[];
|
|
62
|
-
}
|
|
63
|
-
interface BootstrapArgs extends GitHubArgs, ManifestArgs, ManifestConfigArgs, VersioningArgs, PullRequestArgs, PullRequestStrategyArgs, ReleaseArgs {
|
|
64
|
-
initialVersion?: string;
|
|
65
|
-
}
|
|
66
|
-
export declare const parser: yargs.Argv<yargs.Omit<BootstrapArgs & {
|
|
26
|
+
export declare const parser: yargs.Argv<yargs.Omit<DebugConfigArgs & {
|
|
67
27
|
debug: boolean;
|
|
68
28
|
}, "trace"> & {
|
|
69
29
|
trace: boolean;
|
|
@@ -472,7 +472,7 @@ const bootstrapCommand = {
|
|
|
472
472
|
github.repository.defaultBranch;
|
|
473
473
|
const bootstrapper = new bootstrapper_1.Bootstrapper(github, targetBranch, argv.manifestFile, argv.configFile, argv.initialVersion);
|
|
474
474
|
const path = argv.path || manifest_1.ROOT_PROJECT_PATH;
|
|
475
|
-
const
|
|
475
|
+
const releaserConfig = {
|
|
476
476
|
releaseType: argv.releaseType,
|
|
477
477
|
component: argv.component,
|
|
478
478
|
packageName: argv.packageName,
|
|
@@ -488,8 +488,51 @@ const bootstrapCommand = {
|
|
|
488
488
|
versioning: argv.versioningStrategy,
|
|
489
489
|
extraFiles: argv.extraFiles,
|
|
490
490
|
versionFile: argv.versionFile,
|
|
491
|
-
}
|
|
492
|
-
|
|
491
|
+
};
|
|
492
|
+
if (argv.dryRun) {
|
|
493
|
+
const pullRequest = await await bootstrapper.buildPullRequest(path, releaserConfig);
|
|
494
|
+
console.log('Would open 1 pull request');
|
|
495
|
+
console.log('title:', pullRequest.title);
|
|
496
|
+
console.log('branch:', pullRequest.headBranchName);
|
|
497
|
+
console.log('body:', pullRequest.body);
|
|
498
|
+
console.log('updates:', pullRequest.updates.length);
|
|
499
|
+
const changes = await github.buildChangeSet(pullRequest.updates, targetBranch);
|
|
500
|
+
for (const update of pullRequest.updates) {
|
|
501
|
+
console.log(` ${update.path}: `,
|
|
502
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
503
|
+
update.updater.constructor);
|
|
504
|
+
if (argv.trace) {
|
|
505
|
+
const change = changes.get(update.path);
|
|
506
|
+
if (change) {
|
|
507
|
+
const patch = (0, diff_1.createPatch)(update.path, change.originalContent || '', change.content || '');
|
|
508
|
+
console.log(patch);
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
console.warn(`no change found for ${update.path}`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
const pullRequest = await bootstrapper.bootstrap(path, releaserConfig);
|
|
518
|
+
console.log(pullRequest);
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
};
|
|
522
|
+
const debugConfigCommand = {
|
|
523
|
+
command: 'debug-config',
|
|
524
|
+
describe: 'debug manifest config',
|
|
525
|
+
builder(yargs) {
|
|
526
|
+
return manifestConfigOptions(manifestOptions(gitHubOptions(yargs)));
|
|
527
|
+
},
|
|
528
|
+
async handler(argv) {
|
|
529
|
+
const github = await buildGitHub(argv);
|
|
530
|
+
const manifestOptions = extractManifestOptions(argv);
|
|
531
|
+
const targetBranch = argv.targetBranch ||
|
|
532
|
+
argv.defaultBranch ||
|
|
533
|
+
github.repository.defaultBranch;
|
|
534
|
+
const manifest = await manifest_1.Manifest.fromManifest(github, targetBranch, argv.configFile, argv.manifestFile, manifestOptions);
|
|
535
|
+
console.log(manifest);
|
|
493
536
|
},
|
|
494
537
|
};
|
|
495
538
|
async function buildGitHub(argv) {
|
|
@@ -509,6 +552,7 @@ exports.parser = yargs
|
|
|
509
552
|
.command(createManifestPullRequestCommand)
|
|
510
553
|
.command(createManifestReleaseCommand)
|
|
511
554
|
.command(bootstrapCommand)
|
|
555
|
+
.command(debugConfigCommand)
|
|
512
556
|
.option('debug', {
|
|
513
557
|
describe: 'print verbose errors (use only for local debugging).',
|
|
514
558
|
default: false,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { GitHub } from './github';
|
|
2
2
|
import { ReleaserConfig } from './manifest';
|
|
3
3
|
import { PullRequest } from './pull-request';
|
|
4
|
+
import { Update } from './update';
|
|
5
|
+
interface BootstrapPullRequest extends PullRequest {
|
|
6
|
+
updates: Update[];
|
|
7
|
+
}
|
|
4
8
|
export declare class Bootstrapper {
|
|
5
9
|
private github;
|
|
6
10
|
private targetBranch;
|
|
@@ -9,4 +13,6 @@ export declare class Bootstrapper {
|
|
|
9
13
|
private initialVersion;
|
|
10
14
|
constructor(github: GitHub, targetBranch: string, manifestFile?: string, configFile?: string, initialVersionString?: string);
|
|
11
15
|
bootstrap(path: string, config: ReleaserConfig): Promise<PullRequest>;
|
|
16
|
+
buildPullRequest(path: string, config: ReleaserConfig): Promise<BootstrapPullRequest>;
|
|
12
17
|
}
|
|
18
|
+
export {};
|
|
@@ -27,17 +27,12 @@ class Bootstrapper {
|
|
|
27
27
|
this.initialVersion = version_1.Version.parse(initialVersionString);
|
|
28
28
|
}
|
|
29
29
|
async bootstrap(path, config) {
|
|
30
|
+
const pullRequest = await this.buildPullRequest(path, config);
|
|
31
|
+
return await this.github.createPullRequest(pullRequest, this.targetBranch, pullRequest.title, pullRequest.updates, {});
|
|
32
|
+
}
|
|
33
|
+
async buildPullRequest(path, config) {
|
|
30
34
|
const message = `chore: bootstrap releases for path: ${path}`;
|
|
31
35
|
const branchName = path === manifest_1.ROOT_PROJECT_PATH ? 'default' : path;
|
|
32
|
-
const pullRequest = {
|
|
33
|
-
headBranchName: `release-please/bootstrap/${branchName}`,
|
|
34
|
-
baseBranchName: this.targetBranch,
|
|
35
|
-
number: -1,
|
|
36
|
-
title: message,
|
|
37
|
-
body: `Configuring release-please for path: ${path}`,
|
|
38
|
-
labels: [],
|
|
39
|
-
files: [],
|
|
40
|
-
};
|
|
41
36
|
const version = this.initialVersion;
|
|
42
37
|
const versionsMap = new Map();
|
|
43
38
|
versionsMap.set(path, version);
|
|
@@ -53,7 +48,16 @@ class Bootstrapper {
|
|
|
53
48
|
updater: new release_please_config_1.ReleasePleaseConfig(path, config),
|
|
54
49
|
},
|
|
55
50
|
];
|
|
56
|
-
return
|
|
51
|
+
return {
|
|
52
|
+
title: message,
|
|
53
|
+
body: `Configuring release-please for path: ${path}`,
|
|
54
|
+
baseBranchName: this.targetBranch,
|
|
55
|
+
headBranchName: `release-please/bootstrap/${branchName}`,
|
|
56
|
+
updates,
|
|
57
|
+
number: -1,
|
|
58
|
+
labels: [],
|
|
59
|
+
files: [],
|
|
60
|
+
};
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
exports.Bootstrapper = Bootstrapper;
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Logger } from './util/logger';
|
|
|
6
6
|
import { ReleasePullRequest } from './release-pull-request';
|
|
7
7
|
import { ReleaseType, VersioningStrategyType, ChangelogNotesType } from './factory';
|
|
8
8
|
import { Release } from './release';
|
|
9
|
+
import { ManifestPlugin } from './plugin';
|
|
9
10
|
declare type ExtraJsonFile = {
|
|
10
11
|
type: 'json';
|
|
11
12
|
path: string;
|
|
@@ -53,6 +54,7 @@ export interface ReleaserConfig {
|
|
|
53
54
|
separatePullRequests?: boolean;
|
|
54
55
|
labels?: string[];
|
|
55
56
|
releaseLabels?: string[];
|
|
57
|
+
extraLabels?: string[];
|
|
56
58
|
initialVersion?: string;
|
|
57
59
|
changelogSections?: ChangelogSection[];
|
|
58
60
|
changelogPath?: string;
|
|
@@ -87,6 +89,7 @@ interface ReleaserConfigJson {
|
|
|
87
89
|
'draft-pull-request'?: boolean;
|
|
88
90
|
label?: string;
|
|
89
91
|
'release-label'?: string;
|
|
92
|
+
'extra-label'?: string;
|
|
90
93
|
'include-component-in-tag'?: boolean;
|
|
91
94
|
'include-v-in-tag'?: boolean;
|
|
92
95
|
'changelog-type'?: ChangelogNotesType;
|
|
@@ -194,7 +197,7 @@ export declare class Manifest {
|
|
|
194
197
|
private sequentialCalls?;
|
|
195
198
|
private releaseLabels;
|
|
196
199
|
private snapshotLabels;
|
|
197
|
-
|
|
200
|
+
readonly plugins: ManifestPlugin[];
|
|
198
201
|
private _strategiesByPath?;
|
|
199
202
|
private _pathsByComponent?;
|
|
200
203
|
private manifestPath;
|
package/build/src/manifest.js
CHANGED
|
@@ -73,7 +73,6 @@ class Manifest {
|
|
|
73
73
|
(manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.manifestPath) || exports.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
|
74
74
|
this.separatePullRequests =
|
|
75
75
|
(_a = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.separatePullRequests) !== null && _a !== void 0 ? _a : Object.keys(repositoryConfig).length === 1;
|
|
76
|
-
this.plugins = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.plugins) || [];
|
|
77
76
|
this.fork = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.fork) || false;
|
|
78
77
|
this.signoffUser = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.signoff;
|
|
79
78
|
this.releaseLabels =
|
|
@@ -94,6 +93,13 @@ class Manifest {
|
|
|
94
93
|
this.commitSearchDepth =
|
|
95
94
|
(manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.commitSearchDepth) || DEFAULT_COMMIT_SEARCH_DEPTH;
|
|
96
95
|
this.logger = (_b = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.logger) !== null && _b !== void 0 ? _b : logger_1.logger;
|
|
96
|
+
this.plugins = ((manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.plugins) || []).map(pluginType => (0, factory_1.buildPlugin)({
|
|
97
|
+
type: pluginType,
|
|
98
|
+
github: this.github,
|
|
99
|
+
targetBranch: this.targetBranch,
|
|
100
|
+
repositoryConfig: this.repositoryConfig,
|
|
101
|
+
manifestPath: this.manifestPath,
|
|
102
|
+
}));
|
|
97
103
|
}
|
|
98
104
|
/**
|
|
99
105
|
* Create a Manifest from config files in the repository.
|
|
@@ -311,16 +317,8 @@ class Manifest {
|
|
|
311
317
|
};
|
|
312
318
|
}
|
|
313
319
|
}
|
|
314
|
-
// Build plugins
|
|
315
|
-
const plugins = this.plugins.map(pluginType => (0, factory_1.buildPlugin)({
|
|
316
|
-
type: pluginType,
|
|
317
|
-
github: this.github,
|
|
318
|
-
targetBranch: this.targetBranch,
|
|
319
|
-
repositoryConfig: this.repositoryConfig,
|
|
320
|
-
manifestPath: this.manifestPath,
|
|
321
|
-
}));
|
|
322
320
|
let strategies = strategiesByPath;
|
|
323
|
-
for (const plugin of plugins) {
|
|
321
|
+
for (const plugin of this.plugins) {
|
|
324
322
|
strategies = await plugin.preconfigure(strategies, commitsPerPath, releasesByPath);
|
|
325
323
|
}
|
|
326
324
|
let newReleasePullRequests = [];
|
|
@@ -333,7 +331,7 @@ class Manifest {
|
|
|
333
331
|
// The processCommits hook can be implemented by plugins to
|
|
334
332
|
// post-process commits. This can be used to perform cleanup, e.g,, sentence
|
|
335
333
|
// casing all commit messages:
|
|
336
|
-
for (const plugin of plugins) {
|
|
334
|
+
for (const plugin of this.plugins) {
|
|
337
335
|
pathCommits = plugin.processCommits(pathCommits);
|
|
338
336
|
}
|
|
339
337
|
this.logger.debug(`commits: ${pathCommits.length}`);
|
|
@@ -369,9 +367,9 @@ class Manifest {
|
|
|
369
367
|
// Combine pull requests into 1 unless configured for separate
|
|
370
368
|
// pull requests
|
|
371
369
|
if (!this.separatePullRequests) {
|
|
372
|
-
plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
|
|
370
|
+
this.plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
|
|
373
371
|
}
|
|
374
|
-
for (const plugin of plugins) {
|
|
372
|
+
for (const plugin of this.plugins) {
|
|
375
373
|
this.logger.debug(`running plugin: ${plugin.constructor.name}`);
|
|
376
374
|
newReleasePullRequests = await plugin.run(newReleasePullRequests);
|
|
377
375
|
}
|
|
@@ -715,7 +713,7 @@ exports.Manifest = Manifest;
|
|
|
715
713
|
* @returns {ReleaserConfig}
|
|
716
714
|
*/
|
|
717
715
|
function extractReleaserConfig(config) {
|
|
718
|
-
var _a, _b;
|
|
716
|
+
var _a, _b, _c;
|
|
719
717
|
return {
|
|
720
718
|
releaseType: config['release-type'],
|
|
721
719
|
bumpMinorPreMajor: config['bump-minor-pre-major'],
|
|
@@ -742,6 +740,7 @@ function extractReleaserConfig(config) {
|
|
|
742
740
|
separatePullRequests: config['separate-pull-requests'],
|
|
743
741
|
labels: (_a = config['label']) === null || _a === void 0 ? void 0 : _a.split(','),
|
|
744
742
|
releaseLabels: (_b = config['release-label']) === null || _b === void 0 ? void 0 : _b.split(','),
|
|
743
|
+
extraLabels: (_c = config['extra-label']) === null || _c === void 0 ? void 0 : _c.split(','),
|
|
745
744
|
skipSnapshot: config['skip-snapshot'],
|
|
746
745
|
initialVersion: config['initial-version'],
|
|
747
746
|
};
|
|
@@ -771,6 +770,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
|
|
|
771
770
|
const configLabel = config['label'];
|
|
772
771
|
const configReleaseLabel = config['release-label'];
|
|
773
772
|
const configSnapshotLabel = config['snapshot-label'];
|
|
773
|
+
const configExtraLabel = config['extra-label'];
|
|
774
774
|
const manifestOptions = {
|
|
775
775
|
bootstrapSha: config['bootstrap-sha'],
|
|
776
776
|
lastReleaseSha: config['last-release-sha'],
|
|
@@ -781,6 +781,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
|
|
|
781
781
|
labels: configLabel === null || configLabel === void 0 ? void 0 : configLabel.split(','),
|
|
782
782
|
releaseLabels: configReleaseLabel === null || configReleaseLabel === void 0 ? void 0 : configReleaseLabel.split(','),
|
|
783
783
|
snapshotLabels: configSnapshotLabel === null || configSnapshotLabel === void 0 ? void 0 : configSnapshotLabel.split(','),
|
|
784
|
+
extraLabels: configExtraLabel === null || configExtraLabel === void 0 ? void 0 : configExtraLabel.split(','),
|
|
784
785
|
releaseSearchDepth: config['release-search-depth'],
|
|
785
786
|
commitSearchDepth: config['commit-search-depth'],
|
|
786
787
|
sequentialCalls: config['sequential-calls'],
|
|
@@ -950,7 +951,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
950
951
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
951
952
|
}
|
|
952
953
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
953
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
|
|
954
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
954
955
|
return {
|
|
955
956
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
956
957
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -976,6 +977,7 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
976
977
|
separatePullRequests: (_y = pathConfig.separatePullRequests) !== null && _y !== void 0 ? _y : defaultConfig.separatePullRequests,
|
|
977
978
|
skipSnapshot: (_z = pathConfig.skipSnapshot) !== null && _z !== void 0 ? _z : defaultConfig.skipSnapshot,
|
|
978
979
|
initialVersion: (_0 = pathConfig.initialVersion) !== null && _0 !== void 0 ? _0 : defaultConfig.initialVersion,
|
|
980
|
+
extraLabels: (_1 = pathConfig.extraLabels) !== null && _1 !== void 0 ? _1 : defaultConfig.extraLabels,
|
|
979
981
|
};
|
|
980
982
|
}
|
|
981
983
|
/**
|
|
@@ -16,9 +16,9 @@ interface LinkedVersionsPluginOptions {
|
|
|
16
16
|
* Release notes are broken up using `<summary>`/`<details>` blocks.
|
|
17
17
|
*/
|
|
18
18
|
export declare class LinkedVersions extends ManifestPlugin {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
readonly groupName: string;
|
|
20
|
+
readonly components: Set<string>;
|
|
21
|
+
readonly merge: boolean;
|
|
22
22
|
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, groupName: string, components: string[], options?: LinkedVersionsPluginOptions);
|
|
23
23
|
/**
|
|
24
24
|
* Pre-configure strategies.
|
|
@@ -48,6 +48,7 @@ export interface BaseStrategyOptions {
|
|
|
48
48
|
skipSnapshot?: boolean;
|
|
49
49
|
logger?: Logger;
|
|
50
50
|
initialVersion?: string;
|
|
51
|
+
extraLabels?: string[];
|
|
51
52
|
}
|
|
52
53
|
/**
|
|
53
54
|
* A strategy is responsible for determining which files are
|
|
@@ -73,6 +74,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
73
74
|
readonly pullRequestTitlePattern?: string;
|
|
74
75
|
readonly pullRequestHeader?: string;
|
|
75
76
|
readonly extraFiles: ExtraFile[];
|
|
77
|
+
readonly extraLabels: string[];
|
|
76
78
|
readonly changelogNotes: ChangelogNotes;
|
|
77
79
|
protected changelogSections?: ChangelogSection[];
|
|
78
80
|
constructor(options: BaseStrategyOptions);
|
|
@@ -63,6 +63,7 @@ class BaseStrategy {
|
|
|
63
63
|
this.pullRequestHeader = options.pullRequestHeader;
|
|
64
64
|
this.extraFiles = options.extraFiles || [];
|
|
65
65
|
this.initialVersion = options.initialVersion;
|
|
66
|
+
this.extraLabels = options.extraLabels || [];
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* Return the component for this strategy. This may be a computed field.
|
|
@@ -172,7 +173,7 @@ class BaseStrategy {
|
|
|
172
173
|
title: pullRequestTitle,
|
|
173
174
|
body: pullRequestBody,
|
|
174
175
|
updates: updatesWithExtras,
|
|
175
|
-
labels,
|
|
176
|
+
labels: [...labels, ...this.extraLabels],
|
|
176
177
|
headRefName: branchName.toString(),
|
|
177
178
|
version: newVersion,
|
|
178
179
|
draft: draft !== null && draft !== void 0 ? draft : false,
|
|
@@ -99,7 +99,7 @@ class Java extends base_1.BaseStrategy {
|
|
|
99
99
|
title: pullRequestTitle,
|
|
100
100
|
body: pullRequestBody,
|
|
101
101
|
updates: updatesWithExtras,
|
|
102
|
-
labels: labels,
|
|
102
|
+
labels: [...labels, ...this.extraLabels],
|
|
103
103
|
headRefName: branchName.toString(),
|
|
104
104
|
version: newVersion,
|
|
105
105
|
draft: draft !== null && draft !== void 0 ? draft : false,
|
|
@@ -147,7 +147,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
147
147
|
title: pullRequestTitle,
|
|
148
148
|
body: pullRequestBody,
|
|
149
149
|
updates,
|
|
150
|
-
labels,
|
|
150
|
+
labels: [...labels, ...this.extraLabels],
|
|
151
151
|
headRefName: branchName.toString(),
|
|
152
152
|
version: newVersion,
|
|
153
153
|
draft: draft !== null && draft !== void 0 ? draft : false,
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ReleasePleaseConfig = void 0;
|
|
17
17
|
const json_stringify_1 = require("../util/json-stringify");
|
|
18
|
+
const SCHEMA_URL = 'https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json';
|
|
18
19
|
class ReleasePleaseConfig {
|
|
19
20
|
constructor(path, config) {
|
|
20
21
|
this.path = path;
|
|
21
22
|
this.config = config;
|
|
22
23
|
}
|
|
23
24
|
updateContent(content) {
|
|
25
|
+
var _a;
|
|
24
26
|
let parsed;
|
|
25
27
|
if (content) {
|
|
26
28
|
parsed = JSON.parse(content);
|
|
@@ -28,6 +30,7 @@ class ReleasePleaseConfig {
|
|
|
28
30
|
else {
|
|
29
31
|
parsed = { packages: {} };
|
|
30
32
|
}
|
|
33
|
+
parsed['$schema'] = (_a = parsed['$schema']) !== null && _a !== void 0 ? _a : SCHEMA_URL;
|
|
31
34
|
parsed.packages[this.path] = releaserConfigToJsonConfig(this.config);
|
|
32
35
|
if (content) {
|
|
33
36
|
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
package/package.json
CHANGED
package/schemas/config.json
CHANGED
|
@@ -66,12 +66,8 @@
|
|
|
66
66
|
"description": "Open the release pull request in draft mode. Defaults to `false`.",
|
|
67
67
|
"type": "boolean"
|
|
68
68
|
},
|
|
69
|
-
"label": {
|
|
70
|
-
"description": "Comma-separated list of labels to add to newly opened pull request",
|
|
71
|
-
"type": "string"
|
|
72
|
-
},
|
|
73
|
-
"release-label": {
|
|
74
|
-
"description": "Comma-separated list of labels to add to a pull request that has been released/tagged",
|
|
69
|
+
"extra-label": {
|
|
70
|
+
"description": "Comma-separated list of labels to add to a newly opened pull request",
|
|
75
71
|
"type": "string"
|
|
76
72
|
},
|
|
77
73
|
"include-component-in-tag": {
|
|
@@ -345,6 +341,14 @@
|
|
|
345
341
|
"sequential-calls": {
|
|
346
342
|
"description": "Whether to open pull requests/releases sequentially rather than concurrently. If you have many components, you may want to set this to avoid secondary rate limits.",
|
|
347
343
|
"type": "boolean"
|
|
344
|
+
},
|
|
345
|
+
"label": {
|
|
346
|
+
"description": "Comma-separated list of labels to add to newly opened pull request. These are used to identify release pull requests.",
|
|
347
|
+
"type": "string"
|
|
348
|
+
},
|
|
349
|
+
"release-label": {
|
|
350
|
+
"description": "Comma-separated list of labels to add to a pull request that has been released/tagged",
|
|
351
|
+
"type": "string"
|
|
348
352
|
}
|
|
349
353
|
},
|
|
350
354
|
"required": ["packages"]
|
|
@@ -373,6 +377,7 @@
|
|
|
373
377
|
"draft-pull-request": true,
|
|
374
378
|
"label": true,
|
|
375
379
|
"release-label": true,
|
|
380
|
+
"extra-label": true,
|
|
376
381
|
"include-component-in-tag": true,
|
|
377
382
|
"include-v-in-tag": true,
|
|
378
383
|
"changelog-type": true,
|