release-please 13.18.1 → 13.18.4

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,28 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [13.18.4](https://github.com/googleapis/release-please/compare/v13.18.3...v13.18.4) (2022-06-24)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **cli:** pass GitHub API URLs from options to builder ([#1481](https://github.com/googleapis/release-please/issues/1481)) ([44b39ba](https://github.com/googleapis/release-please/commit/44b39baf90c19db1440f142eddd9cf9ed99c2da3))
13
+ * **go:** hide unwanted changelog sections ([#1483](https://github.com/googleapis/release-please/issues/1483)) ([60ed310](https://github.com/googleapis/release-please/commit/60ed310caf8895501d31efc6a5e28a3855b5cd78))
14
+
15
+ ## [13.18.3](https://github.com/googleapis/release-please/compare/v13.18.2...v13.18.3) (2022-06-08)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * handle malformed manifest JSON and throw ConfigurationError ([#1469](https://github.com/googleapis/release-please/issues/1469)) ([e3af138](https://github.com/googleapis/release-please/commit/e3af1383d8ba5c127a1e19187081353565e673f8))
21
+
22
+ ## [13.18.2](https://github.com/googleapis/release-please/compare/v13.18.1...v13.18.2) (2022-06-08)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * factory errors for unknown types throw ConfigurationError instead of Error ([#1467](https://github.com/googleapis/release-please/issues/1467)) ([faa5d25](https://github.com/googleapis/release-please/commit/faa5d25fa2075d27d42238adf34e54f6a1bc39a4))
28
+
7
29
  ## [13.18.1](https://github.com/googleapis/release-please/compare/v13.18.0...v13.18.1) (2022-06-08)
8
30
 
9
31
 
@@ -493,6 +493,8 @@ async function buildGitHub(argv) {
493
493
  owner,
494
494
  repo,
495
495
  token: argv.token,
496
+ apiUrl: argv.apiUrl,
497
+ graphqlUrl: argv.graphqlUrl,
496
498
  });
497
499
  return github;
498
500
  }
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.getChangelogTypes = exports.unregisterChangelogNotes = exports.registerChangelogNotes = exports.buildChangelogNotes = void 0;
17
17
  const github_1 = require("../changelog-notes/github");
18
18
  const default_1 = require("../changelog-notes/default");
19
+ const errors_1 = require("../errors");
19
20
  const changelogNotesFactories = {
20
21
  github: options => new github_1.GitHubChangelogNotes(options.github),
21
22
  default: options => new default_1.DefaultChangelogNotes(options),
@@ -25,7 +26,7 @@ function buildChangelogNotes(options) {
25
26
  if (builder) {
26
27
  return builder(options);
27
28
  }
28
- throw new Error(`Unknown changelog type: ${options.type}`);
29
+ throw new errors_1.ConfigurationError(`Unknown changelog type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
29
30
  }
30
31
  exports.buildChangelogNotes = buildChangelogNotes;
31
32
  function registerChangelogNotes(name, changelogNotesBuilder) {
@@ -18,6 +18,7 @@ const linked_versions_1 = require("../plugins/linked-versions");
18
18
  const cargo_workspace_1 = require("../plugins/cargo-workspace");
19
19
  const node_workspace_1 = require("../plugins/node-workspace");
20
20
  const maven_workspace_1 = require("../plugins/maven-workspace");
21
+ const errors_1 = require("../errors");
21
22
  const pluginFactories = {
22
23
  'linked-versions': options => new linked_versions_1.LinkedVersions(options.github, options.targetBranch, options.repositoryConfig, options.type.groupName, options.type.components),
23
24
  'cargo-workspace': options => new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, options),
@@ -30,14 +31,14 @@ function buildPlugin(options) {
30
31
  if (builder) {
31
32
  return builder(options);
32
33
  }
33
- throw new Error(`Unknown plugin type: ${options.type.type}`);
34
+ throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
34
35
  }
35
36
  else {
36
37
  const builder = pluginFactories[options.type];
37
38
  if (builder) {
38
39
  return builder(options);
39
40
  }
40
- throw new Error(`Unknown plugin type: ${options.type}`);
41
+ throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
41
42
  }
42
43
  }
43
44
  exports.buildPlugin = buildPlugin;
@@ -1,9 +1,11 @@
1
1
  import { VersioningStrategy } from '../versioning-strategy';
2
+ import { GitHub } from '../github';
2
3
  export declare type VersioningStrategyType = string;
3
4
  export interface VersioningStrategyFactoryOptions {
4
5
  type?: VersioningStrategyType;
5
6
  bumpMinorPreMajor?: boolean;
6
7
  bumpPatchForMinorPreMajor?: boolean;
8
+ github: GitHub;
7
9
  }
8
10
  export declare type VersioningStrategyBuilder = (options: VersioningStrategyFactoryOptions) => VersioningStrategy;
9
11
  export declare function buildVersioningStrategy(options: VersioningStrategyFactoryOptions): VersioningStrategy;
@@ -17,6 +17,7 @@ exports.getVersioningStrategyTypes = exports.unregisterVersioningStrategy = expo
17
17
  const default_1 = require("../versioning-strategies/default");
18
18
  const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
19
19
  const service_pack_1 = require("../versioning-strategies/service-pack");
20
+ const errors_1 = require("../errors");
20
21
  const versioningTypes = {
21
22
  default: options => new default_1.DefaultVersioningStrategy(options),
22
23
  'always-bump-patch': options => new always_bump_patch_1.AlwaysBumpPatch(options),
@@ -27,7 +28,7 @@ function buildVersioningStrategy(options) {
27
28
  if (builder) {
28
29
  return builder(options);
29
30
  }
30
- throw new Error(`Unknown versioning strategy type: ${options.type}`);
31
+ throw new errors_1.ConfigurationError(`Unknown versioning strategy type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
31
32
  }
32
33
  exports.buildVersioningStrategy = buildVersioningStrategy;
33
34
  function registerVersioningStrategy(name, versioningStrategyBuilder) {
@@ -53,6 +53,7 @@ const java_1 = require("./strategies/java");
53
53
  const maven_1 = require("./strategies/maven");
54
54
  const versioning_strategy_factory_1 = require("./factories/versioning-strategy-factory");
55
55
  const changelog_notes_factory_1 = require("./factories/changelog-notes-factory");
56
+ const errors_1 = require("./errors");
56
57
  __exportStar(require("./factories/changelog-notes-factory"), exports);
57
58
  __exportStar(require("./factories/plugin-factory"), exports);
58
59
  __exportStar(require("./factories/versioning-strategy-factory"), exports);
@@ -97,6 +98,7 @@ async function buildStrategy(options) {
97
98
  var _a;
98
99
  const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
99
100
  const versioningStrategy = (0, versioning_strategy_factory_1.buildVersioningStrategy)({
101
+ github: options.github,
100
102
  type: options.versioning,
101
103
  bumpMinorPreMajor: options.bumpMinorPreMajor,
102
104
  bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
@@ -117,7 +119,7 @@ async function buildStrategy(options) {
117
119
  if (builder) {
118
120
  return builder(strategyOptions);
119
121
  }
120
- throw new Error(`Unknown release type: ${options.releaseType}`);
122
+ throw new errors_1.ConfigurationError(`Unknown release type: ${options.releaseType}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
121
123
  }
122
124
  exports.buildStrategy = buildStrategy;
123
125
  function registerReleaseType(name, strategyBuilder) {
@@ -789,6 +789,9 @@ async function fetchManifestConfig(github, configFile, branch) {
789
789
  if (e instanceof errors_1.FileNotFoundError) {
790
790
  throw new errors_1.ConfigurationError(`Missing required manifest config: ${configFile}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
791
791
  }
792
+ else if (e instanceof SyntaxError) {
793
+ throw new errors_1.ConfigurationError(`Failed to parse manifest config JSON: ${configFile}\n${e.message}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
794
+ }
792
795
  throw e;
793
796
  }
794
797
  }
@@ -824,6 +827,9 @@ async function fetchReleasedVersions(github, manifestFile, branch) {
824
827
  if (e instanceof errors_1.FileNotFoundError) {
825
828
  throw new errors_1.ConfigurationError(`Missing required manifest versions: ${manifestFile}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
826
829
  }
830
+ else if (e instanceof SyntaxError) {
831
+ throw new errors_1.ConfigurationError(`Failed to parse manifest versions JSON: ${manifestFile}\n${e.message}`, 'base', `${github.repository.owner}/${github.repository.repo}`);
832
+ }
827
833
  throw e;
828
834
  }
829
835
  }
@@ -20,13 +20,29 @@ 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
22
  const path_1 = require("path");
23
+ const CHANGELOG_SECTIONS = [
24
+ { type: 'feat', section: 'Features' },
25
+ { type: 'fix', section: 'Bug Fixes' },
26
+ { type: 'perf', section: 'Performance Improvements' },
27
+ { type: 'revert', section: 'Reverts' },
28
+ { type: 'docs', section: 'Documentation' },
29
+ { type: 'style', section: 'Styles', hidden: true },
30
+ { type: 'chore', section: 'Miscellaneous Chores', hidden: true },
31
+ { type: 'refactor', section: 'Code Refactoring', hidden: true },
32
+ { type: 'test', section: 'Tests', hidden: true },
33
+ { type: 'build', section: 'Build System', hidden: true },
34
+ { type: 'ci', section: 'Continuous Integration', hidden: true },
35
+ ];
23
36
  const REGEN_PR_REGEX = /.*auto-regenerate.*/;
24
37
  const REGEN_ISSUE_REGEX = /(?<prefix>.*)\(#(?<pr>.*)\)(\n|$)/;
25
38
  class GoYoshi extends base_1.BaseStrategy {
26
39
  constructor(options) {
27
40
  var _a;
28
41
  options.changelogPath = (_a = options.changelogPath) !== null && _a !== void 0 ? _a : 'CHANGES.md';
29
- super(options);
42
+ super({
43
+ ...options,
44
+ changelogSections: CHANGELOG_SECTIONS,
45
+ });
30
46
  }
31
47
  async buildUpdates(options) {
32
48
  const updates = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "13.18.1",
3
+ "version": "13.18.4",
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",
@@ -43,10 +43,10 @@
43
43
  "@types/iarna__toml": "^2.0.1",
44
44
  "@types/js-yaml": "^4.0.0",
45
45
  "@types/jsonpath": "^0.2.0",
46
- "@types/lerna__collect-updates": "^4.0.0",
47
- "@types/lerna__package": "^4.0.2",
48
- "@types/lerna__package-graph": "^4.0.1",
49
- "@types/lerna__run-topologically": "^4.0.0",
46
+ "@types/lerna__collect-updates": "^5.0.0",
47
+ "@types/lerna__package": "^5.0.0",
48
+ "@types/lerna__package-graph": "^5.0.0",
49
+ "@types/lerna__run-topologically": "^5.0.0",
50
50
  "@types/mocha": "^9.0.0",
51
51
  "@types/node": "^16.0.0",
52
52
  "@types/pino": "^7.0.0",