release-please 14.16.0 → 14.17.1

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,23 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.17.1](https://github.com/googleapis/release-please/compare/v14.17.0...v14.17.1) (2022-11-22)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **dart:** Throw MissingRequiredFileError if pubspec.yaml is missing ([#1756](https://github.com/googleapis/release-please/issues/1756)) ([ada9fd6](https://github.com/googleapis/release-please/commit/ada9fd6db42aa6db0db52b8a81aa7f70b064e914))
13
+ * **helm:** throw MissingRequiredFileError if Chart.yaml is missing ([ada9fd6](https://github.com/googleapis/release-please/commit/ada9fd6db42aa6db0db52b8a81aa7f70b064e914))
14
+ * **node-workspace:** Maintain the dependency version prefix in newCandidate ([#1748](https://github.com/googleapis/release-please/issues/1748)) ([909d310](https://github.com/googleapis/release-please/commit/909d310defdf24adfd4858bbe1604668c14ef77f))
15
+
16
+ ## [14.17.0](https://github.com/googleapis/release-please/compare/v14.16.0...v14.17.0) (2022-11-11)
17
+
18
+
19
+ ### Features
20
+
21
+ * add always-bump-major versioning strategy ([7526ca8](https://github.com/googleapis/release-please/commit/7526ca8be4fec4d785b44bfb8c8c70078ad7fc73))
22
+ * Add always-bump-minor versioning strategy ([#1744](https://github.com/googleapis/release-please/issues/1744)) ([7526ca8](https://github.com/googleapis/release-please/commit/7526ca8be4fec4d785b44bfb8c8c70078ad7fc73))
23
+
7
24
  ## [14.16.0](https://github.com/googleapis/release-please/compare/v14.15.3...v14.16.0) (2022-11-03)
8
25
 
9
26
 
package/README.md CHANGED
@@ -219,6 +219,10 @@ Contributions welcome! See the [Contributing Guide](https://github.com/googleapi
219
219
 
220
220
  For more information on the design of the library, see [design](https://github.com/googleapis/release-please/blob/main/docs/design.md).
221
221
 
222
+ ## Troubleshooting
223
+
224
+ For common issues and help troubleshooting your configuration, see [Troubleshooting](https://github.com/googleapis/release-please/blob/main/docs/troubleshooting.md).
225
+
222
226
  ## License
223
227
 
224
228
  Apache Version 2.0
@@ -1,6 +1,6 @@
1
1
  import { GitHub } from '../github';
2
2
  import { ChangelogNotes, ChangelogSection } from '../changelog-notes';
3
- export declare type ChangelogNotesType = string;
3
+ export type ChangelogNotesType = string;
4
4
  export interface ChangelogNotesFactoryOptions {
5
5
  type: ChangelogNotesType;
6
6
  github: GitHub;
@@ -9,7 +9,7 @@ export interface ChangelogNotesFactoryOptions {
9
9
  headerPartial?: string;
10
10
  mainTemplate?: string;
11
11
  }
12
- export declare type ChangelogNotesBuilder = (options: ChangelogNotesFactoryOptions) => ChangelogNotes;
12
+ export type ChangelogNotesBuilder = (options: ChangelogNotesFactoryOptions) => ChangelogNotes;
13
13
  export declare function buildChangelogNotes(options: ChangelogNotesFactoryOptions): ChangelogNotes;
14
14
  export declare function registerChangelogNotes(name: string, changelogNotesBuilder: ChangelogNotesBuilder): void;
15
15
  export declare function unregisterChangelogNotes(name: string): void;
@@ -14,7 +14,7 @@ export interface PluginFactoryOptions {
14
14
  considerAllArtifacts?: boolean;
15
15
  logger?: Logger;
16
16
  }
17
- export declare type PluginBuilder = (options: PluginFactoryOptions) => ManifestPlugin;
17
+ export type PluginBuilder = (options: PluginFactoryOptions) => ManifestPlugin;
18
18
  export declare function buildPlugin(options: PluginFactoryOptions): ManifestPlugin;
19
19
  export declare function registerPlugin(name: string, pluginBuilder: PluginBuilder): void;
20
20
  export declare function unregisterPlugin(name: string): void;
@@ -1,13 +1,13 @@
1
1
  import { VersioningStrategy } from '../versioning-strategy';
2
2
  import { GitHub } from '../github';
3
- export declare type VersioningStrategyType = string;
3
+ export type VersioningStrategyType = string;
4
4
  export interface VersioningStrategyFactoryOptions {
5
5
  type?: VersioningStrategyType;
6
6
  bumpMinorPreMajor?: boolean;
7
7
  bumpPatchForMinorPreMajor?: boolean;
8
8
  github: GitHub;
9
9
  }
10
- export declare type VersioningStrategyBuilder = (options: VersioningStrategyFactoryOptions) => VersioningStrategy;
10
+ export type VersioningStrategyBuilder = (options: VersioningStrategyFactoryOptions) => VersioningStrategy;
11
11
  export declare function buildVersioningStrategy(options: VersioningStrategyFactoryOptions): VersioningStrategy;
12
12
  export declare function registerVersioningStrategy(name: string, versioningStrategyBuilder: VersioningStrategyBuilder): void;
13
13
  export declare function unregisterVersioningStrategy(name: string): void;
@@ -16,11 +16,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.getVersioningStrategyTypes = exports.unregisterVersioningStrategy = exports.registerVersioningStrategy = exports.buildVersioningStrategy = void 0;
17
17
  const default_1 = require("../versioning-strategies/default");
18
18
  const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
19
+ const always_bump_minor_1 = require("../versioning-strategies/always-bump-minor");
20
+ const always_bump_major_1 = require("../versioning-strategies/always-bump-major");
19
21
  const service_pack_1 = require("../versioning-strategies/service-pack");
20
22
  const errors_1 = require("../errors");
21
23
  const versioningTypes = {
22
24
  default: options => new default_1.DefaultVersioningStrategy(options),
23
25
  'always-bump-patch': options => new always_bump_patch_1.AlwaysBumpPatch(options),
26
+ 'always-bump-minor': options => new always_bump_minor_1.AlwaysBumpMinor(options),
27
+ 'always-bump-major': options => new always_bump_major_1.AlwaysBumpMajor(options),
24
28
  'service-pack': options => new service_pack_1.ServicePackVersioningStrategy(options),
25
29
  };
26
30
  function buildVersioningStrategy(options) {
@@ -5,8 +5,8 @@ import { BaseStrategyOptions } from './strategies/base';
5
5
  export * from './factories/changelog-notes-factory';
6
6
  export * from './factories/plugin-factory';
7
7
  export * from './factories/versioning-strategy-factory';
8
- export declare type ReleaseType = string;
9
- export declare type ReleaseBuilder = (options: BaseStrategyOptions) => Strategy;
8
+ export type ReleaseType = string;
9
+ export type ReleaseBuilder = (options: BaseStrategyOptions) => Strategy;
10
10
  export interface StrategyFactoryOptions extends ReleaserConfig {
11
11
  github: GitHub;
12
12
  path?: string;
@@ -4,7 +4,7 @@ import { Octokit } from '@octokit/rest';
4
4
  import { request } from '@octokit/request';
5
5
  export declare const GH_API_URL = "https://api.github.com";
6
6
  export declare const GH_GRAPHQL_URL = "https://api.github.com";
7
- declare type OctokitType = InstanceType<typeof Octokit>;
7
+ type OctokitType = InstanceType<typeof Octokit>;
8
8
  import { Repository } from './repository';
9
9
  import { ReleasePullRequest } from './release-pull-request';
10
10
  import { Update } from './update';
@@ -12,9 +12,9 @@ import { Release } from './release';
12
12
  import { GitHubFileContents } from '@google-automations/git-file-utils';
13
13
  import { Logger } from 'code-suggester/build/src/types';
14
14
  import { PullRequestOverflowHandler } from './util/pull-request-overflow-handler';
15
- declare type RequestBuilderType = typeof request;
16
- declare type DefaultFunctionType = RequestBuilderType['defaults'];
17
- declare type RequestFunctionType = ReturnType<DefaultFunctionType>;
15
+ type RequestBuilderType = typeof request;
16
+ type DefaultFunctionType = RequestBuilderType['defaults'];
17
+ type RequestFunctionType = ReturnType<DefaultFunctionType>;
18
18
  export interface OctokitAPIs {
19
19
  graphql: Function;
20
20
  request: RequestFunctionType;
@@ -40,7 +40,7 @@ interface GitHubCreateOptions {
40
40
  logger?: Logger;
41
41
  proxy?: ProxyOption;
42
42
  }
43
- declare type CommitFilter = (commit: Commit) => boolean;
43
+ type CommitFilter = (commit: Commit) => boolean;
44
44
  interface CommitIteratorOptions {
45
45
  maxResults?: number;
46
46
  backfillFiles?: boolean;
@@ -74,7 +74,7 @@ interface FileDiff {
74
74
  readonly content: string | null;
75
75
  readonly originalContent: string | null;
76
76
  }
77
- export declare type ChangeSet = Map<string, FileDiff>;
77
+ export type ChangeSet = Map<string, FileDiff>;
78
78
  interface CreatePullRequestOptions {
79
79
  fork?: boolean;
80
80
  draft?: boolean;
@@ -7,30 +7,30 @@ import { ReleasePullRequest } from './release-pull-request';
7
7
  import { ReleaseType, VersioningStrategyType, ChangelogNotesType } from './factory';
8
8
  import { Release } from './release';
9
9
  import { ManifestPlugin } from './plugin';
10
- declare type ExtraJsonFile = {
10
+ type ExtraJsonFile = {
11
11
  type: 'json';
12
12
  path: string;
13
13
  jsonpath: string;
14
14
  glob?: boolean;
15
15
  };
16
- declare type ExtraYamlFile = {
16
+ type ExtraYamlFile = {
17
17
  type: 'yaml';
18
18
  path: string;
19
19
  jsonpath: string;
20
20
  glob?: boolean;
21
21
  };
22
- declare type ExtraXmlFile = {
22
+ type ExtraXmlFile = {
23
23
  type: 'xml';
24
24
  path: string;
25
25
  xpath: string;
26
26
  glob?: boolean;
27
27
  };
28
- declare type ExtraPomFile = {
28
+ type ExtraPomFile = {
29
29
  type: 'pom';
30
30
  path: string;
31
31
  glob?: boolean;
32
32
  };
33
- export declare type ExtraFile = string | ExtraJsonFile | ExtraYamlFile | ExtraXmlFile | ExtraPomFile;
33
+ export type ExtraFile = string | ExtraJsonFile | ExtraYamlFile | ExtraXmlFile | ExtraPomFile;
34
34
  /**
35
35
  * These are configurations provided to each strategy per-path.
36
36
  */
@@ -131,7 +131,7 @@ export interface ReleaserPackageConfig extends ReleaserConfigJson {
131
131
  component?: string;
132
132
  'changelog-path'?: string;
133
133
  }
134
- export declare type DirectPluginType = string;
134
+ export type DirectPluginType = string;
135
135
  export interface ConfigurablePluginType {
136
136
  type: string;
137
137
  }
@@ -151,7 +151,7 @@ export interface WorkspacePluginConfig extends ConfigurablePluginType {
151
151
  export interface GroupPriorityPluginConfig extends ConfigurablePluginType {
152
152
  groups: string[];
153
153
  }
154
- export declare type PluginType = DirectPluginType | ConfigurablePluginType | GroupPriorityPluginConfig | LinkedVersionPluginConfig | SentenceCasePluginConfig | WorkspacePluginConfig;
154
+ export type PluginType = DirectPluginType | ConfigurablePluginType | GroupPriorityPluginConfig | LinkedVersionPluginConfig | SentenceCasePluginConfig | WorkspacePluginConfig;
155
155
  /**
156
156
  * This is the schema of the manifest config json
157
157
  */
@@ -166,8 +166,8 @@ export interface ManifestConfig extends ReleaserConfigJson {
166
166
  'commit-search-depth'?: number;
167
167
  'sequential-calls'?: boolean;
168
168
  }
169
- export declare type ReleasedVersions = Record<string, Version>;
170
- export declare type RepositoryConfig = Record<string, ReleaserConfig>;
169
+ export type ReleasedVersions = Record<string, Version>;
170
+ export type RepositoryConfig = Record<string, ReleaserConfig>;
171
171
  export declare const DEFAULT_RELEASE_PLEASE_CONFIG = "release-please-config.json";
172
172
  export declare const DEFAULT_RELEASE_PLEASE_MANIFEST = ".release-please-manifest.json";
173
173
  export declare const ROOT_PROJECT_PATH = ".";
@@ -149,7 +149,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
149
149
  return existingCandidate;
150
150
  }
151
151
  newCandidate(pkg, updatedVersions) {
152
- var _a;
152
+ var _a, _b;
153
153
  const graphPackage = (_a = this.packageGraph) === null || _a === void 0 ? void 0 : _a.get(pkg.name);
154
154
  if (!graphPackage) {
155
155
  throw new Error(`Could not find graph package for ${pkg.name}`);
@@ -164,8 +164,12 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
164
164
  for (const [depName, resolved] of graphPackage.localDependencies) {
165
165
  const depVersion = updatedVersions.get(depName);
166
166
  if (depVersion && resolved.type !== 'directory') {
167
- updatedPackage.updateLocalDependency(resolved, depVersion.toString(), '^');
168
- this.logger.info(`${pkg.name}.${depName} updated to ^${depVersion.toString()}`);
167
+ const currentVersion = (_b = this.combineDeps(pkg)) === null || _b === void 0 ? void 0 : _b[depName];
168
+ const prefix = currentVersion
169
+ ? this.detectRangePrefix(currentVersion)
170
+ : '';
171
+ updatedPackage.updateLocalDependency(resolved, depVersion.toString(), prefix);
172
+ this.logger.info(`${pkg.name}.${depName} updated to ${prefix}${depVersion.toString()}`);
169
173
  }
170
174
  }
171
175
  const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage);
@@ -3,7 +3,7 @@ import { CandidateReleasePullRequest, RepositoryConfig } from '../manifest';
3
3
  import { Logger } from '../util/logger';
4
4
  import { VersionsMap, Version } from '../version';
5
5
  import { GitHub } from '../github';
6
- export declare type DependencyGraph<T> = Map<string, DependencyNode<T>>;
6
+ export type DependencyGraph<T> = Map<string, DependencyNode<T>>;
7
7
  export interface DependencyNode<T> {
8
8
  deps: string[];
9
9
  value: T;
@@ -20,6 +20,7 @@ const yaml = require("js-yaml");
20
20
  // pubspec
21
21
  const pubspec_yaml_1 = require("../updaters/dart/pubspec-yaml");
22
22
  const base_1 = require("./base");
23
+ const errors_1 = require("../errors");
23
24
  class Dart extends base_1.BaseStrategy {
24
25
  async buildUpdates(options) {
25
26
  const updates = [];
@@ -54,7 +55,15 @@ class Dart extends base_1.BaseStrategy {
54
55
  }
55
56
  async getPubspecYmlContents() {
56
57
  if (!this.pubspecYmlContents) {
57
- this.pubspecYmlContents = await this.github.getFileContentsOnBranch(this.addPath('pubspec.yaml'), this.targetBranch);
58
+ try {
59
+ this.pubspecYmlContents = await this.github.getFileContentsOnBranch(this.addPath('pubspec.yaml'), this.targetBranch);
60
+ }
61
+ catch (e) {
62
+ if (e instanceof errors_1.FileNotFoundError) {
63
+ throw new errors_1.MissingRequiredFileError(this.addPath('pubspec.yaml'), Dart.name, `${this.repository.owner}/${this.repository.repo}`);
64
+ }
65
+ throw e;
66
+ }
58
67
  }
59
68
  return this.pubspecYmlContents;
60
69
  }
@@ -20,6 +20,7 @@ const yaml = require("js-yaml");
20
20
  // helm
21
21
  const chart_yaml_1 = require("../updaters/helm/chart-yaml");
22
22
  const base_1 = require("./base");
23
+ const errors_1 = require("../errors");
23
24
  class Helm extends base_1.BaseStrategy {
24
25
  async buildUpdates(options) {
25
26
  const updates = [];
@@ -54,7 +55,15 @@ class Helm extends base_1.BaseStrategy {
54
55
  }
55
56
  async getChartYmlContents() {
56
57
  if (!this.chartYmlContents) {
57
- this.chartYmlContents = await this.github.getFileContents(this.addPath('Chart.yaml'));
58
+ try {
59
+ this.chartYmlContents = await this.github.getFileContents(this.addPath('Chart.yaml'));
60
+ }
61
+ catch (e) {
62
+ if (e instanceof errors_1.FileNotFoundError) {
63
+ throw new errors_1.MissingRequiredFileError(this.addPath('Chart.yaml'), Helm.name, `${this.repository.owner}/${this.repository.repo}`);
64
+ }
65
+ throw e;
66
+ }
58
67
  }
59
68
  return this.chartYmlContents;
60
69
  }
@@ -34,7 +34,7 @@ export interface CargoDependency {
34
34
  path?: string;
35
35
  registry?: string;
36
36
  }
37
- export declare type DepKind = 'dependencies' | 'dev-dependencies' | 'build-dependencies';
37
+ export type DepKind = 'dependencies' | 'dev-dependencies' | 'build-dependencies';
38
38
  /**
39
39
  * All possible dependency kinds for `CargoManifest`,
40
40
  * typed properly.
@@ -31,7 +31,6 @@ function getAllResourceNames() {
31
31
  ];
32
32
  }
33
33
  class BranchName {
34
- constructor(_branchName) { }
35
34
  static parse(branchName, logger = logger_1.logger) {
36
35
  try {
37
36
  const branchNameClass = getAllResourceNames().find(clazz => {
@@ -59,6 +58,7 @@ class BranchName {
59
58
  static ofComponentTargetBranch(component, targetBranch) {
60
59
  return new ComponentBranchName(`${RELEASE_PLEASE}--branches--${targetBranch}--components--${component}`);
61
60
  }
61
+ constructor(_branchName) { }
62
62
  static matches(_branchName) {
63
63
  return false;
64
64
  }
@@ -31,4 +31,4 @@ export declare class Version {
31
31
  */
32
32
  toString(): string;
33
33
  }
34
- export declare type VersionsMap = Map<string, Version>;
34
+ export type VersionsMap = Map<string, Version>;
@@ -0,0 +1,10 @@
1
+ import { Version } from '../version';
2
+ import { ConventionalCommit } from '../commit';
3
+ import { DefaultVersioningStrategy } from './default';
4
+ import { VersionUpdater } from '../versioning-strategy';
5
+ /**
6
+ * This VersioningStrategy always bumps the major version.
7
+ */
8
+ export declare class AlwaysBumpMajor extends DefaultVersioningStrategy {
9
+ determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
10
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Copyright 2022 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AlwaysBumpMajor = void 0;
17
+ const default_1 = require("./default");
18
+ const versioning_strategy_1 = require("../versioning-strategy");
19
+ /**
20
+ * This VersioningStrategy always bumps the major version.
21
+ */
22
+ class AlwaysBumpMajor extends default_1.DefaultVersioningStrategy {
23
+ determineReleaseType(_version, _commits) {
24
+ return new versioning_strategy_1.MajorVersionUpdate();
25
+ }
26
+ }
27
+ exports.AlwaysBumpMajor = AlwaysBumpMajor;
28
+ //# sourceMappingURL=always-bump-major.js.map
@@ -0,0 +1,10 @@
1
+ import { Version } from '../version';
2
+ import { ConventionalCommit } from '../commit';
3
+ import { DefaultVersioningStrategy } from './default';
4
+ import { VersionUpdater } from '../versioning-strategy';
5
+ /**
6
+ * This VersioningStrategy always bumps the minor version.
7
+ */
8
+ export declare class AlwaysBumpMinor extends DefaultVersioningStrategy {
9
+ determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
10
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Copyright 2022 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AlwaysBumpMinor = void 0;
17
+ const default_1 = require("./default");
18
+ const versioning_strategy_1 = require("../versioning-strategy");
19
+ /**
20
+ * This VersioningStrategy always bumps the minor version.
21
+ */
22
+ class AlwaysBumpMinor extends default_1.DefaultVersioningStrategy {
23
+ determineReleaseType(_version, _commits) {
24
+ return new versioning_strategy_1.MinorVersionUpdate();
25
+ }
26
+ }
27
+ exports.AlwaysBumpMinor = AlwaysBumpMinor;
28
+ //# sourceMappingURL=always-bump-minor.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.16.0",
3
+ "version": "14.17.1",
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",
@@ -63,7 +63,7 @@
63
63
  "gts": "^3.1.0",
64
64
  "mocha": "^9.2.2",
65
65
  "nock": "^13.0.0",
66
- "sinon": "14.0.1",
66
+ "sinon": "14.0.2",
67
67
  "snap-shot-it": "^7.0.0"
68
68
  },
69
69
  "dependencies": {