release-please 13.2.1 → 13.3.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 CHANGED
@@ -4,6 +4,18 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.3.0](https://github.com/googleapis/release-please/compare/v13.2.1...v13.3.0) (2022-01-12)
8
+
9
+
10
+ ### Features
11
+
12
+ * allow configuring simple strategy version file ([#1168](https://github.com/googleapis/release-please/issues/1168)) ([08a0cf2](https://github.com/googleapis/release-please/commit/08a0cf2b2135713f856d8621cffa8f5b92fb8699))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * ruby-yoshi strategy should put commit summary only in pull request body ([#1193](https://github.com/googleapis/release-please/issues/1193)) ([d29eda1](https://github.com/googleapis/release-please/commit/d29eda172597979cea5cb54ce6eb278a1dfb03a0)), closes [#1192](https://github.com/googleapis/release-please/issues/1192)
18
+
7
19
  ### [13.2.1](https://github.com/googleapis/release-please/compare/v13.2.0...v13.2.1) (2022-01-12)
8
20
 
9
21
 
@@ -76,7 +76,6 @@ const releasers = {
76
76
  'php-yoshi': options => new php_yoshi_1.PHPYoshi(options),
77
77
  python: options => new python_1.Python(options),
78
78
  rust: options => new rust_1.Rust(options),
79
- simple: options => new simple_1.Simple(options),
80
79
  'terraform-module': options => new terraform_module_1.TerraformModule(options),
81
80
  helm: options => new helm_1.Helm(options),
82
81
  elixir: options => new elixir_1.Elixir(options),
@@ -159,6 +158,12 @@ async function buildStrategy(options) {
159
158
  versioningStrategy: new service_pack_1.ServicePackVersioningStrategy(),
160
159
  });
161
160
  }
161
+ case 'simple': {
162
+ return new simple_1.Simple({
163
+ ...strategyOptions,
164
+ versionFile: options.versionFile,
165
+ });
166
+ }
162
167
  default: {
163
168
  const builder = releasers[options.releaseType];
164
169
  if (builder) {
@@ -81,6 +81,7 @@ export declare abstract class BaseStrategy implements Strategy {
81
81
  */
82
82
  protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
83
83
  protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
84
+ protected buildPullRequestBody(component: string | undefined, newVersion: Version, releaseNotesBody: string, _conventionalCommits: ConventionalCommit[], _latestRelease?: Release): Promise<PullRequestBody>;
84
85
  /**
85
86
  * Builds a candidate release pull request
86
87
  * @param {Commit[]} commits Raw commits to consider for this release.
@@ -96,6 +96,15 @@ class BaseStrategy {
96
96
  changelogSections: this.changelogSections,
97
97
  });
98
98
  }
99
+ async buildPullRequestBody(component, newVersion, releaseNotesBody, _conventionalCommits, _latestRelease) {
100
+ return new pull_request_body_1.PullRequestBody([
101
+ {
102
+ component,
103
+ version: newVersion,
104
+ notes: releaseNotesBody,
105
+ },
106
+ ]);
107
+ }
99
108
  /**
100
109
  * Builds a candidate release pull request
101
110
  * @param {Commit[]} commits Raw commits to consider for this release.
@@ -131,13 +140,7 @@ class BaseStrategy {
131
140
  latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
132
141
  });
133
142
  const updatesWithExtras = composite_1.mergeUpdates(updates.concat(...this.extraFileUpdates(newVersion)));
134
- const pullRequestBody = new pull_request_body_1.PullRequestBody([
135
- {
136
- component,
137
- version: newVersion,
138
- notes: releaseNotesBody,
139
- },
140
- ]);
143
+ const pullRequestBody = await this.buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease);
141
144
  return {
142
145
  title: pullRequestTitle,
143
146
  body: pullRequestBody,
@@ -3,7 +3,7 @@ import { ConventionalCommit } from '../commit';
3
3
  import { Update } from '../update';
4
4
  import { Release } from '../release';
5
5
  import { Version } from '../version';
6
- import { TagName } from '../util/tag-name';
6
+ import { PullRequestBody } from '../util/pull-request-body';
7
7
  interface RubyYoshiStrategyOptions extends BaseStrategyOptions {
8
8
  versionFile?: string;
9
9
  }
@@ -12,6 +12,6 @@ export declare class RubyYoshi extends BaseStrategy {
12
12
  constructor(options: RubyYoshiStrategyOptions);
13
13
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
14
14
  protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
15
- protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
15
+ protected buildPullRequestBody(component: string | undefined, newVersion: Version, releaseNotesBody: string, conventionalCommits: ConventionalCommit[], latestRelease?: Release): Promise<PullRequestBody>;
16
16
  }
17
17
  export {};
@@ -24,6 +24,7 @@ const fs_1 = require("fs");
24
24
  const path_1 = require("path");
25
25
  const manifest_1 = require("../manifest");
26
26
  const logger_1 = require("../util/logger");
27
+ const pull_request_body_1 = require("../util/pull-request-body");
27
28
  const CHANGELOG_SECTIONS = [
28
29
  { type: 'feat', section: 'Features' },
29
30
  { type: 'fix', section: 'Bug Fixes' },
@@ -79,10 +80,9 @@ class RubyYoshi extends base_1.BaseStrategy {
79
80
  });
80
81
  return commits;
81
82
  }
82
- async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
83
- const releaseNotes = await super.buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease);
83
+ async buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease) {
84
84
  if (!latestRelease) {
85
- return releaseNotes;
85
+ return await super.buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease);
86
86
  }
87
87
  // summarize the commits that landed:
88
88
  let summary = '### Commits since last release:\n\n';
@@ -114,7 +114,15 @@ class RubyYoshi extends base_1.BaseStrategy {
114
114
  summary += `${file}\n`;
115
115
  });
116
116
  summary += `</code></pre>\n[Compare Changes](https://github.com/${repoUrl}/compare/${latestRelease.sha}...HEAD)\n`;
117
- return releaseNotes + `\n---\n${summary}`;
117
+ return new pull_request_body_1.PullRequestBody([
118
+ {
119
+ component,
120
+ version: newVersion,
121
+ notes: releaseNotesBody,
122
+ },
123
+ ], {
124
+ extra: summary,
125
+ });
118
126
  }
119
127
  }
120
128
  exports.RubyYoshi = RubyYoshi;
@@ -1,5 +1,11 @@
1
- import { BaseStrategy, BuildUpdatesOptions } from './base';
1
+ import { BaseStrategy, BuildUpdatesOptions, BaseStrategyOptions } from './base';
2
2
  import { Update } from '../update';
3
+ interface SimpleStrategyOptions extends BaseStrategyOptions {
4
+ versionFile?: string;
5
+ }
3
6
  export declare class Simple extends BaseStrategy {
7
+ readonly versionFile: string;
8
+ constructor(options: SimpleStrategyOptions);
4
9
  protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
5
10
  }
11
+ export {};
@@ -20,6 +20,11 @@ const changelog_1 = require("../updaters/changelog");
20
20
  const base_1 = require("./base");
21
21
  const default_1 = require("../updaters/default");
22
22
  class Simple extends base_1.BaseStrategy {
23
+ constructor(options) {
24
+ var _a;
25
+ super(options);
26
+ this.versionFile = (_a = options.versionFile) !== null && _a !== void 0 ? _a : 'version.txt';
27
+ }
23
28
  async buildUpdates(options) {
24
29
  const updates = [];
25
30
  const version = options.newVersion;
@@ -32,7 +37,7 @@ class Simple extends base_1.BaseStrategy {
32
37
  }),
33
38
  });
34
39
  updates.push({
35
- path: this.addPath('version.txt'),
40
+ path: this.addPath(this.versionFile),
36
41
  createIfMissing: false,
37
42
  updater: new default_1.DefaultUpdater({
38
43
  version,
@@ -2,10 +2,12 @@ import { Version } from '../version';
2
2
  interface PullRequestBodyOptions {
3
3
  header?: string;
4
4
  footer?: string;
5
+ extra?: string;
5
6
  }
6
7
  export declare class PullRequestBody {
7
8
  header: string;
8
9
  footer: string;
10
+ extra?: string;
9
11
  releaseData: ReleaseData[];
10
12
  constructor(releaseData: ReleaseData[], options?: PullRequestBodyOptions);
11
13
  static parse(body: string): PullRequestBody | undefined;
@@ -24,6 +24,7 @@ class PullRequestBody {
24
24
  constructor(releaseData, options) {
25
25
  this.header = (options === null || options === void 0 ? void 0 : options.header) || DEFAULT_HEADER;
26
26
  this.footer = (options === null || options === void 0 ? void 0 : options.footer) || DEFAULT_FOOTER;
27
+ this.extra = options === null || options === void 0 ? void 0 : options.extra;
27
28
  this.releaseData = releaseData;
28
29
  }
29
30
  static parse(body) {
@@ -63,7 +64,7 @@ ${NOTES_DELIMITER}
63
64
 
64
65
  ${notes}
65
66
 
66
- ${NOTES_DELIMITER}
67
+ ${NOTES_DELIMITER}${this.extra ? `\n\n${this.extra}\n` : ''}
67
68
  ${this.footer}`;
68
69
  }
69
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.2.1",
3
+ "version": "13.3.0",
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",