release-please 13.19.2 → 13.19.5
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/build/src/commit.js +8 -1
- package/build/src/github.js +47 -39
- package/build/src/strategies/python.js +9 -13
- package/build/src/updaters/dart/pubspec-yaml.js +10 -5
- package/package.json +1 -1
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
|
+
## [13.19.5](https://github.com/googleapis/release-please/compare/v13.19.4...v13.19.5) (2022-07-26)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **dart:** add multiline flag to replace regex ([#1524](https://github.com/googleapis/release-please/issues/1524)) ([fd7b73b](https://github.com/googleapis/release-please/commit/fd7b73b8f9288dbfa84f37a6ce2e77f6c1b49db8)), closes [#1523](https://github.com/googleapis/release-please/issues/1523)
|
|
13
|
+
|
|
14
|
+
## [13.19.4](https://github.com/googleapis/release-please/compare/v13.19.3...v13.19.4) (2022-07-25)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **commits:** remove content before and after BREAKING in body ([#1531](https://github.com/googleapis/release-please/issues/1531)) ([f75e49f](https://github.com/googleapis/release-please/commit/f75e49f6b751347456746d9c4068191d340c8e1e))
|
|
20
|
+
* **python:** make` __init__.py` bump underscore / hyphen agnostic ([4b25a47](https://github.com/googleapis/release-please/commit/4b25a475d53fd4f2eadd14619f701e51275f8e62))
|
|
21
|
+
|
|
22
|
+
## [13.19.3](https://github.com/googleapis/release-please/compare/v13.19.2...v13.19.3) (2022-07-08)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* stop iterating if we fail to receive commits from a graphql query ([#1518](https://github.com/googleapis/release-please/issues/1518)) ([0f27cb5](https://github.com/googleapis/release-please/commit/0f27cb58d5a21e95a4f1a6c3fcfff019cdfdaff9))
|
|
28
|
+
|
|
7
29
|
## [13.19.2](https://github.com/googleapis/release-please/compare/v13.19.1...v13.19.2) (2022-07-06)
|
|
8
30
|
|
|
9
31
|
|
package/build/src/commit.js
CHANGED
|
@@ -92,6 +92,7 @@ function toConventionalChangelogFormat(ast) {
|
|
|
92
92
|
text: '', // "text" will be populated if a BREAKING CHANGE token is parsed.
|
|
93
93
|
};
|
|
94
94
|
visitWithAncestors(ast, ['breaking-change'], (node, ancestors) => {
|
|
95
|
+
let hitBreakingMarker = false;
|
|
95
96
|
let parent = ancestors.pop();
|
|
96
97
|
if (!parent) {
|
|
97
98
|
return;
|
|
@@ -104,7 +105,13 @@ function toConventionalChangelogFormat(ast) {
|
|
|
104
105
|
breaking.text = '';
|
|
105
106
|
// We treat text from the BREAKING CHANGE marker forward as
|
|
106
107
|
// the breaking change notes:
|
|
107
|
-
visit(parent, ['text', 'newline'], (node) => {
|
|
108
|
+
visit(parent, ['breaking-change', 'text', 'newline'], (node) => {
|
|
109
|
+
if (node.type === 'breaking-change') {
|
|
110
|
+
hitBreakingMarker = true;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!hitBreakingMarker)
|
|
114
|
+
return;
|
|
108
115
|
breaking.text += node.value;
|
|
109
116
|
});
|
|
110
117
|
break;
|
package/build/src/github.js
CHANGED
|
@@ -488,64 +488,72 @@ class GitHub {
|
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
|
|
491
|
-
var _a;
|
|
491
|
+
var _a, _b;
|
|
492
492
|
logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
name
|
|
510
|
-
}
|
|
493
|
+
const query = `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
|
|
494
|
+
repository(owner: $owner, name: $repo) {
|
|
495
|
+
ref(qualifiedName: $targetBranch) {
|
|
496
|
+
target {
|
|
497
|
+
... on Commit {
|
|
498
|
+
history(first: $num, after: $cursor) {
|
|
499
|
+
nodes {
|
|
500
|
+
associatedPullRequests(first: 10) {
|
|
501
|
+
nodes {
|
|
502
|
+
number
|
|
503
|
+
title
|
|
504
|
+
baseRefName
|
|
505
|
+
headRefName
|
|
506
|
+
labels(first: 10) {
|
|
507
|
+
nodes {
|
|
508
|
+
name
|
|
511
509
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
510
|
+
}
|
|
511
|
+
body
|
|
512
|
+
mergeCommit {
|
|
513
|
+
oid
|
|
514
|
+
}
|
|
515
|
+
files(first: $maxFilesChanged) {
|
|
516
|
+
nodes {
|
|
517
|
+
path
|
|
515
518
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
pageInfo {
|
|
521
|
-
endCursor
|
|
522
|
-
hasNextPage
|
|
523
|
-
}
|
|
519
|
+
pageInfo {
|
|
520
|
+
endCursor
|
|
521
|
+
hasNextPage
|
|
524
522
|
}
|
|
525
523
|
}
|
|
526
524
|
}
|
|
527
|
-
sha: oid
|
|
528
|
-
message
|
|
529
|
-
}
|
|
530
|
-
pageInfo {
|
|
531
|
-
hasNextPage
|
|
532
|
-
endCursor
|
|
533
525
|
}
|
|
526
|
+
sha: oid
|
|
527
|
+
message
|
|
528
|
+
}
|
|
529
|
+
pageInfo {
|
|
530
|
+
hasNextPage
|
|
531
|
+
endCursor
|
|
534
532
|
}
|
|
535
533
|
}
|
|
536
534
|
}
|
|
537
535
|
}
|
|
538
536
|
}
|
|
539
|
-
}
|
|
537
|
+
}
|
|
538
|
+
}`;
|
|
539
|
+
const params = {
|
|
540
540
|
cursor,
|
|
541
541
|
owner: this.repository.owner,
|
|
542
542
|
repo: this.repository.repo,
|
|
543
543
|
num: 25,
|
|
544
544
|
targetBranch,
|
|
545
545
|
maxFilesChanged: 100, // max is 100
|
|
546
|
+
};
|
|
547
|
+
const response = await this.graphqlRequest({
|
|
548
|
+
query,
|
|
549
|
+
...params,
|
|
546
550
|
});
|
|
551
|
+
if (!response) {
|
|
552
|
+
logger_1.logger.warn(`Did not receive a response for query: ${query}`, params);
|
|
553
|
+
return null;
|
|
554
|
+
}
|
|
547
555
|
// if the branch does exist, return null
|
|
548
|
-
if (!response.repository.ref) {
|
|
556
|
+
if (!((_a = response.repository) === null || _a === void 0 ? void 0 : _a.ref)) {
|
|
549
557
|
logger_1.logger.warn(`Could not find commits for branch ${targetBranch} - it likely does not exist.`);
|
|
550
558
|
return null;
|
|
551
559
|
}
|
|
@@ -572,7 +580,7 @@ class GitHub {
|
|
|
572
580
|
labels: pullRequest.labels.nodes.map(node => node.name),
|
|
573
581
|
files,
|
|
574
582
|
};
|
|
575
|
-
if (((
|
|
583
|
+
if (((_b = pullRequest.files.pageInfo) === null || _b === void 0 ? void 0 : _b.hasNextPage) && options.backfillFiles) {
|
|
576
584
|
logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
|
|
577
585
|
commit.files = await this.getCommitFiles(graphCommit.sha);
|
|
578
586
|
}
|
|
@@ -90,20 +90,16 @@ class Python extends base_1.BaseStrategy {
|
|
|
90
90
|
logger_1.logger.warn('No project/component found.');
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
[projectName, projectName.replace(/-/g, '_')]
|
|
94
|
+
.flatMap(packageName => [
|
|
95
|
+
`${packageName}/__init__.py`,
|
|
96
|
+
`src/${packageName}/__init__.py`,
|
|
97
|
+
])
|
|
98
|
+
.forEach(packagePath => updates.push({
|
|
99
|
+
path: this.addPath(packagePath),
|
|
95
100
|
createIfMissing: false,
|
|
96
|
-
updater: new python_file_with_version_1.PythonFileWithVersion({
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
});
|
|
100
|
-
updates.push({
|
|
101
|
-
path: this.addPath(`src/${projectName}/__init__.py`),
|
|
102
|
-
createIfMissing: false,
|
|
103
|
-
updater: new python_file_with_version_1.PythonFileWithVersion({
|
|
104
|
-
version,
|
|
105
|
-
}),
|
|
106
|
-
});
|
|
101
|
+
updater: new python_file_with_version_1.PythonFileWithVersion({ version }),
|
|
102
|
+
}));
|
|
107
103
|
}
|
|
108
104
|
// There should be only one version.py, but foreach in case that is incorrect
|
|
109
105
|
const versionPyFilesSearch = this.github.findFilesByFilenameAndRef('version.py', this.targetBranch, this.path);
|
|
@@ -26,19 +26,24 @@ class PubspecYaml extends default_1.DefaultUpdater {
|
|
|
26
26
|
* @returns {string} The updated content
|
|
27
27
|
*/
|
|
28
28
|
updateContent(content) {
|
|
29
|
-
const oldVersion = content.match(
|
|
29
|
+
const oldVersion = content.match(/^version: ([0-9.]+)\+?(.*$)/m);
|
|
30
30
|
let buildNumber = '';
|
|
31
31
|
if (oldVersion) {
|
|
32
|
-
buildNumber =
|
|
33
|
-
|
|
32
|
+
buildNumber = oldVersion[2];
|
|
33
|
+
const parsedBuild = parseInt(buildNumber);
|
|
34
|
+
if (!isNaN(parsedBuild)) {
|
|
35
|
+
buildNumber = `+${parsedBuild + 1}`;
|
|
36
|
+
logger_1.logger.info(`updating from ${oldVersion[1]}+${oldVersion[2]} to ${this.version}${buildNumber}`);
|
|
37
|
+
}
|
|
38
|
+
else if (buildNumber.length > 0) {
|
|
34
39
|
buildNumber = `+${buildNumber}`;
|
|
35
|
-
logger_1.logger.info(`updating from ${oldVersion[1]}
|
|
40
|
+
logger_1.logger.info(`updating from ${oldVersion[1]}+${oldVersion[2]} to ${this.version}${buildNumber}`);
|
|
36
41
|
}
|
|
37
42
|
else {
|
|
38
43
|
logger_1.logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
|
-
return content.replace(
|
|
46
|
+
return content.replace(/^version: .*$/m, `version: ${this.version}${buildNumber}`);
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
exports.PubspecYaml = PubspecYaml;
|
package/package.json
CHANGED