release-please 16.12.1 → 16.12.2

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.
@@ -331,6 +331,7 @@ function parseConventionalCommits(commits, logger = logger_1.logger) {
331
331
  }
332
332
  catch (_err) {
333
333
  logger.debug(`commit could not be parsed: ${commit.sha} ${commit.message.split('\n')[0]}`);
334
+ logger.debug(`error message: ${_err}`);
334
335
  }
335
336
  }
336
337
  }
@@ -14,4 +14,4 @@ export { Logger, setLogger } from './util/logger';
14
14
  export { GitHub } from './github';
15
15
  export declare const configSchema: any;
16
16
  export declare const manifestSchema: any;
17
- export declare const VERSION = "16.12.1";
17
+ export declare const VERSION = "16.12.2";
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "GitHub", { enumerable: true, get: function () {
36
36
  exports.configSchema = require('../../schemas/config.json');
37
37
  exports.manifestSchema = require('../../schemas/manifest.json');
38
38
  // x-release-please-start-version
39
- exports.VERSION = '16.12.1';
39
+ exports.VERSION = '16.12.2';
40
40
  // x-release-please-end
41
41
  //# sourceMappingURL=index.js.map
@@ -2,6 +2,9 @@ import { CandidateReleasePullRequest } from '../manifest';
2
2
  import { WorkspacePlugin, DependencyGraph } from './workspace';
3
3
  import { CargoManifest } from '../updaters/rust/common';
4
4
  import { VersionsMap, Version } from '../version';
5
+ import { Strategy } from '../strategy';
6
+ import { Commit } from '../commit';
7
+ import { Release } from '../release';
5
8
  interface CrateInfo {
6
9
  /**
7
10
  * e.g. `crates/crate-a`
@@ -36,6 +39,8 @@ interface CrateInfo {
36
39
  * into a single rust package.
37
40
  */
38
41
  export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
42
+ private strategiesByPath;
43
+ private releasesByPath;
39
44
  protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<{
40
45
  allPackages: CrateInfo[];
41
46
  candidatesByPackage: Record<string, CandidateReleasePullRequest>;
@@ -48,5 +53,6 @@ export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
48
53
  protected inScope(candidate: CandidateReleasePullRequest): boolean;
49
54
  protected packageNameFromPackage(pkg: CrateInfo): string;
50
55
  protected pathFromPackage(pkg: CrateInfo): string;
56
+ preconfigure(strategiesByPath: Record<string, Strategy>, _commitsByPath: Record<string, Commit[]>, _releasesByPath: Record<string, Release>): Promise<Record<string, Strategy>>;
51
57
  }
52
58
  export {};
@@ -35,6 +35,11 @@ const errors_1 = require("../errors");
35
35
  * into a single rust package.
36
36
  */
37
37
  class CargoWorkspace extends workspace_1.WorkspacePlugin {
38
+ constructor() {
39
+ super(...arguments);
40
+ this.strategiesByPath = {};
41
+ this.releasesByPath = {};
42
+ }
38
43
  async buildAllPackages(candidates) {
39
44
  var _a, _b, _c, _d;
40
45
  const cargoManifestContent = await this.github.getFileContentsOnBranch('Cargo.toml', this.targetBranch);
@@ -143,6 +148,26 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
143
148
  const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
144
149
  const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
145
150
  const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
151
+ const updatedPackage = {
152
+ ...pkg,
153
+ version: version.toString(),
154
+ };
155
+ const strategy = this.strategiesByPath[updatedPackage.path];
156
+ const latestRelease = this.releasesByPath[updatedPackage.path];
157
+ const basePullRequest = strategy
158
+ ? await strategy.buildReleasePullRequest([], latestRelease, false, [], {
159
+ newVersion: version,
160
+ })
161
+ : undefined;
162
+ if (basePullRequest) {
163
+ return this.updateCandidate({
164
+ path: pkg.path,
165
+ pullRequest: basePullRequest,
166
+ config: {
167
+ releaseType: 'rust',
168
+ },
169
+ }, pkg, updatedVersions);
170
+ }
146
171
  const pullRequest = {
147
172
  title: pull_request_title_1.PullRequestTitle.ofTargetBranch(this.targetBranch),
148
173
  body: new pull_request_body_1.PullRequestBody([
@@ -236,6 +261,12 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
236
261
  pathFromPackage(pkg) {
237
262
  return pkg.path;
238
263
  }
264
+ async preconfigure(strategiesByPath, _commitsByPath, _releasesByPath) {
265
+ // Using preconfigure to siphon releases and strategies.
266
+ this.strategiesByPath = strategiesByPath;
267
+ this.releasesByPath = _releasesByPath;
268
+ return strategiesByPath;
269
+ }
239
270
  }
240
271
  exports.CargoWorkspace = CargoWorkspace;
241
272
  function getChangelogDepsNotes(originalManifest, updatedManifest) {
@@ -21,9 +21,9 @@ const pull_request_body_1 = require("../util/pull-request-body");
21
21
  const branch_name_1 = require("../util/branch-name");
22
22
  const changelog_1 = require("../updaters/changelog");
23
23
  const workspace_1 = require("./workspace");
24
- const versioning_strategy_1 = require("../versioning-strategy");
25
24
  const composite_1 = require("../updaters/composite");
26
25
  const package_json_1 = require("../updaters/node/package-json");
26
+ const versioning_strategy_1 = require("../versioning-strategy");
27
27
  /**
28
28
  * The plugin analyzed a cargo workspace and will bump dependencies
29
29
  * of managed packages if those dependencies are being updated.
@@ -99,6 +99,9 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
99
99
  }
100
100
  bumpVersion(pkg) {
101
101
  const version = version_1.Version.parse(pkg.version);
102
+ const strategy = this.strategiesByPath[pkg.path];
103
+ if (strategy)
104
+ return strategy.versioningStrategy.bump(version, []);
102
105
  return new versioning_strategy_1.PatchVersionUpdate().bump(version);
103
106
  }
104
107
  updateCandidate(existingCandidate, pkg, updatedVersions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "16.12.1",
3
+ "version": "16.12.2",
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",
@@ -62,7 +62,7 @@
62
62
  "gts": "^3.1.0",
63
63
  "mocha": "^9.2.2",
64
64
  "nock": "^13.0.0",
65
- "sinon": "18.0.0",
65
+ "sinon": "18.0.1",
66
66
  "snap-shot-it": "^7.0.0"
67
67
  },
68
68
  "dependencies": {
@@ -81,7 +81,7 @@
81
81
  "conventional-changelog-writer": "^6.0.0",
82
82
  "conventional-commits-filter": "^3.0.0",
83
83
  "detect-indent": "^6.1.0",
84
- "diff": "^5.0.0",
84
+ "diff": "^7.0.0",
85
85
  "figures": "^3.0.0",
86
86
  "http-proxy-agent": "^7.0.0",
87
87
  "https-proxy-agent": "^7.0.0",