release-please 13.19.9 → 14.0.0
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 +38 -0
- package/README.md +8 -1
- package/build/src/factories/plugin-factory.js +4 -1
- package/build/src/github.d.ts +1 -0
- package/build/src/github.js +14 -6
- package/build/src/manifest.d.ts +8 -1
- package/build/src/manifest.js +26 -19
- package/build/src/plugins/cargo-workspace.js +8 -2
- package/build/src/plugins/linked-versions.d.ts +6 -1
- package/build/src/plugins/linked-versions.js +6 -1
- package/build/src/plugins/workspace.d.ts +2 -0
- package/build/src/plugins/workspace.js +15 -17
- package/build/src/strategies/base.d.ts +1 -0
- package/build/src/strategies/java.d.ts +1 -0
- package/build/src/strategies/java.js +5 -1
- package/package.json +8 -8
- package/schemas/config.json +33 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,44 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [14.0.0](https://github.com/googleapis/release-please/compare/v13.21.0...v14.0.0) (2022-08-15)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **deps:** update octokit packages
|
|
13
|
+
* drop node 12 support (#1577)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **deps:** update code-suggester to v4 ([3fc0173](https://github.com/googleapis/release-please/commit/3fc0173e7342e082794c1911b2e7a6e61d810348))
|
|
18
|
+
* **deps:** update octokit packages ([3fc0173](https://github.com/googleapis/release-please/commit/3fc0173e7342e082794c1911b2e7a6e61d810348))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Build System
|
|
22
|
+
|
|
23
|
+
* drop node 12 support ([#1577](https://github.com/googleapis/release-please/issues/1577)) ([3fc0173](https://github.com/googleapis/release-please/commit/3fc0173e7342e082794c1911b2e7a6e61d810348))
|
|
24
|
+
|
|
25
|
+
## [13.21.0](https://github.com/googleapis/release-please/compare/v13.20.0...v13.21.0) (2022-08-11)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* parse versioning type from the manifest config ([#1572](https://github.com/googleapis/release-please/issues/1572)) ([8a7bfc1](https://github.com/googleapis/release-please/commit/8a7bfc165755cec97cc9a3baa39ccd21e719644c)), closes [#1569](https://github.com/googleapis/release-please/issues/1569)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* throw underlying API error when the manifest fetch commits when determining the latest released version ([#1571](https://github.com/googleapis/release-please/issues/1571)) ([0944bde](https://github.com/googleapis/release-please/commit/0944bdeb04bcee2872e79a07fbe05967847caef0))
|
|
36
|
+
|
|
37
|
+
## [13.20.0](https://github.com/googleapis/release-please/compare/v13.19.9...v13.20.0) (2022-08-08)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Features
|
|
41
|
+
|
|
42
|
+
* allow plugins to skip merging in-scope pull requests ([#1550](https://github.com/googleapis/release-please/issues/1550)) ([354b1dc](https://github.com/googleapis/release-please/commit/354b1dc89c468e44b59507b4bb2f15d6723110ed))
|
|
43
|
+
* allow skipping snapshots for java strategies ([#1555](https://github.com/googleapis/release-please/issues/1555)) ([3430693](https://github.com/googleapis/release-please/commit/34306932e5fe21c89020b184a527c220d10c8390))
|
|
44
|
+
|
|
7
45
|
## [13.19.9](https://github.com/googleapis/release-please/compare/v13.19.8...v13.19.9) (2022-08-08)
|
|
8
46
|
|
|
9
47
|
|
package/README.md
CHANGED
|
@@ -115,11 +115,18 @@ commit message instead of the merged commit message.
|
|
|
115
115
|
Release Please creates a release pull request after it notices the default branch
|
|
116
116
|
contains "releasable units" since the last release.
|
|
117
117
|
A releasable unit is a commit to the branch with one of the following
|
|
118
|
-
prefixes: "feat"
|
|
118
|
+
prefixes: "feat", "fix", and "deps".
|
|
119
|
+
(A "chore" or "build" commit is not a releasable unit.)
|
|
119
120
|
|
|
120
121
|
Some languages have their specific releasable unit configuration. For example,
|
|
121
122
|
"docs" is a prefix for releasable units in Java and Python.
|
|
122
123
|
|
|
124
|
+
If you think Release Please missed to create a release PR after a pull request
|
|
125
|
+
with with releasable unit has been merged, please re-run `release-please`. If you are using
|
|
126
|
+
the GitHub application, add `release-please:force-run` label to the merged pull request. If
|
|
127
|
+
you are using the action, look for the failed invocation and retry the workflow run.
|
|
128
|
+
Release Please will process the pull request immediately to find releasable units.
|
|
129
|
+
|
|
123
130
|
## Strategy (Language) types supported
|
|
124
131
|
|
|
125
132
|
Release Please automates releases for the following flavors of repositories:
|
|
@@ -29,7 +29,10 @@ function buildPlugin(options) {
|
|
|
29
29
|
if (typeof options.type === 'object') {
|
|
30
30
|
const builder = pluginFactories[options.type.type];
|
|
31
31
|
if (builder) {
|
|
32
|
-
return builder(
|
|
32
|
+
return builder({
|
|
33
|
+
...options.type,
|
|
34
|
+
...options,
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
35
38
|
}
|
package/build/src/github.d.ts
CHANGED
package/build/src/github.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// See the License for the specific language governing permissions and
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.GitHub = exports.GH_GRAPHQL_URL = exports.GH_API_URL = void 0;
|
|
16
|
+
exports.sleepInMs = exports.GitHub = exports.GH_GRAPHQL_URL = exports.GH_API_URL = void 0;
|
|
17
17
|
const code_suggester_1 = require("code-suggester");
|
|
18
18
|
const rest_1 = require("@octokit/rest");
|
|
19
19
|
const request_1 = require("@octokit/request");
|
|
@@ -21,6 +21,7 @@ const graphql_1 = require("@octokit/graphql");
|
|
|
21
21
|
const request_error_1 = require("@octokit/request-error");
|
|
22
22
|
const errors_1 = require("./errors");
|
|
23
23
|
const MAX_ISSUE_BODY_SIZE = 65536;
|
|
24
|
+
const MAX_SLEEP_SECONDS = 20;
|
|
24
25
|
exports.GH_API_URL = 'https://api.github.com';
|
|
25
26
|
exports.GH_GRAPHQL_URL = 'https://api.github.com';
|
|
26
27
|
const logger_1 = require("./util/logger");
|
|
@@ -58,7 +59,9 @@ class GitHub {
|
|
|
58
59
|
}
|
|
59
60
|
return files;
|
|
60
61
|
});
|
|
61
|
-
this.graphqlRequest = wrapAsync(async (opts,
|
|
62
|
+
this.graphqlRequest = wrapAsync(async (opts, options) => {
|
|
63
|
+
var _a;
|
|
64
|
+
let maxRetries = (_a = options === null || options === void 0 ? void 0 : options.maxRetries) !== null && _a !== void 0 ? _a : 5;
|
|
62
65
|
let seconds = 1;
|
|
63
66
|
while (maxRetries >= 0) {
|
|
64
67
|
try {
|
|
@@ -72,13 +75,17 @@ class GitHub {
|
|
|
72
75
|
if (err.status !== 502) {
|
|
73
76
|
throw err;
|
|
74
77
|
}
|
|
75
|
-
|
|
78
|
+
if (maxRetries === 0) {
|
|
79
|
+
logger_1.logger.warn('ran out of retries and response is required');
|
|
80
|
+
throw err;
|
|
81
|
+
}
|
|
82
|
+
logger_1.logger.info(`received 502 error, ${maxRetries} attempts remaining`);
|
|
76
83
|
}
|
|
77
84
|
maxRetries -= 1;
|
|
78
85
|
if (maxRetries >= 0) {
|
|
79
86
|
logger_1.logger.trace(`sleeping ${seconds} seconds`);
|
|
80
|
-
await sleepInMs(1000 * seconds);
|
|
81
|
-
seconds
|
|
87
|
+
await (0, exports.sleepInMs)(1000 * seconds);
|
|
88
|
+
seconds = Math.min(seconds * 2, MAX_SLEEP_SECONDS);
|
|
82
89
|
}
|
|
83
90
|
}
|
|
84
91
|
logger_1.logger.trace('ran out of retries');
|
|
@@ -687,7 +694,7 @@ class GitHub {
|
|
|
687
694
|
targetBranch,
|
|
688
695
|
states,
|
|
689
696
|
maxFilesChanged: 64,
|
|
690
|
-
}
|
|
697
|
+
});
|
|
691
698
|
if (!((_a = response === null || response === void 0 ? void 0 : response.repository) === null || _a === void 0 ? void 0 : _a.pullRequests)) {
|
|
692
699
|
logger_1.logger.warn(`Could not find merged pull requests for branch ${targetBranch} - it likely does not exist.`);
|
|
693
700
|
return null;
|
|
@@ -1004,4 +1011,5 @@ const wrapAsync = (fn, errorHandler) => {
|
|
|
1004
1011
|
};
|
|
1005
1012
|
};
|
|
1006
1013
|
const sleepInMs = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
1014
|
+
exports.sleepInMs = sleepInMs;
|
|
1007
1015
|
//# sourceMappingURL=github.js.map
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export interface ReleaserConfig {
|
|
|
54
54
|
versionFile?: string;
|
|
55
55
|
extraFiles?: ExtraFile[];
|
|
56
56
|
snapshotLabels?: string[];
|
|
57
|
+
skipSnapshot?: boolean;
|
|
57
58
|
}
|
|
58
59
|
export interface CandidateReleasePullRequest {
|
|
59
60
|
path: string;
|
|
@@ -68,6 +69,7 @@ export interface CandidateRelease extends Release {
|
|
|
68
69
|
}
|
|
69
70
|
interface ReleaserConfigJson {
|
|
70
71
|
'release-type'?: ReleaseType;
|
|
72
|
+
versioning?: VersioningStrategyType;
|
|
71
73
|
'bump-minor-pre-major'?: boolean;
|
|
72
74
|
'bump-patch-for-minor-pre-major'?: boolean;
|
|
73
75
|
'changelog-sections'?: ChangelogSection[];
|
|
@@ -88,6 +90,7 @@ interface ReleaserConfigJson {
|
|
|
88
90
|
'extra-files'?: ExtraFile[];
|
|
89
91
|
'version-file'?: string;
|
|
90
92
|
'snapshot-label'?: string;
|
|
93
|
+
'skip-snapshot'?: boolean;
|
|
91
94
|
}
|
|
92
95
|
export interface ManifestOptions {
|
|
93
96
|
bootstrapSha?: string;
|
|
@@ -123,8 +126,12 @@ export interface LinkedVersionPluginConfig extends ConfigurablePluginType {
|
|
|
123
126
|
type: 'linked-versions';
|
|
124
127
|
groupName: string;
|
|
125
128
|
components: string[];
|
|
129
|
+
merge?: boolean;
|
|
130
|
+
}
|
|
131
|
+
export interface WorkspacePluginConfig extends ConfigurablePluginType {
|
|
132
|
+
merge?: boolean;
|
|
126
133
|
}
|
|
127
|
-
export declare type PluginType = DirectPluginType | ConfigurablePluginType | LinkedVersionPluginConfig;
|
|
134
|
+
export declare type PluginType = DirectPluginType | ConfigurablePluginType | LinkedVersionPluginConfig | WorkspacePluginConfig;
|
|
128
135
|
/**
|
|
129
136
|
* This is the schema of the manifest config json
|
|
130
137
|
*/
|
package/build/src/manifest.js
CHANGED
|
@@ -365,6 +365,7 @@ class Manifest {
|
|
|
365
365
|
plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
|
|
366
366
|
}
|
|
367
367
|
for (const plugin of plugins) {
|
|
368
|
+
logger_1.logger.debug(`running plugin: ${plugin.constructor.name}`);
|
|
368
369
|
newReleasePullRequests = await plugin.run(newReleasePullRequests);
|
|
369
370
|
}
|
|
370
371
|
return newReleasePullRequests.map(pullRequestWithConfig => pullRequestWithConfig.pullRequest);
|
|
@@ -712,6 +713,7 @@ function extractReleaserConfig(config) {
|
|
|
712
713
|
releaseType: config['release-type'],
|
|
713
714
|
bumpMinorPreMajor: config['bump-minor-pre-major'],
|
|
714
715
|
bumpPatchForMinorPreMajor: config['bump-patch-for-minor-pre-major'],
|
|
716
|
+
versioning: config['versioning'],
|
|
715
717
|
changelogSections: config['changelog-sections'],
|
|
716
718
|
changelogPath: config['changelog-path'],
|
|
717
719
|
changelogHost: config['changelog-host'],
|
|
@@ -732,6 +734,7 @@ function extractReleaserConfig(config) {
|
|
|
732
734
|
separatePullRequests: config['separate-pull-requests'],
|
|
733
735
|
labels: (_a = config['label']) === null || _a === void 0 ? void 0 : _a.split(','),
|
|
734
736
|
releaseLabels: (_b = config['release-label']) === null || _b === void 0 ? void 0 : _b.split(','),
|
|
737
|
+
skipSnapshot: config['skip-snapshot'],
|
|
735
738
|
};
|
|
736
739
|
}
|
|
737
740
|
/**
|
|
@@ -865,7 +868,9 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
865
868
|
// only look at the last 250 or so commits to find the latest tag - we
|
|
866
869
|
// don't want to scan the entire repository history if this repo has never
|
|
867
870
|
// been released
|
|
868
|
-
const generator = github.mergeCommitIterator(targetBranch, {
|
|
871
|
+
const generator = github.mergeCommitIterator(targetBranch, {
|
|
872
|
+
maxResults: 250,
|
|
873
|
+
});
|
|
869
874
|
for await (const commitWithPullRequest of generator) {
|
|
870
875
|
commitShas.add(commitWithPullRequest.sha);
|
|
871
876
|
const mergedPullRequest = commitWithPullRequest.pullRequest;
|
|
@@ -936,28 +941,30 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
936
941
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
937
942
|
}
|
|
938
943
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
939
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
944
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
940
945
|
return {
|
|
941
946
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
942
947
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
943
948
|
bumpPatchForMinorPreMajor: (_d = pathConfig.bumpPatchForMinorPreMajor) !== null && _d !== void 0 ? _d : defaultConfig.bumpPatchForMinorPreMajor,
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
949
|
+
versioning: (_e = pathConfig.versioning) !== null && _e !== void 0 ? _e : defaultConfig.versioning,
|
|
950
|
+
changelogSections: (_f = pathConfig.changelogSections) !== null && _f !== void 0 ? _f : defaultConfig.changelogSections,
|
|
951
|
+
changelogPath: (_g = pathConfig.changelogPath) !== null && _g !== void 0 ? _g : defaultConfig.changelogPath,
|
|
952
|
+
changelogHost: (_h = pathConfig.changelogHost) !== null && _h !== void 0 ? _h : defaultConfig.changelogHost,
|
|
953
|
+
changelogType: (_j = pathConfig.changelogType) !== null && _j !== void 0 ? _j : defaultConfig.changelogType,
|
|
954
|
+
releaseAs: (_k = pathConfig.releaseAs) !== null && _k !== void 0 ? _k : defaultConfig.releaseAs,
|
|
955
|
+
skipGithubRelease: (_l = pathConfig.skipGithubRelease) !== null && _l !== void 0 ? _l : defaultConfig.skipGithubRelease,
|
|
956
|
+
draft: (_m = pathConfig.draft) !== null && _m !== void 0 ? _m : defaultConfig.draft,
|
|
957
|
+
prerelease: (_o = pathConfig.prerelease) !== null && _o !== void 0 ? _o : defaultConfig.prerelease,
|
|
958
|
+
component: (_p = pathConfig.component) !== null && _p !== void 0 ? _p : defaultConfig.component,
|
|
959
|
+
packageName: (_q = pathConfig.packageName) !== null && _q !== void 0 ? _q : defaultConfig.packageName,
|
|
960
|
+
versionFile: (_r = pathConfig.versionFile) !== null && _r !== void 0 ? _r : defaultConfig.versionFile,
|
|
961
|
+
extraFiles: (_s = pathConfig.extraFiles) !== null && _s !== void 0 ? _s : defaultConfig.extraFiles,
|
|
962
|
+
includeComponentInTag: (_t = pathConfig.includeComponentInTag) !== null && _t !== void 0 ? _t : defaultConfig.includeComponentInTag,
|
|
963
|
+
includeVInTag: (_u = pathConfig.includeVInTag) !== null && _u !== void 0 ? _u : defaultConfig.includeVInTag,
|
|
964
|
+
tagSeparator: (_v = pathConfig.tagSeparator) !== null && _v !== void 0 ? _v : defaultConfig.tagSeparator,
|
|
965
|
+
pullRequestTitlePattern: (_w = pathConfig.pullRequestTitlePattern) !== null && _w !== void 0 ? _w : defaultConfig.pullRequestTitlePattern,
|
|
966
|
+
separatePullRequests: (_x = pathConfig.separatePullRequests) !== null && _x !== void 0 ? _x : defaultConfig.separatePullRequests,
|
|
967
|
+
skipSnapshot: (_y = pathConfig.skipSnapshot) !== null && _y !== void 0 ? _y : defaultConfig.skipSnapshot,
|
|
961
968
|
};
|
|
962
969
|
}
|
|
963
970
|
/**
|
|
@@ -178,10 +178,16 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
postProcessCandidates(candidates, updatedVersions) {
|
|
181
|
-
|
|
181
|
+
let rootCandidate = candidates.find(c => c.path === manifest_1.ROOT_PROJECT_PATH);
|
|
182
182
|
if (!rootCandidate) {
|
|
183
|
-
|
|
183
|
+
logger_1.logger.warn('Unable to find root candidate pull request');
|
|
184
|
+
rootCandidate = candidates.find(c => c.config.releaseType === 'rust');
|
|
184
185
|
}
|
|
186
|
+
if (!rootCandidate) {
|
|
187
|
+
logger_1.logger.warn('Unable to find a rust candidate pull request');
|
|
188
|
+
return candidates;
|
|
189
|
+
}
|
|
190
|
+
// Update the root Cargo.lock if it exists
|
|
185
191
|
rootCandidate.pullRequest.updates.push({
|
|
186
192
|
path: 'Cargo.lock',
|
|
187
193
|
createIfMissing: false,
|
|
@@ -4,6 +4,9 @@ import { GitHub } from '../github';
|
|
|
4
4
|
import { Strategy } from '../strategy';
|
|
5
5
|
import { Commit } from '../commit';
|
|
6
6
|
import { Release } from '../release';
|
|
7
|
+
interface LinkedVersionsPluginOptions {
|
|
8
|
+
merge?: boolean;
|
|
9
|
+
}
|
|
7
10
|
/**
|
|
8
11
|
* This plugin reconfigures strategies by linking multiple components
|
|
9
12
|
* together.
|
|
@@ -13,7 +16,8 @@ import { Release } from '../release';
|
|
|
13
16
|
export declare class LinkedVersions extends ManifestPlugin {
|
|
14
17
|
private groupName;
|
|
15
18
|
private components;
|
|
16
|
-
|
|
19
|
+
private merge;
|
|
20
|
+
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, groupName: string, components: string[], options?: LinkedVersionsPluginOptions);
|
|
17
21
|
/**
|
|
18
22
|
* Pre-configure strategies.
|
|
19
23
|
* @param {Record<string, Strategy>} strategiesByPath Strategies indexed by path
|
|
@@ -27,3 +31,4 @@ export declare class LinkedVersions extends ManifestPlugin {
|
|
|
27
31
|
*/
|
|
28
32
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
29
33
|
}
|
|
34
|
+
export {};
|
|
@@ -25,10 +25,12 @@ const merge_1 = require("./merge");
|
|
|
25
25
|
* Release notes are broken up using `<summary>`/`<details>` blocks.
|
|
26
26
|
*/
|
|
27
27
|
class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
28
|
-
constructor(github, targetBranch, repositoryConfig, groupName, components) {
|
|
28
|
+
constructor(github, targetBranch, repositoryConfig, groupName, components, options = {}) {
|
|
29
|
+
var _a;
|
|
29
30
|
super(github, targetBranch, repositoryConfig);
|
|
30
31
|
this.groupName = groupName;
|
|
31
32
|
this.components = new Set(components);
|
|
33
|
+
this.merge = (_a = options.merge) !== null && _a !== void 0 ? _a : true;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Pre-configure strategies.
|
|
@@ -99,6 +101,9 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
|
99
101
|
* @returns {CandidateReleasePullRequest[]} Updated pull requests
|
|
100
102
|
*/
|
|
101
103
|
async run(candidates) {
|
|
104
|
+
if (!this.merge) {
|
|
105
|
+
return candidates;
|
|
106
|
+
}
|
|
102
107
|
const [inScopeCandidates, outOfScopeCandidates] = candidates.reduce((collection, candidate) => {
|
|
103
108
|
if (!candidate.pullRequest.version) {
|
|
104
109
|
logger_1.logger.warn('pull request missing version', candidate);
|
|
@@ -10,6 +10,7 @@ export interface DependencyNode<T> {
|
|
|
10
10
|
export interface WorkspacePluginOptions {
|
|
11
11
|
manifestPath?: string;
|
|
12
12
|
updateAllPackages?: boolean;
|
|
13
|
+
merge?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface AllPackages<T> {
|
|
15
16
|
allPackages: T[];
|
|
@@ -29,6 +30,7 @@ export interface AllPackages<T> {
|
|
|
29
30
|
export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
30
31
|
private updateAllPackages;
|
|
31
32
|
private manifestPath;
|
|
33
|
+
private merge;
|
|
32
34
|
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, options?: WorkspacePluginOptions);
|
|
33
35
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
34
36
|
/**
|
|
@@ -32,10 +32,11 @@ const release_please_manifest_1 = require("../updaters/release-please-manifest")
|
|
|
32
32
|
*/
|
|
33
33
|
class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
34
34
|
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
|
35
|
-
var _a, _b;
|
|
35
|
+
var _a, _b, _c;
|
|
36
36
|
super(github, targetBranch, repositoryConfig);
|
|
37
37
|
this.manifestPath = (_a = options.manifestPath) !== null && _a !== void 0 ? _a : manifest_1.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
|
38
38
|
this.updateAllPackages = (_b = options.updateAllPackages) !== null && _b !== void 0 ? _b : false;
|
|
39
|
+
this.merge = (_c = options.merge) !== null && _c !== void 0 ? _c : true;
|
|
39
40
|
}
|
|
40
41
|
async run(candidates) {
|
|
41
42
|
logger_1.logger.info('Running workspace plugin');
|
|
@@ -100,23 +101,20 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
100
101
|
newCandidates.push(newCandidate);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const newUpdates = newCandidates[0].pullRequest.updates;
|
|
108
|
-
newUpdates.push({
|
|
109
|
-
path: this.manifestPath,
|
|
110
|
-
createIfMissing: false,
|
|
111
|
-
updater: new release_please_manifest_1.ReleasePleaseManifest({
|
|
112
|
-
version: newCandidates[0].pullRequest.version,
|
|
113
|
-
versionsMap: updatedPathVersions,
|
|
114
|
-
}),
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
logger_1.logger.warn(`Expected 1 merged candidate, got ${newCandidates.length}`);
|
|
104
|
+
if (this.merge) {
|
|
105
|
+
logger_1.logger.info(`Merging ${newCandidates.length} in-scope candidates`);
|
|
106
|
+
const mergePlugin = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig);
|
|
107
|
+
newCandidates = await mergePlugin.run(newCandidates);
|
|
119
108
|
}
|
|
109
|
+
const newUpdates = newCandidates[0].pullRequest.updates;
|
|
110
|
+
newUpdates.push({
|
|
111
|
+
path: this.manifestPath,
|
|
112
|
+
createIfMissing: false,
|
|
113
|
+
updater: new release_please_manifest_1.ReleasePleaseManifest({
|
|
114
|
+
version: newCandidates[0].pullRequest.version,
|
|
115
|
+
versionsMap: updatedPathVersions,
|
|
116
|
+
}),
|
|
117
|
+
});
|
|
120
118
|
logger_1.logger.info(`Post-processing ${newCandidates.length} in-scope candidates`);
|
|
121
119
|
newCandidates = this.postProcessCandidates(newCandidates, updatedVersions);
|
|
122
120
|
return [...outOfScopeCandidates, ...newCandidates];
|
|
@@ -16,6 +16,7 @@ export interface JavaBuildUpdatesOption extends BuildUpdatesOptions {
|
|
|
16
16
|
export declare class Java extends BaseStrategy {
|
|
17
17
|
protected readonly snapshotVersioning: VersioningStrategy;
|
|
18
18
|
protected readonly snapshotLabels: string[];
|
|
19
|
+
readonly skipSnapshot: boolean;
|
|
19
20
|
constructor(options: BaseStrategyOptions);
|
|
20
21
|
buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
21
22
|
protected buildSnapshotPullRequest(latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest>;
|
|
@@ -47,7 +47,7 @@ const CHANGELOG_SECTIONS = [
|
|
|
47
47
|
*/
|
|
48
48
|
class Java extends base_1.BaseStrategy {
|
|
49
49
|
constructor(options) {
|
|
50
|
-
var _a;
|
|
50
|
+
var _a, _b;
|
|
51
51
|
options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
|
|
52
52
|
// wrap the configured versioning strategy with snapshotting
|
|
53
53
|
const parentVersioningStrategy = options.versioningStrategy || new default_1.DefaultVersioningStrategy();
|
|
@@ -55,6 +55,7 @@ class Java extends base_1.BaseStrategy {
|
|
|
55
55
|
super(options);
|
|
56
56
|
this.snapshotVersioning = new java_add_snapshot_1.JavaAddSnapshot(parentVersioningStrategy);
|
|
57
57
|
this.snapshotLabels = options.snapshotLabels || manifest_1.DEFAULT_SNAPSHOT_LABELS;
|
|
58
|
+
this.skipSnapshot = (_b = options.skipSnapshot) !== null && _b !== void 0 ? _b : false;
|
|
58
59
|
}
|
|
59
60
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
60
61
|
if (await this.needsSnapshot(commits, latestRelease)) {
|
|
@@ -107,6 +108,9 @@ class Java extends base_1.BaseStrategy {
|
|
|
107
108
|
}
|
|
108
109
|
async needsSnapshot(commits, latestRelease) {
|
|
109
110
|
var _a;
|
|
111
|
+
if (this.skipSnapshot) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
110
114
|
const component = await this.getComponent();
|
|
111
115
|
logger_1.logger.debug('component:', component);
|
|
112
116
|
const version = (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.version;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "generate release PRs based on the conventionalcommits.org spec",
|
|
5
5
|
"main": "./build/src/index.js",
|
|
6
6
|
"bin": "./build/src/bin/release-please.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@octokit/types": "^
|
|
41
|
+
"@octokit/types": "^7.0.0",
|
|
42
42
|
"@types/chai": "^4.1.7",
|
|
43
43
|
"@types/diff": "^5.0.2",
|
|
44
44
|
"@types/iarna__toml": "^2.0.1",
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
"@lerna/package": "^4.0.0",
|
|
73
73
|
"@lerna/package-graph": "^4.0.0",
|
|
74
74
|
"@lerna/run-topologically": "^4.0.0",
|
|
75
|
-
"@octokit/graphql": "^
|
|
76
|
-
"@octokit/request": "^
|
|
77
|
-
"@octokit/request-error": "^
|
|
78
|
-
"@octokit/rest": "^
|
|
75
|
+
"@octokit/graphql": "^5.0.0",
|
|
76
|
+
"@octokit/request": "^6.0.0",
|
|
77
|
+
"@octokit/request-error": "^3.0.0",
|
|
78
|
+
"@octokit/rest": "^19.0.0",
|
|
79
79
|
"@types/npm-package-arg": "^6.1.0",
|
|
80
80
|
"@xmldom/xmldom": "^0.8.2",
|
|
81
81
|
"chalk": "^4.0.0",
|
|
82
|
-
"code-suggester": "^
|
|
82
|
+
"code-suggester": "^4.0.0",
|
|
83
83
|
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
84
84
|
"conventional-changelog-writer": "^5.0.0",
|
|
85
85
|
"conventional-commits-filter": "^2.0.2",
|
|
@@ -99,6 +99,6 @@
|
|
|
99
99
|
"yargs": "^17.0.0"
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
|
-
"node": ">=
|
|
102
|
+
"node": ">=14.0.0"
|
|
103
103
|
}
|
|
104
104
|
}
|
package/schemas/config.json
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"description": "Feature changes only bump semver patch if version < 1.0.0",
|
|
21
21
|
"type": "boolean"
|
|
22
22
|
},
|
|
23
|
+
"versioning": {
|
|
24
|
+
"description": "Versioning strategy. Defaults to `default`",
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
23
27
|
"changelog-sections": {
|
|
24
28
|
"description": "Override the Changelog configuration sections",
|
|
25
29
|
"type": "array",
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"type": "string"
|
|
48
52
|
},
|
|
49
53
|
"skip-github-release": {
|
|
50
|
-
"description": "Skip tagging GitHub releases for this package. Defaults to `false`.",
|
|
54
|
+
"description": "Skip tagging GitHub releases for this package. Release-Please still requires releases to be tagged, so this option should only be used if you have existing infrastructure to tag these releases.Defaults to `false`.",
|
|
51
55
|
"type": "boolean"
|
|
52
56
|
},
|
|
53
57
|
"draft": {
|
|
@@ -171,6 +175,10 @@
|
|
|
171
175
|
"snapshot-label": {
|
|
172
176
|
"description": "Label to add to snapshot pull request. Used by `java` strategies.",
|
|
173
177
|
"type": "string"
|
|
178
|
+
},
|
|
179
|
+
"skip-snapshot": {
|
|
180
|
+
"description": "If set, do not propose snapshot pull requests. Used by `java` strategies.",
|
|
181
|
+
"type": "boolean"
|
|
174
182
|
}
|
|
175
183
|
}
|
|
176
184
|
}
|
|
@@ -228,10 +236,33 @@
|
|
|
228
236
|
"items": {
|
|
229
237
|
"type": "string"
|
|
230
238
|
}
|
|
239
|
+
},
|
|
240
|
+
"merge": {
|
|
241
|
+
"description": "Whether to merge in-scope pull requests into a combined release pull request. Defaults to `true`.",
|
|
242
|
+
"type": "boolean"
|
|
231
243
|
}
|
|
232
244
|
},
|
|
233
245
|
"required": ["type", "groupName", "components"]
|
|
234
246
|
},
|
|
247
|
+
{
|
|
248
|
+
"description": "Configuration for various `workspace` plugins.",
|
|
249
|
+
"type": "object",
|
|
250
|
+
"properties": {
|
|
251
|
+
"type": {
|
|
252
|
+
"description": "The name of the plugin.",
|
|
253
|
+
"type": "string",
|
|
254
|
+
"enum": ["cargo-workspace", "maven-workspace", "node-workspace"]
|
|
255
|
+
},
|
|
256
|
+
"updateAllPackages": {
|
|
257
|
+
"description": "Whether to force updating all packages regardless of the dependency tree. Defaults to `false`.",
|
|
258
|
+
"type": "boolean"
|
|
259
|
+
},
|
|
260
|
+
"merge": {
|
|
261
|
+
"description": "Whether to merge in-scope pull requests into a combined release pull request. Defaults to `true`.",
|
|
262
|
+
"type": "boolean"
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
235
266
|
{
|
|
236
267
|
"description": "Other plugins",
|
|
237
268
|
"type": "object",
|
|
@@ -278,6 +309,7 @@
|
|
|
278
309
|
"release-type": true,
|
|
279
310
|
"bump-minor-pre-major": true,
|
|
280
311
|
"bump-patch-for-minor-pre-major": true,
|
|
312
|
+
"versioning": true,
|
|
281
313
|
"changelog-sections": true,
|
|
282
314
|
"release-as": true,
|
|
283
315
|
"skip-github-release": true,
|