release-please 15.9.2 → 15.10.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 +14 -0
- package/build/src/manifest.d.ts +2 -0
- package/build/src/manifest.js +7 -2
- package/build/src/updaters/python/setup-cfg.js +1 -1
- package/build/src/util/commit-exclude.d.ts +10 -0
- package/build/src/util/commit-exclude.js +49 -0
- package/build/src/util/commit-split.js +7 -20
- package/build/src/util/commit-utils.d.ts +1 -0
- package/build/src/util/commit-utils.js +34 -0
- package/package.json +1 -1
- package/schemas/config.json +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [15.10.0](https://github.com/googleapis/release-please/compare/v15.9.3...v15.10.0) (2023-04-10)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Allow excluding file paths to filter out commits ([#1875](https://github.com/googleapis/release-please/issues/1875)) ([a9bed82](https://github.com/googleapis/release-please/commit/a9bed8232ccaa192fb004953e34c49279d3c779f))
|
|
13
|
+
|
|
14
|
+
## [15.9.3](https://github.com/googleapis/release-please/compare/v15.9.2...v15.9.3) (2023-04-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **python:** Handle large version numbers in setup.cfg ([#1906](https://github.com/googleapis/release-please/issues/1906)) ([9a7b11f](https://github.com/googleapis/release-please/commit/9a7b11f4d0797222fd65e871d4ba9f488a72d1d9))
|
|
20
|
+
|
|
7
21
|
## [15.9.2](https://github.com/googleapis/release-please/compare/v15.9.1...v15.9.2) (2023-03-28)
|
|
8
22
|
|
|
9
23
|
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export interface ReleaserConfig {
|
|
|
70
70
|
extraFiles?: ExtraFile[];
|
|
71
71
|
snapshotLabels?: string[];
|
|
72
72
|
skipSnapshot?: boolean;
|
|
73
|
+
excludePaths?: string[];
|
|
73
74
|
}
|
|
74
75
|
export interface CandidateReleasePullRequest {
|
|
75
76
|
path: string;
|
|
@@ -109,6 +110,7 @@ interface ReleaserConfigJson {
|
|
|
109
110
|
'snapshot-label'?: string;
|
|
110
111
|
'skip-snapshot'?: boolean;
|
|
111
112
|
'initial-version'?: string;
|
|
113
|
+
'exclude-paths'?: string[];
|
|
112
114
|
}
|
|
113
115
|
export interface ManifestOptions {
|
|
114
116
|
bootstrapSha?: string;
|
package/build/src/manifest.js
CHANGED
|
@@ -27,6 +27,7 @@ const release_please_manifest_1 = require("./updaters/release-please-manifest");
|
|
|
27
27
|
const errors_1 = require("./errors");
|
|
28
28
|
const pull_request_overflow_handler_1 = require("./util/pull-request-overflow-handler");
|
|
29
29
|
const signoff_commit_message_1 = require("./util/signoff-commit-message");
|
|
30
|
+
const commit_exclude_1 = require("./util/commit-exclude");
|
|
30
31
|
exports.DEFAULT_RELEASE_PLEASE_CONFIG = 'release-please-config.json';
|
|
31
32
|
exports.DEFAULT_RELEASE_PLEASE_MANIFEST = '.release-please-manifest.json';
|
|
32
33
|
exports.ROOT_PROJECT_PATH = '.';
|
|
@@ -299,10 +300,12 @@ class Manifest {
|
|
|
299
300
|
});
|
|
300
301
|
const splitCommits = cs.split(commits);
|
|
301
302
|
// limit paths to ones since the last release
|
|
302
|
-
|
|
303
|
+
let commitsPerPath = {};
|
|
303
304
|
for (const path in this.repositoryConfig) {
|
|
304
305
|
commitsPerPath[path] = commitsAfterSha(path === exports.ROOT_PROJECT_PATH ? commits : splitCommits[path], releaseShasByPath[path]);
|
|
305
306
|
}
|
|
307
|
+
const commitExclude = new commit_exclude_1.CommitExclude(this.repositoryConfig);
|
|
308
|
+
commitsPerPath = commitExclude.excludeCommits(commitsPerPath);
|
|
306
309
|
// backfill latest release tags from manifest
|
|
307
310
|
for (const path in this.repositoryConfig) {
|
|
308
311
|
const latestRelease = releasesByPath[path];
|
|
@@ -774,6 +777,7 @@ function extractReleaserConfig(config) {
|
|
|
774
777
|
extraLabels: (_c = config['extra-label']) === null || _c === void 0 ? void 0 : _c.split(','),
|
|
775
778
|
skipSnapshot: config['skip-snapshot'],
|
|
776
779
|
initialVersion: config['initial-version'],
|
|
780
|
+
excludePaths: config['exclude-paths'],
|
|
777
781
|
};
|
|
778
782
|
}
|
|
779
783
|
/**
|
|
@@ -982,7 +986,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config,
|
|
|
982
986
|
return candidateTagVersion.sort((a, b) => b.compare(a))[0];
|
|
983
987
|
}
|
|
984
988
|
function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
985
|
-
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;
|
|
989
|
+
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, _2;
|
|
986
990
|
return {
|
|
987
991
|
releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
|
|
988
992
|
bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
|
|
@@ -1009,6 +1013,7 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
|
|
|
1009
1013
|
skipSnapshot: (_z = pathConfig.skipSnapshot) !== null && _z !== void 0 ? _z : defaultConfig.skipSnapshot,
|
|
1010
1014
|
initialVersion: (_0 = pathConfig.initialVersion) !== null && _0 !== void 0 ? _0 : defaultConfig.initialVersion,
|
|
1011
1015
|
extraLabels: (_1 = pathConfig.extraLabels) !== null && _1 !== void 0 ? _1 : defaultConfig.extraLabels,
|
|
1016
|
+
excludePaths: (_2 = pathConfig.excludePaths) !== null && _2 !== void 0 ? _2 : defaultConfig.excludePaths,
|
|
1012
1017
|
};
|
|
1013
1018
|
}
|
|
1014
1019
|
/**
|
|
@@ -25,7 +25,7 @@ class SetupCfg extends default_1.DefaultUpdater {
|
|
|
25
25
|
* @returns {string} The updated content
|
|
26
26
|
*/
|
|
27
27
|
updateContent(content) {
|
|
28
|
-
return content.replace(/(version ?= ?)[0-9]+\.[0-9]+\.[0-9](?:-\w+)?/, `$1${this.version}`);
|
|
28
|
+
return content.replace(/(version ?= ?)[0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?/, `$1${this.version}`);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
exports.SetupCfg = SetupCfg;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Commit } from '../commit';
|
|
2
|
+
import { ReleaserConfig } from '../manifest';
|
|
3
|
+
export type CommitExcludeConfig = Pick<ReleaserConfig, 'excludePaths'>;
|
|
4
|
+
export declare class CommitExclude {
|
|
5
|
+
private excludePaths;
|
|
6
|
+
constructor(config: Record<string, CommitExcludeConfig>);
|
|
7
|
+
excludeCommits<T extends Commit>(commitsPerPath: Record<string, T[]>): Record<string, T[]>;
|
|
8
|
+
private shouldInclude;
|
|
9
|
+
private isRelevant;
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CommitExclude = void 0;
|
|
17
|
+
const manifest_1 = require("../manifest");
|
|
18
|
+
const commit_utils_1 = require("./commit-utils");
|
|
19
|
+
class CommitExclude {
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.excludePaths = {};
|
|
22
|
+
Object.entries(config).forEach(([path, releaseConfig]) => {
|
|
23
|
+
if (releaseConfig.excludePaths) {
|
|
24
|
+
this.excludePaths[path] = (0, commit_utils_1.normalizePaths)(releaseConfig.excludePaths);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
excludeCommits(commitsPerPath) {
|
|
29
|
+
const filteredCommitsPerPath = {};
|
|
30
|
+
Object.entries(commitsPerPath).forEach(([path, commits]) => {
|
|
31
|
+
if (this.excludePaths[path]) {
|
|
32
|
+
commits = commits.filter(commit => this.shouldInclude(commit, this.excludePaths[path], path));
|
|
33
|
+
}
|
|
34
|
+
filteredCommitsPerPath[path] = commits;
|
|
35
|
+
});
|
|
36
|
+
return filteredCommitsPerPath;
|
|
37
|
+
}
|
|
38
|
+
shouldInclude(commit, excludePaths, packagePath) {
|
|
39
|
+
return (!commit.files ||
|
|
40
|
+
!commit.files
|
|
41
|
+
.filter(file => this.isRelevant(file, packagePath))
|
|
42
|
+
.every(file => excludePaths.some(path => this.isRelevant(file, path))));
|
|
43
|
+
}
|
|
44
|
+
isRelevant(file, path) {
|
|
45
|
+
return path === manifest_1.ROOT_PROJECT_PATH || file.indexOf(`${path}/`) === 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.CommitExclude = CommitExclude;
|
|
49
|
+
//# sourceMappingURL=commit-exclude.js.map
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.CommitSplit = void 0;
|
|
17
17
|
const manifest_1 = require("../manifest");
|
|
18
|
+
const commit_utils_1 = require("./commit-utils");
|
|
18
19
|
/**
|
|
19
20
|
* Helper class for splitting commits by component path. If `packagePaths`
|
|
20
21
|
* is configured, then only consider the provided paths. If `includeEmpty`
|
|
@@ -26,28 +27,14 @@ class CommitSplit {
|
|
|
26
27
|
opts = opts || {};
|
|
27
28
|
this.includeEmpty = !!opts.includeEmpty;
|
|
28
29
|
if (opts.packagePaths) {
|
|
29
|
-
const paths =
|
|
30
|
-
|
|
30
|
+
const paths = (0, commit_utils_1.normalizePaths)(opts.packagePaths);
|
|
31
|
+
this.packagePaths = paths
|
|
32
|
+
.filter(path => {
|
|
31
33
|
// The special "." path, representing the root of the module, should be
|
|
32
34
|
// ignored by commit-split as it is assigned all commits in manifest.ts
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// normalize so that all paths have leading and trailing slashes for
|
|
37
|
-
// non-overlap validation.
|
|
38
|
-
// NOTE: GitHub API always returns paths using the `/` separator,
|
|
39
|
-
// regardless of what platform the client code is running on
|
|
40
|
-
newPath = newPath.replace(/\/$/, '');
|
|
41
|
-
newPath = newPath.replace(/^\//, '');
|
|
42
|
-
newPath = newPath.replace(/$/, '/');
|
|
43
|
-
newPath = newPath.replace(/^/, '/');
|
|
44
|
-
// store them with leading and trailing slashes removed.
|
|
45
|
-
newPath = newPath.replace(/\/$/, '');
|
|
46
|
-
newPath = newPath.replace(/^\//, '');
|
|
47
|
-
paths.push(newPath);
|
|
48
|
-
}
|
|
49
|
-
// sort by longest paths first
|
|
50
|
-
this.packagePaths = paths.sort((a, b) => b.length - a.length);
|
|
35
|
+
return path !== manifest_1.ROOT_PROJECT_PATH;
|
|
36
|
+
})
|
|
37
|
+
.sort((a, b) => b.length - a.length); // sort by longest paths first
|
|
51
38
|
}
|
|
52
39
|
}
|
|
53
40
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizePaths: (paths: string[]) => string[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.normalizePaths = void 0;
|
|
17
|
+
const normalizePaths = (paths) => {
|
|
18
|
+
return paths.map(path => {
|
|
19
|
+
// normalize so that all paths have leading and trailing slashes for
|
|
20
|
+
// non-overlap validation.
|
|
21
|
+
// NOTE: GitHub API always returns paths using the `/` separator,
|
|
22
|
+
// regardless of what platform the client code is running on
|
|
23
|
+
let newPath = path.replace(/\/$/, '');
|
|
24
|
+
newPath = newPath.replace(/^\//, '');
|
|
25
|
+
newPath = newPath.replace(/$/, '/');
|
|
26
|
+
newPath = newPath.replace(/^/, '/');
|
|
27
|
+
// store them with leading and trailing slashes removed.
|
|
28
|
+
newPath = newPath.replace(/\/$/, '');
|
|
29
|
+
newPath = newPath.replace(/^\//, '');
|
|
30
|
+
return newPath;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
exports.normalizePaths = normalizePaths;
|
|
34
|
+
//# sourceMappingURL=commit-utils.js.map
|
package/package.json
CHANGED
package/schemas/config.json
CHANGED
|
@@ -184,6 +184,13 @@
|
|
|
184
184
|
]
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
+
"exclude-paths": {
|
|
188
|
+
"description": "Path of commits to be excluded from parsing. If all files from commit belong to one of the paths it will be skipped",
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
187
194
|
"version-file": {
|
|
188
195
|
"description": "Path to the specialize version file. Used by `ruby` and `simple` strategies.",
|
|
189
196
|
"type": "string"
|
|
@@ -394,6 +401,7 @@
|
|
|
394
401
|
"extra-files": true,
|
|
395
402
|
"version-file": true,
|
|
396
403
|
"snapshot-label": true,
|
|
397
|
-
"initial-version": true
|
|
404
|
+
"initial-version": true,
|
|
405
|
+
"exclude-paths": true
|
|
398
406
|
}
|
|
399
407
|
}
|