release-please 16.14.4 → 16.15.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 +7 -0
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +1 -1
- package/build/src/manifest.d.ts +6 -0
- package/build/src/manifest.js +20 -13
- package/package.json +1 -1
- package/schemas/config.json +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [16.15.0](https://github.com/googleapis/release-please/compare/v16.14.4...v16.15.0) (2024-11-13)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add `always-update` option to push to always push to release branch ([72d40df](https://github.com/googleapis/release-please/commit/72d40df677b08fd52654a4c3b320649f63b9c635))
|
|
13
|
+
|
|
7
14
|
## [16.14.4](https://github.com/googleapis/release-please/compare/v16.14.3...v16.14.4) (2024-11-12)
|
|
8
15
|
|
|
9
16
|
|
package/build/src/index.d.ts
CHANGED
package/build/src/index.js
CHANGED
|
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "GitHub", { enumerable: true, get: function () {
|
|
|
36
36
|
exports.configSchema = require('../../schemas/config.json');
|
|
37
37
|
exports.manifestSchema = require('../../schemas/manifest.json');
|
|
38
38
|
// x-release-please-start-version
|
|
39
|
-
exports.VERSION = '16.
|
|
39
|
+
exports.VERSION = '16.15.0';
|
|
40
40
|
// x-release-please-end
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export interface ManifestOptions {
|
|
|
140
140
|
draft?: boolean;
|
|
141
141
|
prerelease?: boolean;
|
|
142
142
|
draftPullRequest?: boolean;
|
|
143
|
+
alwaysUpdate?: boolean;
|
|
143
144
|
groupPullRequestTitlePattern?: string;
|
|
144
145
|
releaseSearchDepth?: number;
|
|
145
146
|
commitSearchDepth?: number;
|
|
@@ -188,6 +189,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
|
|
|
188
189
|
'release-search-depth'?: number;
|
|
189
190
|
'commit-search-depth'?: number;
|
|
190
191
|
'sequential-calls'?: boolean;
|
|
192
|
+
'always-update'?: boolean;
|
|
191
193
|
}
|
|
192
194
|
export type ReleasedVersions = Record<string, Version>;
|
|
193
195
|
export type RepositoryConfig = Record<string, ReleaserConfig>;
|
|
@@ -215,6 +217,7 @@ export declare class Manifest {
|
|
|
215
217
|
readonly releasedVersions: ReleasedVersions;
|
|
216
218
|
private targetBranch;
|
|
217
219
|
private separatePullRequests;
|
|
220
|
+
private alwaysUpdate;
|
|
218
221
|
readonly fork: boolean;
|
|
219
222
|
private signoffUser?;
|
|
220
223
|
private labels;
|
|
@@ -253,6 +256,8 @@ export declare class Manifest {
|
|
|
253
256
|
* plugin
|
|
254
257
|
* @param {boolean} manifestOptions.separatePullRequests If true, create separate pull
|
|
255
258
|
* requests instead of a single manifest release pull request
|
|
259
|
+
* @param {boolean} manifestOptions.alwaysUpdate If true, always updates pull requests instead of
|
|
260
|
+
* only when the release notes change
|
|
256
261
|
* @param {PluginType[]} manifestOptions.plugins Any plugins to use for this repository
|
|
257
262
|
* @param {boolean} manifestOptions.fork If true, create pull requests from a fork. Defaults
|
|
258
263
|
* to `false`
|
|
@@ -325,6 +330,7 @@ export declare class Manifest {
|
|
|
325
330
|
private createOrUpdatePullRequest;
|
|
326
331
|
private maybeUpdateExistingPullRequest;
|
|
327
332
|
private maybeUpdateSnoozedPullRequest;
|
|
333
|
+
private updateExistingPullRequest;
|
|
328
334
|
private findMergedReleasePullRequests;
|
|
329
335
|
/**
|
|
330
336
|
* Find merged, untagged releases and build candidate releases to tag.
|
package/build/src/manifest.js
CHANGED
|
@@ -57,6 +57,8 @@ class Manifest {
|
|
|
57
57
|
* plugin
|
|
58
58
|
* @param {boolean} manifestOptions.separatePullRequests If true, create separate pull
|
|
59
59
|
* requests instead of a single manifest release pull request
|
|
60
|
+
* @param {boolean} manifestOptions.alwaysUpdate If true, always updates pull requests instead of
|
|
61
|
+
* only when the release notes change
|
|
60
62
|
* @param {PluginType[]} manifestOptions.plugins Any plugins to use for this repository
|
|
61
63
|
* @param {boolean} manifestOptions.fork If true, create pull requests from a fork. Defaults
|
|
62
64
|
* to `false`
|
|
@@ -78,6 +80,7 @@ class Manifest {
|
|
|
78
80
|
(manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.manifestPath) || exports.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
|
79
81
|
this.separatePullRequests =
|
|
80
82
|
(_a = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.separatePullRequests) !== null && _a !== void 0 ? _a : Object.keys(repositoryConfig).length === 1;
|
|
83
|
+
this.alwaysUpdate = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.alwaysUpdate) || false;
|
|
81
84
|
this.fork = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.fork) || false;
|
|
82
85
|
this.signoffUser = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.signoff;
|
|
83
86
|
this.releaseLabels =
|
|
@@ -539,12 +542,16 @@ class Manifest {
|
|
|
539
542
|
// look for existing, open pull request
|
|
540
543
|
const existing = openPullRequests.find(openPullRequest => openPullRequest.headBranchName === pullRequest.headRefName);
|
|
541
544
|
if (existing) {
|
|
542
|
-
return
|
|
545
|
+
return this.alwaysUpdate
|
|
546
|
+
? await this.updateExistingPullRequest(existing, pullRequest)
|
|
547
|
+
: await this.maybeUpdateExistingPullRequest(existing, pullRequest);
|
|
543
548
|
}
|
|
544
549
|
// look for closed, snoozed pull request
|
|
545
550
|
const snoozed = snoozedPullRequests.find(openPullRequest => openPullRequest.headBranchName === pullRequest.headRefName);
|
|
546
551
|
if (snoozed) {
|
|
547
|
-
return
|
|
552
|
+
return this.alwaysUpdate
|
|
553
|
+
? await this.updateExistingPullRequest(snoozed, pullRequest)
|
|
554
|
+
: await this.maybeUpdateSnoozedPullRequest(snoozed, pullRequest);
|
|
548
555
|
}
|
|
549
556
|
const body = await this.pullRequestOverflowHandler.handleOverflow(pullRequest);
|
|
550
557
|
const message = this.signoffUser
|
|
@@ -571,28 +578,27 @@ class Manifest {
|
|
|
571
578
|
this.logger.info(`PR https://github.com/${this.repository.owner}/${this.repository.repo}/pull/${existing.number} remained the same`);
|
|
572
579
|
return undefined;
|
|
573
580
|
}
|
|
574
|
-
|
|
575
|
-
fork: this.fork,
|
|
576
|
-
signoffUser: this.signoffUser,
|
|
577
|
-
pullRequestOverflowHandler: this.pullRequestOverflowHandler,
|
|
578
|
-
});
|
|
579
|
-
return updatedPullRequest;
|
|
581
|
+
return await this.updateExistingPullRequest(existing, pullRequest);
|
|
580
582
|
}
|
|
581
|
-
/// only update
|
|
583
|
+
/// only update a snoozed pull request if it has release note changes
|
|
582
584
|
async maybeUpdateSnoozedPullRequest(snoozed, pullRequest) {
|
|
583
585
|
// If unchanged, no need to push updates
|
|
584
586
|
if (snoozed.body === pullRequest.body.toString()) {
|
|
585
587
|
this.logger.info(`PR https://github.com/${this.repository.owner}/${this.repository.repo}/pull/${snoozed.number} remained the same`);
|
|
586
588
|
return undefined;
|
|
587
589
|
}
|
|
588
|
-
const updatedPullRequest = await this.
|
|
590
|
+
const updatedPullRequest = await this.updateExistingPullRequest(snoozed, pullRequest);
|
|
591
|
+
// TODO: consider leaving the snooze label
|
|
592
|
+
await this.github.removeIssueLabels([exports.SNOOZE_LABEL], snoozed.number);
|
|
593
|
+
return updatedPullRequest;
|
|
594
|
+
}
|
|
595
|
+
/// force an update to an existing pull request
|
|
596
|
+
async updateExistingPullRequest(existing, pullRequest) {
|
|
597
|
+
return await this.github.updatePullRequest(existing.number, pullRequest, this.targetBranch, {
|
|
589
598
|
fork: this.fork,
|
|
590
599
|
signoffUser: this.signoffUser,
|
|
591
600
|
pullRequestOverflowHandler: this.pullRequestOverflowHandler,
|
|
592
601
|
});
|
|
593
|
-
// TODO: consider leaving the snooze label
|
|
594
|
-
await this.github.removeIssueLabels([exports.SNOOZE_LABEL], snoozed.number);
|
|
595
|
-
return updatedPullRequest;
|
|
596
602
|
}
|
|
597
603
|
async *findMergedReleasePullRequests() {
|
|
598
604
|
// Find merged release pull requests
|
|
@@ -865,6 +871,7 @@ async function parseConfig(github, configFile, branch, onlyPath, releaseAs) {
|
|
|
865
871
|
lastReleaseSha: config['last-release-sha'],
|
|
866
872
|
alwaysLinkLocal: config['always-link-local'],
|
|
867
873
|
separatePullRequests: config['separate-pull-requests'],
|
|
874
|
+
alwaysUpdate: config['always-update'],
|
|
868
875
|
groupPullRequestTitlePattern: config['group-pull-request-title-pattern'],
|
|
869
876
|
plugins: config['plugins'],
|
|
870
877
|
signoff: config['signoff'],
|
package/package.json
CHANGED
package/schemas/config.json
CHANGED
|
@@ -111,6 +111,10 @@
|
|
|
111
111
|
"description": "Open a separate release pull request for each component. Defaults to `false`.",
|
|
112
112
|
"type": "boolean"
|
|
113
113
|
},
|
|
114
|
+
"always-update": {
|
|
115
|
+
"description": "Always update the pull request with the latest changes. Defaults to `false`.",
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
114
118
|
"tag-separator": {
|
|
115
119
|
"description": "Customize the separator between the component and version in the GitHub tag.",
|
|
116
120
|
"type": "string"
|
|
@@ -470,6 +474,7 @@
|
|
|
470
474
|
"pull-request-header": true,
|
|
471
475
|
"pull-request-footer": true,
|
|
472
476
|
"separate-pull-requests": true,
|
|
477
|
+
"always-update": true,
|
|
473
478
|
"tag-separator": true,
|
|
474
479
|
"extra-files": true,
|
|
475
480
|
"version-file": true,
|