release-please 13.3.2 → 13.4.3

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,43 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.4.3](https://github.com/googleapis/release-please/compare/v13.4.2...v13.4.3) (2022-01-24)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * multi-component manifest release notes for single component release ([#1247](https://github.com/googleapis/release-please/issues/1247)) ([16aee09](https://github.com/googleapis/release-please/commit/16aee099c79d75853e565f83017745eef13b57fa))
13
+ * release notes should parse initial version heading ([#1248](https://github.com/googleapis/release-please/issues/1248)) ([71dc495](https://github.com/googleapis/release-please/commit/71dc4954e2393f74c4442c021fcf6c8ee530b4ae))
14
+
15
+ ### [13.4.2](https://github.com/googleapis/release-please/compare/v13.4.1...v13.4.2) (2022-01-21)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Manifest.fromFile no longer ignores manifestFile arg ([#1243](https://github.com/googleapis/release-please/issues/1243)) ([04a44ab](https://github.com/googleapis/release-please/commit/04a44ab08e8ce3911ad814744cebb79aab2ef8aa))
21
+
22
+ ### [13.4.1](https://github.com/googleapis/release-please/compare/v13.4.0...v13.4.1) (2022-01-20)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * handle windows newlines in pull request body ([#1239](https://github.com/googleapis/release-please/issues/1239)) ([69a424f](https://github.com/googleapis/release-please/commit/69a424ff2671ccfb661efd376aede155caee42ce))
28
+ * **python:** fix version regex to find multiple digit patch versions ([#1238](https://github.com/googleapis/release-please/issues/1238)) ([e03a3bf](https://github.com/googleapis/release-please/commit/e03a3bf81f0706b96bc76f217ab420a0f90b4152)), closes [#1237](https://github.com/googleapis/release-please/issues/1237)
29
+ * **python:** restore default changelog config for python ([#1240](https://github.com/googleapis/release-please/issues/1240)) ([54007ea](https://github.com/googleapis/release-please/commit/54007ea6d7d6c12f5757eeb2b5abdf13a8b524be))
30
+
31
+ ## [13.4.0](https://github.com/googleapis/release-please/compare/v13.3.2...v13.4.0) (2022-01-18)
32
+
33
+
34
+ ### Features
35
+
36
+ * add grouped manifest pr title pattern option ([#1184](https://github.com/googleapis/release-please/issues/1184)) ([df1332f](https://github.com/googleapis/release-please/commit/df1332f3b95e622752d351a29fc0a1b5083963c6))
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * **go-yoshi:** restore scope-based commit filtering ([#1233](https://github.com/googleapis/release-please/issues/1233)) ([597e6dd](https://github.com/googleapis/release-please/commit/597e6dd58217c62d562070032138cee8cad5e693))
42
+ * search for files on target branch, not default branch ([#1235](https://github.com/googleapis/release-please/issues/1235)) ([d891f00](https://github.com/googleapis/release-please/commit/d891f000eb2b198bfb4331b41bc5020fff52e1da))
43
+
7
44
  ### [13.3.2](https://github.com/googleapis/release-please/compare/v13.3.1...v13.3.2) (2022-01-13)
8
45
 
9
46
 
@@ -71,6 +71,7 @@ export interface ManifestOptions {
71
71
  draft?: boolean;
72
72
  prerelease?: boolean;
73
73
  draftPullRequest?: boolean;
74
+ groupPullRequestTitlePattern?: string;
74
75
  }
75
76
  interface ReleaserPackageConfig extends ReleaserConfigJson {
76
77
  'package-name'?: string;
@@ -88,6 +89,7 @@ export interface ManifestConfig extends ReleaserConfigJson {
88
89
  'always-link-local'?: boolean;
89
90
  plugins?: PluginType[];
90
91
  'separate-pull-requests'?: boolean;
92
+ 'group-pull-request-title-pattern'?: string;
91
93
  }
92
94
  export declare type ReleasedVersions = Record<string, Version>;
93
95
  export declare type RepositoryConfig = Record<string, ReleaserConfig>;
@@ -122,6 +124,7 @@ export declare class Manifest {
122
124
  private draft?;
123
125
  private prerelease?;
124
126
  private draftPullRequest?;
127
+ private groupPullRequestTitlePattern?;
125
128
  /**
126
129
  * Create a Manifest from explicit config in code. This assumes that the
127
130
  * repository has a single component at the root path.
@@ -77,6 +77,7 @@ class Manifest {
77
77
  this.lastReleaseSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.lastReleaseSha;
78
78
  this.draft = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draft;
79
79
  this.draftPullRequest = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draftPullRequest;
80
+ this.groupPullRequestTitlePattern = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
80
81
  }
81
82
  /**
82
83
  * Create a Manifest from config files in the repository.
@@ -92,7 +93,11 @@ class Manifest {
92
93
  parseConfig(github, configFile, targetBranch),
93
94
  parseReleasedVersions(github, manifestFile, targetBranch),
94
95
  ]);
95
- return new Manifest(github, targetBranch, repositoryConfig, releasedVersions, { ...manifestOptions, ...manifestOptionOverrides });
96
+ return new Manifest(github, targetBranch, repositoryConfig, releasedVersions, {
97
+ manifestPath: manifestFile,
98
+ ...manifestOptions,
99
+ ...manifestOptionOverrides,
100
+ });
96
101
  }
97
102
  /**
98
103
  * Create a Manifest from explicit config in code. This assumes that the
@@ -311,10 +316,11 @@ class Manifest {
311
316
  targetBranch: this.targetBranch,
312
317
  repositoryConfig: this.repositoryConfig,
313
318
  }));
319
+ logger_1.logger.info(`separate pull requests: ${this.separatePullRequests}`);
314
320
  // Combine pull requests into 1 unless configured for separate
315
321
  // pull requests
316
322
  if (!this.separatePullRequests) {
317
- plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig));
323
+ plugins.push(new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig, this.groupPullRequestTitlePattern));
318
324
  }
319
325
  for (const plugin of plugins) {
320
326
  newReleasePullRequests = await plugin.run(newReleasePullRequests);
@@ -588,6 +594,7 @@ async function parseConfig(github, configFile, branch) {
588
594
  lastReleaseSha: config['last-release-sha'],
589
595
  alwaysLinkLocal: config['always-link-local'],
590
596
  separatePullRequests: config['separate-pull-requests'],
597
+ groupPullRequestTitlePattern: config['group-pull-request-title-pattern'],
591
598
  plugins: config['plugins'],
592
599
  };
593
600
  return { config: repositoryConfig, options: manifestOptions };
@@ -701,7 +708,7 @@ async function latestReleaseVersion(github, targetBranch, prefix, pullRequestTit
701
708
  return candidateTagVersion.sort((a, b) => b.compare(a))[0];
702
709
  }
703
710
  function mergeReleaserConfig(defaultConfig, pathConfig) {
704
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
711
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
705
712
  return {
706
713
  releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node',
707
714
  bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor,
@@ -716,6 +723,7 @@ function mergeReleaserConfig(defaultConfig, pathConfig) {
716
723
  packageName: (_m = pathConfig.packageName) !== null && _m !== void 0 ? _m : defaultConfig.packageName,
717
724
  versionFile: (_o = pathConfig.versionFile) !== null && _o !== void 0 ? _o : defaultConfig.versionFile,
718
725
  extraFiles: (_p = pathConfig.extraFiles) !== null && _p !== void 0 ? _p : defaultConfig.extraFiles,
726
+ pullRequestTitlePattern: (_q = pathConfig.pullRequestTitlePattern) !== null && _q !== void 0 ? _q : defaultConfig.pullRequestTitlePattern,
719
727
  };
720
728
  }
721
729
  /**
@@ -1,5 +1,6 @@
1
1
  import { ManifestPlugin } from '../plugin';
2
- import { CandidateReleasePullRequest } from '../manifest';
2
+ import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
3
+ import { GitHub } from '../github';
3
4
  /**
4
5
  * This plugin merges multiple pull requests into a single
5
6
  * release pull request.
@@ -7,5 +8,7 @@ import { CandidateReleasePullRequest } from '../manifest';
7
8
  * Release notes are broken up using `<summary>`/`<details>` blocks.
8
9
  */
9
10
  export declare class Merge extends ManifestPlugin {
11
+ private pullRequestTitlePattern?;
12
+ constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, pullRequestTitlePattern?: string);
10
13
  run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
11
14
  }
@@ -20,6 +20,7 @@ const pull_request_title_1 = require("../util/pull-request-title");
20
20
  const pull_request_body_1 = require("../util/pull-request-body");
21
21
  const branch_name_1 = require("../util/branch-name");
22
22
  const composite_1 = require("../updaters/composite");
23
+ const logger_1 = require("../util/logger");
23
24
  /**
24
25
  * This plugin merges multiple pull requests into a single
25
26
  * release pull request.
@@ -27,13 +28,20 @@ const composite_1 = require("../updaters/composite");
27
28
  * Release notes are broken up using `<summary>`/`<details>` blocks.
28
29
  */
29
30
  class Merge extends plugin_1.ManifestPlugin {
31
+ constructor(github, targetBranch, repositoryConfig, pullRequestTitlePattern) {
32
+ super(github, targetBranch, repositoryConfig);
33
+ this.pullRequestTitlePattern =
34
+ pullRequestTitlePattern || manifest_1.MANIFEST_PULL_REQUEST_TITLE_PATTERN;
35
+ }
30
36
  async run(candidates) {
31
37
  if (candidates.length < 1) {
32
38
  return candidates;
33
39
  }
40
+ logger_1.logger.info(`Merging ${candidates.length} pull requests`);
34
41
  const releaseData = [];
35
42
  const labels = new Set();
36
43
  let rawUpdates = [];
44
+ let rootRelease = null;
37
45
  for (const candidate of candidates) {
38
46
  const pullRequest = candidate.pullRequest;
39
47
  rawUpdates = rawUpdates.concat(...pullRequest.updates);
@@ -41,11 +49,14 @@ class Merge extends plugin_1.ManifestPlugin {
41
49
  labels.add(label);
42
50
  }
43
51
  releaseData.push(...pullRequest.body.releaseData);
52
+ if (candidate.path === '.') {
53
+ rootRelease = candidate;
54
+ }
44
55
  }
45
56
  const updates = composite_1.mergeUpdates(rawUpdates);
46
57
  const pullRequest = {
47
- title: pull_request_title_1.PullRequestTitle.ofTargetBranch(this.targetBranch, manifest_1.MANIFEST_PULL_REQUEST_TITLE_PATTERN),
48
- body: new pull_request_body_1.PullRequestBody(releaseData),
58
+ title: pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.component, this.targetBranch, rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.version, this.pullRequestTitlePattern),
59
+ body: new pull_request_body_1.PullRequestBody(releaseData, { useComponents: true }),
49
60
  updates,
50
61
  labels: Array.from(labels),
51
62
  headRefName: branch_name_1.BranchName.ofTargetBranch(this.targetBranch).toString(),
@@ -55,7 +55,7 @@ export declare abstract class BaseStrategy implements Strategy {
55
55
  protected tagSeparator?: string;
56
56
  private skipGitHubRelease;
57
57
  private releaseAs?;
58
- private includeComponentInTag;
58
+ protected includeComponentInTag: boolean;
59
59
  private pullRequestTitlePattern?;
60
60
  readonly extraFiles: string[];
61
61
  readonly changelogNotes: ChangelogNotes;
@@ -79,7 +79,7 @@ export declare abstract class BaseStrategy implements Strategy {
79
79
  * @param {ConventionalCommit[]} commits parsed commits
80
80
  * @returns {ConventionalCommit[]} modified commits
81
81
  */
82
- protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
82
+ protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
83
83
  protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
84
84
  protected buildPullRequestBody(component: string | undefined, newVersion: Version, releaseNotesBody: string, _conventionalCommits: ConventionalCommit[], _latestRelease?: Release): Promise<PullRequestBody>;
85
85
  /**
@@ -81,7 +81,7 @@ class BaseStrategy {
81
81
  * @param {ConventionalCommit[]} commits parsed commits
82
82
  * @returns {ConventionalCommit[]} modified commits
83
83
  */
84
- postProcessCommits(commits) {
84
+ async postProcessCommits(commits) {
85
85
  return commits;
86
86
  }
87
87
  async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
@@ -117,13 +117,14 @@ class BaseStrategy {
117
117
  * open a pull request.
118
118
  */
119
119
  async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
120
- const conventionalCommits = this.postProcessCommits(commit_1.parseConventionalCommits(commits));
120
+ const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
121
+ logger_1.logger.info(`Considering: ${conventionalCommits.length} commits`);
121
122
  const newVersion = await this.buildNewVersion(conventionalCommits, latestRelease);
122
123
  const versionsMap = await this.updateVersionsMap(await this.buildVersionsMap(conventionalCommits), conventionalCommits);
123
124
  const component = await this.getComponent();
124
125
  logger_1.logger.debug('component:', component);
125
126
  const newVersionTag = new tag_name_1.TagName(newVersion, this.includeComponentInTag ? component : undefined, this.tagSeparator);
126
- logger_1.logger.warn('pull request title pattern:', this.pullRequestTitlePattern);
127
+ logger_1.logger.debug('pull request title pattern:', this.pullRequestTitlePattern);
127
128
  const pullRequestTitle = pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(component || '', this.targetBranch, newVersion, this.pullRequestTitlePattern);
128
129
  const branchName = component
129
130
  ? branch_name_1.BranchName.ofComponentTargetBranch(component, this.targetBranch)
@@ -7,7 +7,7 @@ import { Release } from '../release';
7
7
  export declare class GoYoshi extends BaseStrategy {
8
8
  constructor(options: BaseStrategyOptions);
9
9
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
10
- protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
10
+ protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
11
11
  protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
12
12
  protected initialReleaseVersion(): Version;
13
13
  }
@@ -18,6 +18,7 @@ const base_1 = require("./base");
18
18
  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
+ const logger_1 = require("../util/logger");
21
22
  // Commits containing a scope prefixed with an item in this array will be
22
23
  // ignored when generating a release PR for the parent module.
23
24
  const IGNORED_SUB_MODULES = new Set([
@@ -59,8 +60,10 @@ class GoYoshi extends base_1.BaseStrategy {
59
60
  });
60
61
  return updates;
61
62
  }
62
- postProcessCommits(commits) {
63
+ async postProcessCommits(commits) {
63
64
  let regenCommit;
65
+ const component = await this.getComponent();
66
+ logger_1.logger.debug('Filtering commits');
64
67
  return commits.filter(commit => {
65
68
  var _a, _b;
66
69
  // ignore commits whose scope is in the list of ignored modules
@@ -97,6 +100,37 @@ class GoYoshi extends base_1.BaseStrategy {
97
100
  }
98
101
  }
99
102
  }
103
+ // For google-cloud-go, filter into 2 cases, a subset of modules
104
+ // released independently, and the remainder
105
+ if (this.repository.owner === 'googleapis' &&
106
+ this.repository.repo === 'google-cloud-go') {
107
+ // Skip commits that don't have a scope as we don't know where to
108
+ // put them
109
+ if (!commit.scope) {
110
+ logger_1.logger.debug(`Skipping commit without scope: ${commit.message}`);
111
+ return false;
112
+ }
113
+ // Skip commits related to sub-modules as they are not part of
114
+ // the parent module.
115
+ if (this.includeComponentInTag) {
116
+ // This is a submodule release, so only include commits in this
117
+ // scope
118
+ if (!commitMatchesScope(commit.scope, component)) {
119
+ logger_1.logger.debug(`Skipping commit scope: ${commit.scope} != ${component}`);
120
+ return false;
121
+ }
122
+ }
123
+ else {
124
+ // This is the main module release, so ignore sub modules that
125
+ // are released independently
126
+ for (const submodule of IGNORED_SUB_MODULES) {
127
+ if (commitMatchesScope(commit.scope, submodule)) {
128
+ logger_1.logger.debug(`Skipping ignored commit scope: ${commit.scope}`);
129
+ return false;
130
+ }
131
+ }
132
+ }
133
+ }
100
134
  return true;
101
135
  });
102
136
  }
@@ -111,4 +145,7 @@ class GoYoshi extends base_1.BaseStrategy {
111
145
  }
112
146
  }
113
147
  exports.GoYoshi = GoYoshi;
148
+ function commitMatchesScope(commitScope, scope) {
149
+ return commitScope === scope || commitScope.startsWith(`${scope}/`);
150
+ }
114
151
  //# sourceMappingURL=go-yoshi.js.map
@@ -136,9 +136,9 @@ class JavaYoshi extends base_1.BaseStrategy {
136
136
  versionsMap,
137
137
  }),
138
138
  });
139
- const pomFilesSearch = this.github.findFilesByFilename('pom.xml', this.path);
140
- const buildFilesSearch = this.github.findFilesByFilename('build.gradle', this.path);
141
- const dependenciesSearch = this.github.findFilesByFilename('dependencies.properties', this.path);
139
+ const pomFilesSearch = this.github.findFilesByFilenameAndRef('pom.xml', this.targetBranch, this.path);
140
+ const buildFilesSearch = this.github.findFilesByFilenameAndRef('build.gradle', this.targetBranch, this.path);
141
+ const dependenciesSearch = this.github.findFilesByFilenameAndRef('dependencies.properties', this.targetBranch, this.path);
142
142
  const pomFiles = await pomFilesSearch;
143
143
  pomFiles.forEach(path => {
144
144
  updates.push({
@@ -50,7 +50,7 @@ class PHPYoshi extends base_1.BaseStrategy {
50
50
  }
51
51
  async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
52
52
  var _a, _b, _c;
53
- const conventionalCommits = this.postProcessCommits(commit_1.parseConventionalCommits(commits));
53
+ const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
54
54
  const newVersion = latestRelease
55
55
  ? await this.versioningStrategy.bump(latestRelease.tag.version, conventionalCommits)
56
56
  : this.initialReleaseVersion();
@@ -1,7 +1,8 @@
1
- import { BaseStrategy, BuildUpdatesOptions } from './base';
1
+ import { BaseStrategy, BuildUpdatesOptions, BaseStrategyOptions } from './base';
2
2
  import { Update } from '../update';
3
3
  import { Version } from '../version';
4
4
  export declare class Python extends BaseStrategy {
5
+ constructor(options: BaseStrategyOptions);
5
6
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
6
7
  private getPyProject;
7
8
  protected initialReleaseVersion(): Version;
@@ -22,7 +22,26 @@ const setup_py_1 = require("../updaters/python/setup-py");
22
22
  const pyproject_toml_1 = require("../updaters/python/pyproject-toml");
23
23
  const logger_1 = require("../util/logger");
24
24
  const python_file_with_version_1 = require("../updaters/python/python-file-with-version");
25
+ const CHANGELOG_SECTIONS = [
26
+ { type: 'feat', section: 'Features' },
27
+ { type: 'fix', section: 'Bug Fixes' },
28
+ { type: 'perf', section: 'Performance Improvements' },
29
+ { type: 'deps', section: 'Dependencies' },
30
+ { type: 'revert', section: 'Reverts' },
31
+ { type: 'docs', section: 'Documentation' },
32
+ { type: 'style', section: 'Styles', hidden: true },
33
+ { type: 'chore', section: 'Miscellaneous Chores', hidden: true },
34
+ { type: 'refactor', section: 'Code Refactoring', hidden: true },
35
+ { type: 'test', section: 'Tests', hidden: true },
36
+ { type: 'build', section: 'Build System', hidden: true },
37
+ { type: 'ci', section: 'Continuous Integration', hidden: true },
38
+ ];
25
39
  class Python extends base_1.BaseStrategy {
40
+ constructor(options) {
41
+ var _a;
42
+ options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
43
+ super(options);
44
+ }
26
45
  async buildUpdates(options) {
27
46
  var _a;
28
47
  const updates = [];
@@ -87,7 +106,7 @@ class Python extends base_1.BaseStrategy {
87
106
  });
88
107
  }
89
108
  // There should be only one version.py, but foreach in case that is incorrect
90
- const versionPyFilesSearch = this.github.findFilesByFilename('version.py', this.path);
109
+ const versionPyFilesSearch = this.github.findFilesByFilenameAndRef('version.py', this.targetBranch, this.path);
91
110
  const versionPyFiles = await versionPyFilesSearch;
92
111
  versionPyFiles.forEach(path => {
93
112
  updates.push({
@@ -11,7 +11,7 @@ export declare class RubyYoshi extends BaseStrategy {
11
11
  readonly versionFile: string;
12
12
  constructor(options: RubyYoshiStrategyOptions);
13
13
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
14
- protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
14
+ protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
15
15
  protected buildPullRequestBody(component: string | undefined, newVersion: Version, releaseNotesBody: string, conventionalCommits: ConventionalCommit[], latestRelease?: Release): Promise<PullRequestBody>;
16
16
  }
17
17
  export {};
@@ -74,7 +74,7 @@ class RubyYoshi extends base_1.BaseStrategy {
74
74
  });
75
75
  return updates;
76
76
  }
77
- postProcessCommits(commits) {
77
+ async postProcessCommits(commits) {
78
78
  commits.forEach(commit => {
79
79
  commit.message = indent_commit_1.indentCommit(commit);
80
80
  });
@@ -8,6 +8,6 @@ export declare class Ruby extends BaseStrategy {
8
8
  readonly versionFile: string;
9
9
  constructor(options: RubyStrategyOptions);
10
10
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
11
- protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
11
+ protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
12
12
  }
13
13
  export {};
@@ -50,7 +50,7 @@ class Ruby extends base_1.BaseStrategy {
50
50
  });
51
51
  return updates;
52
52
  }
53
- postProcessCommits(commits) {
53
+ async postProcessCommits(commits) {
54
54
  commits.forEach(commit => {
55
55
  commit.message = indent_commit_1.indentCommit(commit);
56
56
  });
@@ -35,7 +35,7 @@ class TerraformModule extends base_1.BaseStrategy {
35
35
  });
36
36
  // Update version in README to current candidate version.
37
37
  // A module may have submodules, so find all submodules.
38
- const readmeFiles = await this.github.findFilesByFilename('readme.md', this.path);
38
+ const readmeFiles = await this.github.findFilesByFilenameAndRef('readme.md', this.targetBranch, this.path);
39
39
  readmeFiles.forEach(path => {
40
40
  updates.push({
41
41
  path: this.addPath(path),
@@ -48,8 +48,8 @@ class TerraformModule extends base_1.BaseStrategy {
48
48
  // Update versions.tf to current candidate version.
49
49
  // A module may have submodules, so find all versions.tfand versions.tf.tmpl to update.
50
50
  const versionFiles = await Promise.all([
51
- this.github.findFilesByFilename('versions.tf', this.path),
52
- this.github.findFilesByFilename('versions.tf.tmpl', this.path),
51
+ this.github.findFilesByFilenameAndRef('versions.tf', this.targetBranch, this.path),
52
+ this.github.findFilesByFilenameAndRef('versions.tf.tmpl', this.targetBranch, this.path),
53
53
  ]).then(([v, vt]) => {
54
54
  return v.concat(vt);
55
55
  });
@@ -25,7 +25,7 @@ class SetupPy 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}$2`);
28
+ return content.replace(/(version ?= ?["'])[0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?(["'])/, `$1${this.version}$2`);
29
29
  }
30
30
  }
31
31
  exports.SetupPy = SetupPy;
@@ -3,12 +3,14 @@ interface PullRequestBodyOptions {
3
3
  header?: string;
4
4
  footer?: string;
5
5
  extra?: string;
6
+ useComponents?: boolean;
6
7
  }
7
8
  export declare class PullRequestBody {
8
9
  header: string;
9
10
  footer: string;
10
11
  extra?: string;
11
12
  releaseData: ReleaseData[];
13
+ useComponents: boolean;
12
14
  constructor(releaseData: ReleaseData[], options?: PullRequestBodyOptions);
13
15
  static parse(body: string): PullRequestBody | undefined;
14
16
  notes(): string;
@@ -22,10 +22,12 @@ const DEFAULT_FOOTER = 'This PR was generated with [Release Please](https://gith
22
22
  const NOTES_DELIMITER = '---';
23
23
  class PullRequestBody {
24
24
  constructor(releaseData, options) {
25
+ var _a;
25
26
  this.header = (options === null || options === void 0 ? void 0 : options.header) || DEFAULT_HEADER;
26
27
  this.footer = (options === null || options === void 0 ? void 0 : options.footer) || DEFAULT_FOOTER;
27
28
  this.extra = options === null || options === void 0 ? void 0 : options.extra;
28
29
  this.releaseData = releaseData;
30
+ this.useComponents = (_a = options === null || options === void 0 ? void 0 : options.useComponents) !== null && _a !== void 0 ? _a : this.releaseData.length > 1;
29
31
  }
30
32
  static parse(body) {
31
33
  const parts = splitBody(body);
@@ -46,7 +48,7 @@ class PullRequestBody {
46
48
  });
47
49
  }
48
50
  notes() {
49
- if (this.releaseData.length > 1) {
51
+ if (this.useComponents) {
50
52
  return this.releaseData
51
53
  .map(release => {
52
54
  var _a;
@@ -70,7 +72,7 @@ ${this.footer}`;
70
72
  }
71
73
  exports.PullRequestBody = PullRequestBody;
72
74
  function splitBody(body) {
73
- const lines = body.trim().split('\n');
75
+ const lines = body.trim().replace(/\r\n/g, '\n').split('\n');
74
76
  const index = lines.indexOf(NOTES_DELIMITER);
75
77
  if (index === -1) {
76
78
  return undefined;
@@ -110,7 +112,7 @@ function extractMultipleReleases(notes) {
110
112
  }
111
113
  return data;
112
114
  }
113
- const COMPARE_REGEX = /^#{2,} \[(?<version>\d+\.\d+\.\d+.*)\]/;
115
+ const COMPARE_REGEX = /^#{2,} \[?(?<version>\d+\.\d+\.\d+.*)\]?/;
114
116
  function extractSingleRelease(body) {
115
117
  var _a;
116
118
  body = body.trim();
@@ -11,7 +11,7 @@ export declare class PullRequestTitle {
11
11
  static ofComponentVersion(component: string, version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
12
12
  static ofVersion(version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
13
13
  static ofTargetBranchVersion(targetBranch: string, version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
14
- static ofComponentTargetBranchVersion(component: string, targetBranch: string, version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
14
+ static ofComponentTargetBranchVersion(component?: string, targetBranch?: string, version?: Version, pullRequestTitlePattern?: string): PullRequestTitle;
15
15
  static ofTargetBranch(targetBranch: string, pullRequestTitlePattern?: string): PullRequestTitle;
16
16
  getTargetBranch(): string | undefined;
17
17
  getComponent(): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.3.2",
3
+ "version": "13.4.3",
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",
@@ -79,7 +79,7 @@
79
79
  "node-html-parser": "^5.0.0",
80
80
  "parse-github-repo-url": "^1.4.1",
81
81
  "semver": "^7.0.0",
82
- "type-fest": "^1.0.0",
82
+ "type-fest": "^2.0.0",
83
83
  "typescript": "^3.8.3",
84
84
  "unist-util-visit": "^2.0.3",
85
85
  "unist-util-visit-parents": "^3.1.1",