release-please 12.5.0 → 12.6.3

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.3](https://www.github.com/googleapis/release-please/compare/v12.6.2...v12.6.3) (2021-12-22)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * GitHub#findFilesByExtension should treat prefix as a directory ([#1166](https://www.github.com/googleapis/release-please/issues/1166)) ([8329825](https://www.github.com/googleapis/release-please/commit/83298257a2021f88df4db3c95869955f8773eb70)), closes [#1164](https://www.github.com/googleapis/release-please/issues/1164)
13
+
14
+ ### [12.6.2](https://www.github.com/googleapis/release-please/compare/v12.6.1...v12.6.2) (2021-12-21)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **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))
20
+
21
+ ### [12.6.1](https://www.github.com/googleapis/release-please/compare/v12.6.0...v12.6.1) (2021-12-21)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **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))
27
+
28
+ ## [12.6.0](https://www.github.com/googleapis/release-please/compare/v12.5.0...v12.6.0) (2021-10-11)
29
+
30
+
31
+ ### Features
32
+
33
+ * 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)
34
+
7
35
  ## [12.5.0](https://www.github.com/googleapis/release-please/compare/v12.4.0...v12.5.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);
@@ -475,7 +475,7 @@ class GitHub {
475
475
  // match the filename
476
476
  path.endsWith(filename) &&
477
477
  // match the prefix if provided
478
- (!prefix || path.startsWith(prefix)));
478
+ (!prefix || path.startsWith(`${prefix}/`)));
479
479
  })
480
480
  .map(file => {
481
481
  let path = file.path;
@@ -518,7 +518,7 @@ class GitHub {
518
518
  // match the file extension
519
519
  path.endsWith(`.${extension}`) &&
520
520
  // match the prefix if provided
521
- (!prefix || path.startsWith(prefix)));
521
+ (!prefix || path.startsWith(`${prefix}/`)));
522
522
  })
523
523
  .map(file => {
524
524
  let path = file.path;
@@ -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 {
@@ -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.5.0",
3
+ "version": "12.6.3",
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",