release-please 14.6.0 → 14.7.0

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,25 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.7.0](https://github.com/googleapis/release-please/compare/v14.6.1...v14.7.0) (2022-09-20)
8
+
9
+
10
+ ### Features
11
+
12
+ * Easy proxy configuration ([#1639](https://github.com/googleapis/release-please/issues/1639)) ([4bb4c65](https://github.com/googleapis/release-please/commit/4bb4c658e3c30150432802b5ccc2aa5a96332f1e))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **commit-split:** Detect overlapping prefixes ([#1638](https://github.com/googleapis/release-please/issues/1638)) ([db51b29](https://github.com/googleapis/release-please/commit/db51b295d711e657ee5928bc32a3dbb88c793969)), closes [#1637](https://github.com/googleapis/release-please/issues/1637)
18
+
19
+ ## [14.6.1](https://github.com/googleapis/release-please/compare/v14.6.0...v14.6.1) (2022-09-20)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Detect uppercase readme.md files ([#1644](https://github.com/googleapis/release-please/issues/1644)) ([d3b68b2](https://github.com/googleapis/release-please/commit/d3b68b2afe622b0a9f83c77da33bfcf1bc4c77b4))
25
+
7
26
  ## [14.6.0](https://github.com/googleapis/release-please/compare/v14.5.0...v14.6.0) (2022-09-15)
8
27
 
9
28
 
@@ -24,6 +24,10 @@ export interface GitHubOptions {
24
24
  octokitAPIs: OctokitAPIs;
25
25
  logger?: Logger;
26
26
  }
27
+ interface ProxyOption {
28
+ host: string;
29
+ port: number;
30
+ }
27
31
  interface GitHubCreateOptions {
28
32
  owner: string;
29
33
  repo: string;
@@ -33,6 +37,7 @@ interface GitHubCreateOptions {
33
37
  octokitAPIs?: OctokitAPIs;
34
38
  token?: string;
35
39
  logger?: Logger;
40
+ proxy?: ProxyOption;
36
41
  }
37
42
  declare type CommitFilter = (commit: Commit) => boolean;
38
43
  interface CommitIteratorOptions {
@@ -76,6 +81,7 @@ export declare class GitHub {
76
81
  private fileCache;
77
82
  private logger;
78
83
  private constructor();
84
+ static createDefaultAgent(baseUrl: string, defaultProxy?: ProxyOption): import("https-proxy-agent/dist/agent").default | import("http-proxy-agent/dist/agent").default | undefined;
79
85
  /**
80
86
  * Build a new GitHub client with auto-detected default branch.
81
87
  *
@@ -28,6 +28,8 @@ const logger_1 = require("./util/logger");
28
28
  const manifest_1 = require("./manifest");
29
29
  const signoff_commit_message_1 = require("./util/signoff-commit-message");
30
30
  const git_file_utils_1 = require("@google-automations/git-file-utils");
31
+ const https_proxy_agent_1 = require("https-proxy-agent");
32
+ const http_proxy_agent_1 = require("http-proxy-agent");
31
33
  class GitHub {
32
34
  constructor(options) {
33
35
  var _a;
@@ -344,6 +346,21 @@ class GitHub {
344
346
  this.fileCache = new git_file_utils_1.RepositoryFileCache(this.octokit, this.repository);
345
347
  this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : logger_1.logger;
346
348
  }
349
+ static createDefaultAgent(baseUrl, defaultProxy) {
350
+ if (!defaultProxy) {
351
+ return undefined;
352
+ }
353
+ const { host, port } = defaultProxy;
354
+ return new URL(baseUrl).protocol.replace(':', '') === 'http'
355
+ ? new http_proxy_agent_1.HttpProxyAgent({
356
+ host,
357
+ port,
358
+ })
359
+ : new https_proxy_agent_1.HttpsProxyAgent({
360
+ host,
361
+ port,
362
+ });
363
+ }
347
364
  /**
348
365
  * Build a new GitHub client with auto-detected default branch.
349
366
  *
@@ -367,6 +384,9 @@ class GitHub {
367
384
  octokit: new rest_1.Octokit({
368
385
  baseUrl: apiUrl,
369
386
  auth: options.token,
387
+ request: {
388
+ agent: this.createDefaultAgent(apiUrl, options.proxy),
389
+ },
370
390
  }),
371
391
  request: request_1.request.defaults({
372
392
  baseUrl: apiUrl,
@@ -35,7 +35,12 @@ class TerraformModule extends base_1.BaseStrategy {
35
35
  });
36
36
  // Update version in README to current candidate version.
37
37
  // A module may have submodules, so find all submodules.
38
- const readmeFiles = await this.github.findFilesByFilenameAndRef('readme.md', this.targetBranch, this.path);
38
+ const readmeFiles = await Promise.all([
39
+ this.github.findFilesByFilenameAndRef('readme.md', this.targetBranch, this.path),
40
+ this.github.findFilesByFilenameAndRef('README.md', this.targetBranch, this.path),
41
+ ]).then(([v, vt]) => {
42
+ return v.concat(vt);
43
+ });
39
44
  readmeFiles.forEach(path => {
40
45
  updates.push({
41
46
  path: this.addPath(path),
@@ -44,7 +44,7 @@ class CommitSplit {
44
44
  for (let exPath of paths) {
45
45
  exPath = exPath.replace(/$/, '/');
46
46
  exPath = exPath.replace(/^/, '/');
47
- if (newPath.indexOf(exPath) >= 0 || exPath.indexOf(newPath) >= 0) {
47
+ if (newPath.startsWith(exPath) || exPath.startsWith(newPath)) {
48
48
  throw new Error(`Path prefixes must be unique: ${newPath}, ${exPath}`);
49
49
  }
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.6.0",
3
+ "version": "14.7.0",
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",
@@ -88,6 +88,8 @@
88
88
  "detect-indent": "^6.1.0",
89
89
  "diff": "^5.0.0",
90
90
  "figures": "^3.0.0",
91
+ "http-proxy-agent": "^5.0.0",
92
+ "https-proxy-agent": "^5.0.1",
91
93
  "js-yaml": "^4.0.0",
92
94
  "jsonpath": "^1.1.1",
93
95
  "node-html-parser": "^6.0.0",