release-please 13.4.6 → 13.4.10

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 CHANGED
@@ -4,6 +4,42 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.4.10](https://github.com/googleapis/release-please/compare/v13.4.9...v13.4.10) (2022-02-16)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **go-yoshi:** dynamically load list of ignored submodules for google-cloud-go ([#1291](https://github.com/googleapis/release-please/issues/1291)) ([36f6ad9](https://github.com/googleapis/release-please/commit/36f6ad94fe471e5a46cc46ebd6f5b5c581a29c2c))
13
+ * manifest release can handle componentless entry ([#1300](https://github.com/googleapis/release-please/issues/1300)) ([6b58573](https://github.com/googleapis/release-please/commit/6b585734fe7b49f0e351b73b27260a304d6c80dd))
14
+ * return uploadUrl and body when creating release ([#1298](https://github.com/googleapis/release-please/issues/1298)) ([5d767c5](https://github.com/googleapis/release-please/commit/5d767c536594a8e24d274a4268cda1f1aa3babff))
15
+
16
+ ### [13.4.9](https://github.com/googleapis/release-please/compare/v13.4.8...v13.4.9) (2022-02-14)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * standalone releases should only be released by its matching component ([#1296](https://github.com/googleapis/release-please/issues/1296)) ([75dd686](https://github.com/googleapis/release-please/commit/75dd686a667da397b54498f543128d4cc6bb784e))
22
+
23
+ ### [13.4.8](https://github.com/googleapis/release-please/compare/v13.4.7...v13.4.8) (2022-02-08)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * allow configuring includeComponentInTag and tagSeparator from manifest config ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
29
+ * check recent commits and latest releases for latest version ([#1267](https://github.com/googleapis/release-please/issues/1267)) ([f931842](https://github.com/googleapis/release-please/commit/f931842a117c97dd117f161c89beb1c9e2257fa2))
30
+ * correctly fetch full list of files ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
31
+ * **go-yoshi:** allows using go-yoshi with manifest ([#1287](https://github.com/googleapis/release-please/issues/1287)) ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
32
+ * **go-yoshi:** should not always skip modules ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
33
+ * Manifest should be able to find tagged versions without a release ([71d9b6d](https://github.com/googleapis/release-please/commit/71d9b6d5775bb1a35157c7ec512ef4d1d9f7feec))
34
+ * provide pull request to commit parser allow overrides ([#1285](https://github.com/googleapis/release-please/issues/1285)) ([e54028b](https://github.com/googleapis/release-please/commit/e54028bb39c4535f42b0b90c60b7f331847d005c))
35
+
36
+ ### [13.4.7](https://github.com/googleapis/release-please/compare/v13.4.6...v13.4.7) (2022-02-02)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * php-yoshi strategy should handle custom changelog secctions ([#1277](https://github.com/googleapis/release-please/issues/1277)) ([bd74a5b](https://github.com/googleapis/release-please/commit/bd74a5b7b622a6cec0d64cbf9b9e01102dc835b2))
42
+
7
43
  ### [13.4.6](https://github.com/googleapis/release-please/compare/v13.4.5...v13.4.6) (2022-02-01)
8
44
 
9
45
 
@@ -123,6 +123,7 @@ async function buildStrategy(options) {
123
123
  changelogNotes,
124
124
  pullRequestTitlePattern: options.pullRequestTitlePattern,
125
125
  extraFiles: options.extraFiles,
126
+ tagSeparator: options.tagSeparator,
126
127
  };
127
128
  switch (options.releaseType) {
128
129
  case 'ruby': {
@@ -57,6 +57,7 @@ export interface GitHubRelease {
57
57
  notes?: string;
58
58
  url: string;
59
59
  draft?: boolean;
60
+ uploadUrl?: string;
60
61
  }
61
62
  export interface GitHubTag {
62
63
  name: string;
@@ -37,13 +37,25 @@ class GitHub {
37
37
  */
38
38
  this.getCommitFiles = wrapAsync(async (sha) => {
39
39
  logger_1.logger.debug(`Backfilling file list for commit: ${sha}`);
40
- const resp = await this.octokit.repos.getCommit({
40
+ const files = [];
41
+ for await (const resp of this.octokit.paginate.iterator(this.octokit.repos.getCommit, {
41
42
  owner: this.repository.owner,
42
43
  repo: this.repository.repo,
43
44
  ref: sha,
44
- });
45
- const files = resp.data.files || [];
46
- return files.map(file => file.filename).filter(filename => !!filename);
45
+ })) {
46
+ for (const f of resp.data.files || []) {
47
+ if (f.filename) {
48
+ files.push(f.filename);
49
+ }
50
+ }
51
+ }
52
+ if (files.length >= 3000) {
53
+ logger_1.logger.warn(`Found ${files.length} files. This may not include all the files.`);
54
+ }
55
+ else {
56
+ logger_1.logger.debug(`Found ${files.length} files`);
57
+ }
58
+ return files;
47
59
  });
48
60
  this.graphqlRequest = wrapAsync(async (opts, maxRetries = 1) => {
49
61
  while (maxRetries >= 0) {
@@ -312,9 +324,13 @@ class GitHub {
312
324
  name: resp.data.name || undefined,
313
325
  tagName: resp.data.tag_name,
314
326
  sha: resp.data.target_commitish,
315
- notes: resp.data.body_text,
327
+ notes: resp.data.body_text ||
328
+ resp.data.body ||
329
+ resp.data.body_html ||
330
+ undefined,
316
331
  url: resp.data.html_url,
317
332
  draft: resp.data.draft,
333
+ uploadUrl: resp.data.upload_url,
318
334
  };
319
335
  }, e => {
320
336
  if (e instanceof request_error_1.RequestError) {
@@ -509,6 +525,7 @@ class GitHub {
509
525
  }
510
526
  }
511
527
  async mergeCommitsGraphQL(targetBranch, cursor, options = {}) {
528
+ var _a;
512
529
  logger_1.logger.debug(`Fetching merge commits on branch ${targetBranch} with cursor: ${cursor}`);
513
530
  const response = await this.graphqlRequest({
514
531
  query: `query pullRequestsSince($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $cursor: String) {
@@ -562,7 +579,7 @@ class GitHub {
562
579
  repo: this.repository.repo,
563
580
  num: 25,
564
581
  targetBranch,
565
- maxFilesChanged: 64,
582
+ maxFilesChanged: 100,
566
583
  });
567
584
  // if the branch does exist, return null
568
585
  if (!response.repository.ref) {
@@ -592,9 +609,15 @@ class GitHub {
592
609
  labels: pullRequest.labels.nodes.map(node => node.name),
593
610
  files,
594
611
  };
595
- // We cannot directly fetch files on commits via graphql, only provide file
596
- // information for commits with associated pull requests
597
- commit.files = files;
612
+ if (((_a = pullRequest.files.pageInfo) === null || _a === void 0 ? void 0 : _a.hasNextPage) && options.backfillFiles) {
613
+ logger_1.logger.info(`PR #${pullRequest.number} has many files, backfilling`);
614
+ commit.files = await this.getCommitFiles(graphCommit.sha);
615
+ }
616
+ else {
617
+ // We cannot directly fetch files on commits via graphql, only provide file
618
+ // information for commits with associated pull requests
619
+ commit.files = files;
620
+ }
598
621
  }
599
622
  else if (options.backfillFiles) {
600
623
  // In this case, there is no squashed merge commit. This could be a simple
@@ -22,6 +22,7 @@ export interface ReleaserConfig {
22
22
  packageName?: string;
23
23
  includeComponentInTag?: boolean;
24
24
  pullRequestTitlePattern?: string;
25
+ tagSeparator?: string;
25
26
  changelogSections?: ChangelogSection[];
26
27
  changelogPath?: string;
27
28
  changelogType?: ChangelogNotesType;
@@ -54,6 +55,7 @@ interface ReleaserConfigJson {
54
55
  'include-component-in-tag'?: boolean;
55
56
  'changelog-type'?: ChangelogNotesType;
56
57
  'pull-request-title-pattern'?: string;
58
+ 'tag-separator'?: string;
57
59
  'version-file'?: string;
58
60
  'extra-files'?: string[];
59
61
  }
@@ -196,6 +198,8 @@ export declare class Manifest {
196
198
  * @returns {ReleasePullRequest[]} The candidate pull requests to open or update.
197
199
  */
198
200
  buildPullRequests(): Promise<ReleasePullRequest[]>;
201
+ private backfillReleasesFromTags;
202
+ private getAllTags;
199
203
  /**
200
204
  * Opens/updates all candidate release pull requests for this repository.
201
205
  *
@@ -166,7 +166,6 @@ class Manifest {
166
166
  for await (const release of this.github.releaseIterator({
167
167
  maxResults: 400,
168
168
  })) {
169
- // logger.debug(release);
170
169
  const tagName = tag_name_1.TagName.parse(release.tagName);
171
170
  if (!tagName) {
172
171
  logger_1.logger.warn(`Unable to parse release name: ${release.name}`);
@@ -199,6 +198,18 @@ class Manifest {
199
198
  }
200
199
  }
201
200
  const needsBootstrap = releasesFound < expectedReleases;
201
+ if (releasesFound < expectedReleases) {
202
+ logger_1.logger.warn(`Expected ${expectedReleases} releases, only found ${releasesFound}`);
203
+ // Fall back to looking for missing releases using expected tags
204
+ const missingPaths = Object.keys(strategiesByPath).filter(path => !releasesByPath[path]);
205
+ logger_1.logger.warn(`Missing ${missingPaths.length} paths: ${missingPaths}`);
206
+ const missingReleases = await this.backfillReleasesFromTags(missingPaths, strategiesByPath);
207
+ for (const path in missingReleases) {
208
+ releaseShasByPath[path] = missingReleases[path].sha;
209
+ releasesByPath[path] = missingReleases[path];
210
+ releasesFound++;
211
+ }
212
+ }
202
213
  if (releasesFound < expectedReleases) {
203
214
  logger_1.logger.warn(`Expected ${expectedReleases} releases, only found ${releasesFound}`);
204
215
  }
@@ -246,6 +257,7 @@ class Manifest {
246
257
  sha: commit.sha,
247
258
  message: commit.message,
248
259
  files: commit.files,
260
+ pullRequest: commit.pullRequest,
249
261
  });
250
262
  }
251
263
  if (releaseCommitsFound < expectedShas) {
@@ -322,6 +334,38 @@ class Manifest {
322
334
  }
323
335
  return newReleasePullRequests.map(pullRequestWithConfig => pullRequestWithConfig.pullRequest);
324
336
  }
337
+ async backfillReleasesFromTags(missingPaths, strategiesByPath) {
338
+ const releasesByPath = {};
339
+ const allTags = await this.getAllTags();
340
+ for (const path of missingPaths) {
341
+ const expectedVersion = this.releasedVersions[path];
342
+ if (!expectedVersion) {
343
+ logger_1.logger.warn(`No version for path ${path}`);
344
+ continue;
345
+ }
346
+ const component = await strategiesByPath[path].getComponent();
347
+ const expectedTag = new tag_name_1.TagName(expectedVersion, component, this.repositoryConfig[path].tagSeparator);
348
+ logger_1.logger.debug(`looking for tagName: ${expectedTag.toString()}`);
349
+ const foundTag = allTags[expectedTag.toString()];
350
+ if (foundTag) {
351
+ logger_1.logger.debug(`found: ${foundTag.name} ${foundTag.sha}`);
352
+ releasesByPath[path] = {
353
+ name: foundTag.name,
354
+ tag: expectedTag,
355
+ sha: foundTag.sha,
356
+ notes: '',
357
+ };
358
+ }
359
+ }
360
+ return releasesByPath;
361
+ }
362
+ async getAllTags() {
363
+ const allTags = {};
364
+ for await (const tag of this.github.tagIterator()) {
365
+ allTags[tag.name] = tag;
366
+ }
367
+ return allTags;
368
+ }
325
369
  /**
326
370
  * Opens/updates all candidate release pull requests for this repository.
327
371
  *
@@ -567,6 +611,7 @@ function extractReleaserConfig(config) {
567
611
  includeComponentInTag: config['include-component-in-tag'],
568
612
  changelogType: config['changelog-type'],
569
613
  pullRequestTitlePattern: config['pull-request-title-pattern'],
614
+ tagSeparator: config['tag-separator'],
570
615
  };
571
616
  }
572
617
  /**
@@ -628,6 +673,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
628
673
  // collect set of recent commit SHAs seen to verify that the release
629
674
  // is in the current branch
630
675
  const commitShas = new Set();
676
+ const candidateReleaseVersions = [];
631
677
  // only look at the last 250 or so commits to find the latest tag - we
632
678
  // don't want to scan the entire repository history if this repo has never
633
679
  // been released
@@ -656,12 +702,15 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
656
702
  // FIXME, don't hardcode this
657
703
  continue;
658
704
  }
659
- return version;
705
+ if (version) {
706
+ logger_1.logger.debug(`Found latest release pull request: ${mergedPullRequest.number} version: ${version}`);
707
+ candidateReleaseVersions.push(version);
708
+ break;
709
+ }
660
710
  }
661
711
  // If not found from recent pull requests, look at releases. Iterate
662
712
  // through releases finding valid tags, then cross reference
663
713
  const releaseGenerator = github.releaseIterator();
664
- const candidateReleaseVersions = [];
665
714
  for await (const release of releaseGenerator) {
666
715
  const tagName = tag_name_1.TagName.parse(release.tagName);
667
716
  if (!tagName) {
@@ -703,7 +752,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
703
752
  return candidateTagVersion.sort((a, b) => b.compare(a))[0];
704
753
  }
705
754
  function mergeReleaserConfig(defaultConfig, pathConfig) {
706
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
755
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
707
756
  return {
708
757
  releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
709
758
  bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
@@ -718,7 +767,9 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
718
767
  packageName: (_m = pathConfig.packageName) !== null && _m !== void 0 ? _m : defaultConfig.packageName,
719
768
  versionFile: (_o = pathConfig.versionFile) !== null && _o !== void 0 ? _o : defaultConfig.versionFile,
720
769
  extraFiles: (_p = pathConfig.extraFiles) !== null && _p !== void 0 ? _p : defaultConfig.extraFiles,
721
- pullRequestTitlePattern: (_q = pathConfig.pullRequestTitlePattern) !== null && _q !== void 0 ? _q : defaultConfig.pullRequestTitlePattern,
770
+ includeComponentInTag: (_q = pathConfig.includeComponentInTag) !== null && _q !== void 0 ? _q : defaultConfig.includeComponentInTag,
771
+ tagSeparator: (_r = pathConfig.tagSeparator) !== null && _r !== void 0 ? _r : defaultConfig.tagSeparator,
772
+ pullRequestTitlePattern: (_s = pathConfig.pullRequestTitlePattern) !== null && _s !== void 0 ? _s : defaultConfig.pullRequestTitlePattern,
722
773
  };
723
774
  }
724
775
  /**
@@ -47,7 +47,7 @@ export declare abstract class BaseStrategy implements Strategy {
47
47
  readonly path: string;
48
48
  protected github: GitHub;
49
49
  protected component?: string;
50
- protected packageName?: string;
50
+ private packageName?;
51
51
  readonly versioningStrategy: VersioningStrategy;
52
52
  protected targetBranch: string;
53
53
  protected repository: Repository;
@@ -72,6 +72,7 @@ export declare abstract class BaseStrategy implements Strategy {
72
72
  */
73
73
  getComponent(): Promise<string | undefined>;
74
74
  getDefaultComponent(): Promise<string | undefined>;
75
+ getPackageName(): Promise<string | undefined>;
75
76
  getDefaultPackageName(): Promise<string | undefined>;
76
77
  protected normalizeComponent(component: string | undefined): string;
77
78
  /**
@@ -68,8 +68,13 @@ class BaseStrategy {
68
68
  var _a;
69
69
  return this.normalizeComponent((_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName()));
70
70
  }
71
+ async getPackageName() {
72
+ var _a;
73
+ return (_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName());
74
+ }
71
75
  async getDefaultPackageName() {
72
- return '';
76
+ var _a;
77
+ return (_a = this.packageName) !== null && _a !== void 0 ? _a : '';
73
78
  }
74
79
  normalizeComponent(component) {
75
80
  if (!component) {
@@ -118,7 +123,6 @@ class BaseStrategy {
118
123
  * open a pull request.
119
124
  */
120
125
  async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
121
- var _a;
122
126
  const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
123
127
  logger_1.logger.info(`Considering: ${conventionalCommits.length} commits`);
124
128
  if (conventionalCommits.length === 0) {
@@ -127,8 +131,6 @@ class BaseStrategy {
127
131
  }
128
132
  const newVersion = await this.buildNewVersion(conventionalCommits, latestRelease);
129
133
  const versionsMap = await this.updateVersionsMap(await this.buildVersionsMap(conventionalCommits), conventionalCommits);
130
- this.packageName = (_a = this.packageName) !== null && _a !== void 0 ? _a : (await this.getDefaultPackageName());
131
- logger_1.logger.debug('packageName', this.packageName);
132
134
  const component = await this.getComponent();
133
135
  logger_1.logger.debug('component:', component);
134
136
  const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator);
@@ -237,14 +239,24 @@ class BaseStrategy {
237
239
  return;
238
240
  }
239
241
  const component = await this.getComponent();
240
- logger_1.logger.info('component:', component);
241
- const releaseData = pullRequestBody.releaseData.length === 1 &&
242
- !pullRequestBody.releaseData[0].component
243
- ? pullRequestBody.releaseData[0]
244
- : pullRequestBody.releaseData.find(releaseData => {
242
+ let releaseData;
243
+ if (pullRequestBody.releaseData.length === 1 &&
244
+ !pullRequestBody.releaseData[0].component) {
245
+ // standalone release PR, ensure the components match
246
+ if (this.normalizeComponent(branchName.component) !==
247
+ this.normalizeComponent(component)) {
248
+ logger_1.logger.warn(`PR component: ${branchName.component} does not match configured component: ${component}`);
249
+ return;
250
+ }
251
+ releaseData = pullRequestBody.releaseData[0];
252
+ }
253
+ else {
254
+ // manifest release with multiple components
255
+ releaseData = pullRequestBody.releaseData.find(releaseData => {
245
256
  return (this.normalizeComponent(releaseData.component) ===
246
257
  this.normalizeComponent(component));
247
258
  });
259
+ }
248
260
  const notes = releaseData === null || releaseData === void 0 ? void 0 : releaseData.notes;
249
261
  if (notes === undefined) {
250
262
  logger_1.logger.warn('Failed to find release notes');
@@ -8,6 +8,7 @@ export declare class GoYoshi extends BaseStrategy {
8
8
  constructor(options: BaseStrategyOptions);
9
9
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
10
10
  protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
11
+ getIgnoredSubModules(): Promise<Set<string>>;
11
12
  protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
12
13
  protected initialReleaseVersion(): Version;
13
14
  }
@@ -19,19 +19,7 @@ const changelog_1 = require("../updaters/changelog");
19
19
  const version_1 = require("../version");
20
20
  const version_go_1 = require("../updaters/go/version-go");
21
21
  const logger_1 = require("../util/logger");
22
- // Commits containing a scope prefixed with an item in this array will be
23
- // ignored when generating a release PR for the parent module.
24
- const IGNORED_SUB_MODULES = new Set([
25
- 'bigtable',
26
- 'bigquery',
27
- 'datastore',
28
- 'firestore',
29
- 'logging',
30
- 'pubsub',
31
- 'pubsublite',
32
- 'spanner',
33
- 'storage',
34
- ]);
22
+ const path_1 = require("path");
35
23
  const REGEN_PR_REGEX = /.*auto-regenerate.*/;
36
24
  const REGEN_ISSUE_REGEX = /(?<prefix>.*)\(#(?<pr>.*)\)(\n|$)/;
37
25
  class GoYoshi extends base_1.BaseStrategy {
@@ -64,12 +52,9 @@ class GoYoshi extends base_1.BaseStrategy {
64
52
  let regenCommit;
65
53
  const component = await this.getComponent();
66
54
  logger_1.logger.debug('Filtering commits');
55
+ const ignoredSubmodules = await this.getIgnoredSubModules();
67
56
  return commits.filter(commit => {
68
57
  var _a, _b;
69
- // ignore commits whose scope is in the list of ignored modules
70
- if (IGNORED_SUB_MODULES.has(commit.scope || '')) {
71
- return false;
72
- }
73
58
  // Only have a single entry of the nightly regen listed in the changelog.
74
59
  // If there are more than one of these commits, append associated PR.
75
60
  if (this.repository.owner === 'googleapis' &&
@@ -123,7 +108,7 @@ class GoYoshi extends base_1.BaseStrategy {
123
108
  else {
124
109
  // This is the main module release, so ignore sub modules that
125
110
  // are released independently
126
- for (const submodule of IGNORED_SUB_MODULES) {
111
+ for (const submodule of ignoredSubmodules) {
127
112
  if (commitMatchesScope(commit.scope, submodule)) {
128
113
  logger_1.logger.debug(`Skipping ignored commit scope: ${commit.scope}`);
129
114
  return false;
@@ -134,6 +119,22 @@ class GoYoshi extends base_1.BaseStrategy {
134
119
  return true;
135
120
  });
136
121
  }
122
+ async getIgnoredSubModules() {
123
+ // ignored submodules only applies to the root component of
124
+ // googleapis/google-cloud-go
125
+ if (this.repository.owner !== 'googleapis' ||
126
+ this.repository.repo !== 'google-cloud-go' ||
127
+ this.includeComponentInTag) {
128
+ return new Set();
129
+ }
130
+ logger_1.logger.info('Looking for go.mod files');
131
+ const paths = (await this.github.findFilesByFilenameAndRef('go.mod', this.targetBranch))
132
+ .filter(path => !path.includes('internal') && path !== 'go.mod')
133
+ .map(path => path_1.dirname(path));
134
+ logger_1.logger.info(`Found ${paths.length} submodules`);
135
+ logger_1.logger.debug(JSON.stringify(paths));
136
+ return new Set(paths);
137
+ }
137
138
  // "closes" is a little presumptuous, let's just indicate that the
138
139
  // PR references these other commits:
139
140
  async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
@@ -21,9 +21,10 @@ const changelog_1 = require("../updaters/changelog");
21
21
  const package_json_1 = require("../updaters/node/package-json");
22
22
  class Node extends base_1.BaseStrategy {
23
23
  async buildUpdates(options) {
24
+ var _a;
24
25
  const updates = [];
25
26
  const version = options.newVersion;
26
- const packageName = this.packageName || '';
27
+ const packageName = (_a = (await this.getPackageName())) !== null && _a !== void 0 ? _a : '';
27
28
  const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json'];
28
29
  lockFiles.forEach(lockFile => {
29
30
  updates.push({
@@ -84,6 +84,7 @@ class PHPYoshi extends base_1.BaseStrategy {
84
84
  previousTag: (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.toString(),
85
85
  currentTag: newVersionTag.toString(),
86
86
  targetBranch: this.targetBranch,
87
+ changelogSections: this.changelogSections,
87
88
  });
88
89
  releaseNotesBody = updatePHPChangelogEntry(`${composer.name} ${newVersion.toString()}`, releaseNotesBody, partialReleaseNotes);
89
90
  }
@@ -52,7 +52,7 @@ class PullRequestBody {
52
52
  return this.releaseData
53
53
  .map(release => {
54
54
  var _a;
55
- return `<details><summary>${release.component}: ${(_a = release.version) === null || _a === void 0 ? void 0 : _a.toString()}</summary>\n\n${release.notes}\n</details>`;
55
+ return `<details><summary>${release.component ? `${release.component}: ` : ''}${(_a = release.version) === null || _a === void 0 ? void 0 : _a.toString()}</summary>\n\n${release.notes}\n</details>`;
56
56
  })
57
57
  .join('\n\n');
58
58
  }
@@ -91,6 +91,7 @@ function splitBody(body) {
91
91
  };
92
92
  }
93
93
  const SUMMARY_PATTERN = /^(?<component>.*[^:]):? (?<version>\d+\.\d+\.\d+.*)$/;
94
+ const COMPONENTLESS_SUMMARY_PATTERN = /^(?<version>\d+\.\d+\.\d+.*)$/;
94
95
  function extractMultipleReleases(notes) {
95
96
  const data = [];
96
97
  const root = node_html_parser_1.parse(notes);
@@ -98,17 +99,28 @@ function extractMultipleReleases(notes) {
98
99
  const summaryNode = detail.getElementsByTagName('summary')[0];
99
100
  const summary = summaryNode === null || summaryNode === void 0 ? void 0 : summaryNode.textContent;
100
101
  const match = summary.match(SUMMARY_PATTERN);
101
- if (!(match === null || match === void 0 ? void 0 : match.groups)) {
102
- logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
103
- continue;
102
+ if (match === null || match === void 0 ? void 0 : match.groups) {
103
+ detail.removeChild(summaryNode);
104
+ const notes = detail.textContent.trim();
105
+ data.push({
106
+ component: match.groups.component,
107
+ version: version_1.Version.parse(match.groups.version),
108
+ notes,
109
+ });
110
+ }
111
+ else {
112
+ const componentlessMatch = summary.match(COMPONENTLESS_SUMMARY_PATTERN);
113
+ if (!(componentlessMatch === null || componentlessMatch === void 0 ? void 0 : componentlessMatch.groups)) {
114
+ logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
115
+ continue;
116
+ }
117
+ detail.removeChild(summaryNode);
118
+ const notes = detail.textContent.trim();
119
+ data.push({
120
+ version: version_1.Version.parse(componentlessMatch.groups.version),
121
+ notes,
122
+ });
104
123
  }
105
- detail.removeChild(summaryNode);
106
- const notes = detail.textContent.trim();
107
- data.push({
108
- component: match.groups.component,
109
- version: version_1.Version.parse(match.groups.version),
110
- notes,
111
- });
112
124
  }
113
125
  return data;
114
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.4.6",
3
+ "version": "13.4.10",
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",
@@ -53,7 +53,7 @@
53
53
  "gts": "^3.0.0",
54
54
  "mocha": "^9.0.0",
55
55
  "nock": "^13.0.0",
56
- "sinon": "13.0.0",
56
+ "sinon": "13.0.1",
57
57
  "snap-shot-it": "^7.0.0"
58
58
  },
59
59
  "dependencies": {