release-please 12.4.0 → 12.6.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [12.6.2](https://www.github.com/googleapis/release-please/compare/v12.6.1...v12.6.2) (2021-12-21)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **release:** ensure release-backed tokens work on branch ([#1155](https://www.github.com/googleapis/release-please/issues/1155)) ([9849f93](https://www.github.com/googleapis/release-please/commit/9849f930f2137aa41b54b54d5d6a6faa2a9fe8ee))
13
+
14
+ ### [12.6.1](https://www.github.com/googleapis/release-please/compare/v12.6.0...v12.6.1) (2021-12-21)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **rust:** Don't update dev-dependencies lacking a version key ([#1095](https://www.github.com/googleapis/release-please/issues/1095)) ([dc1bad9](https://www.github.com/googleapis/release-please/commit/dc1bad997ef0d028e280e75b0e6510a99d06cb44))
20
+
21
+ ## [12.6.0](https://www.github.com/googleapis/release-please/compare/v12.5.0...v12.6.0) (2021-10-11)
22
+
23
+
24
+ ### Features
25
+
26
+ * add GraphQL URL option for Github ([#1083](https://www.github.com/googleapis/release-please/issues/1083)) ([ec661e2](https://www.github.com/googleapis/release-please/commit/ec661e22c7f5fa80e26d32d4cf0d93a4a90af4be)), closes [#1082](https://www.github.com/googleapis/release-please/issues/1082)
27
+
28
+ ## [12.5.0](https://www.github.com/googleapis/release-please/compare/v12.4.0...v12.5.0) (2021-09-29)
29
+
30
+
31
+ ### Features
32
+
33
+ * add java-backport releaser ([#1074](https://www.github.com/googleapis/release-please/issues/1074)) ([e98b165](https://www.github.com/googleapis/release-please/commit/e98b16549be4ee688660eb2337be6b0ed2f0a4cd))
34
+
7
35
  ## [12.4.0](https://www.github.com/googleapis/release-please/compare/v12.3.0...v12.4.0) (2021-09-29)
8
36
 
9
37
 
package/README.md CHANGED
@@ -218,6 +218,8 @@ release-please release-pr --package-name=@google-cloud/firestore" \
218
218
  | `--monorepo-tags` | add prefix to tags and branches, allowing multiple libraries to be released from the same repository. |
219
219
  | `--pull-request-title-pattern` | add title pattern to make release PR, defaults to using `chore${scope}: release${component} ${version}`. |
220
220
  | `--signoff` | Add [`Signed-off-by`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff) line at the end of the commit log message using the user and email provided. (format "Name \<email@example.com\>") |
221
+ | `--api-url` | URL to use when making API requests [default: "https://api.github.com"] |
222
+ | `--graphql-url` | URL to use when making GraphQL requests [default: "https://api.github.com"] |
221
223
 
222
224
  ### Creating a release on GitHub
223
225
 
@@ -232,6 +234,8 @@ release-please github-release --repo-url=googleapis/nodejs-firestore \
232
234
  | `--repo-url` | is the URL of the repository on GitHub. |
233
235
  | `--token` | a token with write access to `--repo-url`. |
234
236
  | `--path` | create a release from a path other than the repository's root |
237
+ | `--api-url` | URL to use when making API requests [default: "https://api.github.com"] |
238
+ | `--graphql-url` | URL to use when making GraphQL requests [default: "https://api.github.com"] |
235
239
 
236
240
  ### Running as a GitHub App
237
241
 
@@ -13,6 +13,8 @@ export declare const parser: yargs.Argv<yargs.Omit<yargs.Omit<GitHubReleaseFacto
13
13
  token: unknown;
14
14
  } & {
15
15
  "api-url": string;
16
+ } & {
17
+ "graphql-url": string;
16
18
  } & {
17
19
  "default-branch": string | undefined;
18
20
  }, "fork"> & {
@@ -175,6 +175,8 @@ exports.parser = yargs
175
175
  argv.token = coerce_option_1.coerceOption(argv.token);
176
176
  if (argv.apiUrl)
177
177
  argv.apiUrl = coerce_option_1.coerceOption(argv.apiUrl);
178
+ if (argv.graphqlUrl)
179
+ argv.graphqlUrl = coerce_option_1.coerceOption(argv.graphqlUrl);
178
180
  })
179
181
  .option('debug', {
180
182
  describe: 'print verbose errors (use only for local debugging).',
@@ -187,6 +189,11 @@ exports.parser = yargs
187
189
  describe: 'URL to use when making API requests',
188
190
  default: constants_1.GH_API_URL,
189
191
  type: 'string',
192
+ })
193
+ .option('graphql-url', {
194
+ describe: 'URL to use when making GraphQL requests',
195
+ default: constants_1.GH_GRAPHQL_URL,
196
+ type: 'string',
190
197
  })
191
198
  .option('default-branch', {
192
199
  describe: 'The branch to open release PRs against and tag releases on',
@@ -1,5 +1,6 @@
1
1
  export declare const DEFAULT_LABELS: string[];
2
2
  export declare const GH_API_URL = "https://api.github.com";
3
+ export declare const GH_GRAPHQL_URL = "https://api.github.com";
3
4
  export declare const RELEASE_PLEASE = "release-please";
4
5
  export declare const RELEASE_PLEASE_CONFIG: string;
5
6
  export declare const RELEASE_PLEASE_MANIFEST: string;
@@ -13,9 +13,10 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.MAX_ISSUE_BODY_SIZE = exports.RELEASE_PLEASE_MANIFEST = exports.RELEASE_PLEASE_CONFIG = exports.RELEASE_PLEASE = exports.GH_API_URL = exports.DEFAULT_LABELS = void 0;
16
+ exports.MAX_ISSUE_BODY_SIZE = exports.RELEASE_PLEASE_MANIFEST = exports.RELEASE_PLEASE_CONFIG = exports.RELEASE_PLEASE = exports.GH_GRAPHQL_URL = exports.GH_API_URL = exports.DEFAULT_LABELS = void 0;
17
17
  exports.DEFAULT_LABELS = ['autorelease: pending'];
18
18
  exports.GH_API_URL = 'https://api.github.com';
19
+ exports.GH_GRAPHQL_URL = 'https://api.github.com';
19
20
  exports.RELEASE_PLEASE = 'release-please';
20
21
  exports.RELEASE_PLEASE_CONFIG = `${exports.RELEASE_PLEASE}-config.json`;
21
22
  exports.RELEASE_PLEASE_MANIFEST = `.${exports.RELEASE_PLEASE}-manifest.json`;
@@ -97,7 +97,7 @@ function getLabels(label) {
97
97
  return label ? label.split(',') : constants_1.DEFAULT_LABELS;
98
98
  }
99
99
  function getGitHubFactoryOpts(options) {
100
- const { repoUrl, defaultBranch, fork, token, apiUrl, octokitAPIs, ...remaining } = options;
100
+ const { repoUrl, defaultBranch, fork, token, apiUrl, graphqlUrl, octokitAPIs, ...remaining } = options;
101
101
  return [
102
102
  {
103
103
  repoUrl,
@@ -105,6 +105,7 @@ function getGitHubFactoryOpts(options) {
105
105
  fork,
106
106
  token,
107
107
  apiUrl,
108
+ graphqlUrl,
108
109
  octokitAPIs,
109
110
  },
110
111
  remaining,
@@ -98,6 +98,7 @@ export declare class GitHub {
98
98
  owner: string;
99
99
  repo: string;
100
100
  apiUrl: string;
101
+ graphqlUrl: string;
101
102
  fork: boolean;
102
103
  repositoryDefaultBranch?: string;
103
104
  constructor(options: GitHubConstructorOptions);
@@ -538,7 +538,7 @@ class GitHub {
538
538
  * @throws {GitHubAPIError} on an API error
539
539
  */
540
540
  this.commentOnIssue = wrapAsync(async (comment, number) => {
541
- logger_1.logger.info(`adding comment to https://github.com/${this.owner}/${this.repo}/issue/${number}`);
541
+ logger_1.logger.info(`adding comment to https://github.com/${this.owner}/${this.repo}/issues/${number}`);
542
542
  return (await this.request('POST /repos/:owner/:repo/issues/:issue_number/comments', {
543
543
  owner: this.owner,
544
544
  repo: this.repo,
@@ -552,6 +552,7 @@ class GitHub {
552
552
  this.repo = options.repo;
553
553
  this.fork = !!options.fork;
554
554
  this.apiUrl = options.apiUrl || constants_1.GH_API_URL;
555
+ this.graphqlUrl = options.graphqlUrl || constants_1.GH_GRAPHQL_URL;
555
556
  if (options.octokitAPIs === undefined) {
556
557
  this.octokit = new rest_1.Octokit({
557
558
  baseUrl: options.apiUrl,
@@ -580,7 +581,7 @@ class GitHub {
580
581
  let opts = Object.assign({}, _opts);
581
582
  if (!probotMode) {
582
583
  opts = Object.assign(opts, {
583
- url: `${this.apiUrl}/graphql`,
584
+ url: `${this.graphqlUrl}/graphql`,
584
585
  headers: {
585
586
  authorization: `token ${this.token}`,
586
587
  'content-type': 'application/vnd.github.v3+json',
@@ -11,6 +11,7 @@ interface GitHubOptions {
11
11
  fork?: boolean;
12
12
  token?: string;
13
13
  apiUrl?: string;
14
+ graphqlUrl?: string;
14
15
  octokitAPIs?: OctokitAPIs;
15
16
  }
16
17
  export interface GitHubReleaseOptions {
@@ -1,5 +1,5 @@
1
1
  import { ReleasePR } from '../release-pr';
2
- export declare type ReleaseType = 'go' | 'go-yoshi' | 'java-bom' | 'java-lts' | 'java-yoshi' | 'krm-blueprint' | 'node' | 'ocaml' | 'php' | 'php-yoshi' | 'python' | 'ruby' | 'ruby-yoshi' | 'rust' | 'simple' | 'terraform-module' | 'helm' | 'elixir' | 'dart';
2
+ export declare type ReleaseType = 'go' | 'go-yoshi' | 'java-backport' | 'java-bom' | 'java-lts' | 'java-yoshi' | 'krm-blueprint' | 'node' | 'ocaml' | 'php' | 'php-yoshi' | 'python' | 'ruby' | 'ruby-yoshi' | 'rust' | 'simple' | 'terraform-module' | 'helm' | 'elixir' | 'dart';
3
3
  declare type Releasers = Record<ReleaseType, typeof ReleasePR>;
4
4
  export declare function getReleasers(): Releasers;
5
5
  export declare function getReleaserNames(): string[];
@@ -32,10 +32,12 @@ const rust_1 = require("./rust");
32
32
  const ocaml_1 = require("./ocaml");
33
33
  const helm_1 = require("./helm");
34
34
  const elixir_1 = require("./elixir");
35
+ const java_backport_1 = require("./java-backport");
35
36
  const dart_1 = require("./dart");
36
37
  const releasers = {
37
38
  go: go_1.Go,
38
39
  'go-yoshi': go_yoshi_1.GoYoshi,
40
+ 'java-backport': java_backport_1.JavaBackport,
39
41
  'java-bom': java_bom_1.JavaBom,
40
42
  'java-lts': java_lts_1.JavaLTS,
41
43
  'java-yoshi': java_yoshi_1.JavaYoshi,
@@ -0,0 +1,9 @@
1
+ import { ReleaseCandidate } from '../release-pr';
2
+ import { ConventionalCommits } from '../conventional-commits';
3
+ import { GitHubTag } from '../github';
4
+ import { VersionsMap } from '../updaters/update';
5
+ import { JavaYoshi } from './java-yoshi';
6
+ export declare class JavaBackport extends JavaYoshi {
7
+ protected coerceVersions(_cc: ConventionalCommits, _candidate: ReleaseCandidate, _latestTag: GitHubTag | undefined, currentVersions: VersionsMap): Promise<VersionsMap>;
8
+ protected coerceReleaseCandidate(cc: ConventionalCommits, latestTag: GitHubTag | undefined, _preRelease?: boolean): Promise<ReleaseCandidate>;
9
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ // Copyright 2021 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.JavaBackport = void 0;
17
+ // Java
18
+ const version_1 = require("./java/version");
19
+ const java_yoshi_1 = require("./java-yoshi");
20
+ // This release strategy always bumps the patch version
21
+ class JavaBackport extends java_yoshi_1.JavaYoshi {
22
+ async coerceVersions(_cc, _candidate, _latestTag, currentVersions) {
23
+ const bumpType = this.snapshot ? 'snapshot' : 'patch';
24
+ const newVersions = new Map();
25
+ for (const [k, version] of currentVersions) {
26
+ newVersions.set(k, version_1.Version.parse(version).bump(bumpType).toString());
27
+ }
28
+ return newVersions;
29
+ }
30
+ async coerceReleaseCandidate(cc, latestTag, _preRelease = false) {
31
+ var _a;
32
+ const bumpType = this.snapshot ? 'snapshot' : 'patch';
33
+ const version = version_1.Version.parse((_a = latestTag === null || latestTag === void 0 ? void 0 : latestTag.version) !== null && _a !== void 0 ? _a : this.defaultInitialVersion())
34
+ .bump(bumpType)
35
+ .toString();
36
+ return {
37
+ previousTag: latestTag === null || latestTag === void 0 ? void 0 : latestTag.version,
38
+ version,
39
+ };
40
+ }
41
+ }
42
+ exports.JavaBackport = JavaBackport;
43
+ //# sourceMappingURL=java-backport.js.map
@@ -57,7 +57,11 @@ class CargoToml {
57
57
  }
58
58
  const dep = deps[pkgName];
59
59
  if (typeof dep === 'string' || typeof dep.path === 'undefined') {
60
- logger_1.logger.info(`skipping ${depKind}.${pkgName} in ${this.path}`);
60
+ logger_1.logger.info(`skipping ${depKind}.${pkgName} in ${this.path} (no path set)`);
61
+ continue; // to next depKind
62
+ }
63
+ if (typeof dep.version === 'undefined') {
64
+ logger_1.logger.info(`skipping ${depKind}.${pkgName} in ${this.path} (no version set)`);
61
65
  continue; // to next depKind
62
66
  }
63
67
  logger_1.logger.info(`updating ${this.path} ${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "12.4.0",
3
+ "version": "12.6.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",
7
7
  "scripts": {
8
8
  "test": "cross-env ENVIRONMENT=test c8 mocha --recursive --timeout=5000 build/test",
9
- "docs-test": "echo add docs tests",
9
+ "docs": "echo add docs tests",
10
10
  "test:snap": "SNAPSHOT_UPDATE=1 npm test",
11
11
  "clean": "gts clean",
12
12
  "prepare": "npm run compile",
@@ -42,7 +42,7 @@
42
42
  "@types/iarna__toml": "^2.0.1",
43
43
  "@types/js-yaml": "^4.0.0",
44
44
  "@types/mocha": "^8.0.0",
45
- "@types/node": "^14.0.0",
45
+ "@types/node": "^16.0.0",
46
46
  "@types/pino": "^6.3.0",
47
47
  "@types/semver": "^7.0.0",
48
48
  "@types/sinon": "^10.0.0",