diff --git a/dist/index.js b/dist/index.js index c4be90a..2721608 100644 --- a/dist/index.js +++ b/dist/index.js @@ -80208,7 +80208,7 @@ exports.getReleaserTypes = getReleaserTypes; // See the License for the specific language governing permissions and // limitations under the License. Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.GitHub = exports.GH_GRAPHQL_URL = exports.GH_API_URL = void 0; +exports.sleepInMs = exports.GitHub = exports.GH_GRAPHQL_URL = exports.GH_API_URL = void 0; const code_suggester_1 = __nccwpck_require__(77103); const rest_1 = __nccwpck_require__(55375); const request_1 = __nccwpck_require__(36234); @@ -80216,6 +80216,7 @@ const graphql_1 = __nccwpck_require__(88467); const request_error_1 = __nccwpck_require__(10537); const errors_1 = __nccwpck_require__(93637); const MAX_ISSUE_BODY_SIZE = 65536; +const MAX_SLEEP_SECONDS = 20; exports.GH_API_URL = 'https://api.github.com'; exports.GH_GRAPHQL_URL = 'https://api.github.com'; const logger_1 = __nccwpck_require__(68809); @@ -80253,7 +80254,9 @@ class GitHub { } return files; }); - this.graphqlRequest = wrapAsync(async (opts, maxRetries = 1) => { + this.graphqlRequest = wrapAsync(async (opts, options) => { + var _a; + let maxRetries = (_a = options === null || options === void 0 ? void 0 : options.maxRetries) !== null && _a !== void 0 ? _a : 5; let seconds = 1; while (maxRetries >= 0) { try { @@ -80267,13 +80270,17 @@ class GitHub { if (err.status !== 502) { throw err; } - logger_1.logger.trace('received 502 error, retrying'); + if (maxRetries === 0) { + logger_1.logger.warn('ran out of retries and response is required'); + throw err; + } + logger_1.logger.info(`received 502 error, ${maxRetries} attempts remaining`); } maxRetries -= 1; if (maxRetries >= 0) { logger_1.logger.trace(`sleeping ${seconds} seconds`); - await sleepInMs(1000 * seconds); - seconds *= 2; + await (0, exports.sleepInMs)(1000 * seconds); + seconds = Math.min(seconds * 2, MAX_SLEEP_SECONDS); } } logger_1.logger.trace('ran out of retries'); @@ -80882,7 +80889,7 @@ class GitHub { targetBranch, states, maxFilesChanged: 64, - }, 3); + }); if (!((_a = response === null || response === void 0 ? void 0 : response.repository) === null || _a === void 0 ? void 0 : _a.pullRequests)) { logger_1.logger.warn(`Could not find merged pull requests for branch ${targetBranch} - it likely does not exist.`); return null; @@ -81199,6 +81206,7 @@ const wrapAsync = (fn, errorHandler) => { }; }; const sleepInMs = (ms) => new Promise(resolve => setTimeout(resolve, ms)); +exports.sleepInMs = sleepInMs; //# sourceMappingURL=github.js.map /***/ }), @@ -81922,6 +81930,7 @@ function extractReleaserConfig(config) { releaseType: config['release-type'], bumpMinorPreMajor: config['bump-minor-pre-major'], bumpPatchForMinorPreMajor: config['bump-patch-for-minor-pre-major'], + versioning: config['versioning'], changelogSections: config['changelog-sections'], changelogPath: config['changelog-path'], changelogHost: config['changelog-host'], @@ -82076,7 +82085,9 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config, // only look at the last 250 or so commits to find the latest tag - we // don't want to scan the entire repository history if this repo has never // been released - const generator = github.mergeCommitIterator(targetBranch, { maxResults: 250 }); + const generator = github.mergeCommitIterator(targetBranch, { + maxResults: 250, + }); for await (const commitWithPullRequest of generator) { commitShas.add(commitWithPullRequest.sha); const mergedPullRequest = commitWithPullRequest.pullRequest; @@ -82147,29 +82158,30 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, config, return candidateTagVersion.sort((a, b) => b.compare(a))[0]; } function mergeReleaserConfig(defaultConfig, pathConfig) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y; return { releaseType: (_b = (_a = pathConfig.releaseType) !== null && _a !== void 0 ? _a : defaultConfig.releaseType) !== null && _b !== void 0 ? _b : 'node', bumpMinorPreMajor: (_c = pathConfig.bumpMinorPreMajor) !== null && _c !== void 0 ? _c : defaultConfig.bumpMinorPreMajor, bumpPatchForMinorPreMajor: (_d = pathConfig.bumpPatchForMinorPreMajor) !== null && _d !== void 0 ? _d : defaultConfig.bumpPatchForMinorPreMajor, - changelogSections: (_e = pathConfig.changelogSections) !== null && _e !== void 0 ? _e : defaultConfig.changelogSections, - changelogPath: (_f = pathConfig.changelogPath) !== null && _f !== void 0 ? _f : defaultConfig.changelogPath, - changelogHost: (_g = pathConfig.changelogHost) !== null && _g !== void 0 ? _g : defaultConfig.changelogHost, - changelogType: (_h = pathConfig.changelogType) !== null && _h !== void 0 ? _h : defaultConfig.changelogType, - releaseAs: (_j = pathConfig.releaseAs) !== null && _j !== void 0 ? _j : defaultConfig.releaseAs, - skipGithubRelease: (_k = pathConfig.skipGithubRelease) !== null && _k !== void 0 ? _k : defaultConfig.skipGithubRelease, - draft: (_l = pathConfig.draft) !== null && _l !== void 0 ? _l : defaultConfig.draft, - prerelease: (_m = pathConfig.prerelease) !== null && _m !== void 0 ? _m : defaultConfig.prerelease, - component: (_o = pathConfig.component) !== null && _o !== void 0 ? _o : defaultConfig.component, - packageName: (_p = pathConfig.packageName) !== null && _p !== void 0 ? _p : defaultConfig.packageName, - versionFile: (_q = pathConfig.versionFile) !== null && _q !== void 0 ? _q : defaultConfig.versionFile, - extraFiles: (_r = pathConfig.extraFiles) !== null && _r !== void 0 ? _r : defaultConfig.extraFiles, - includeComponentInTag: (_s = pathConfig.includeComponentInTag) !== null && _s !== void 0 ? _s : defaultConfig.includeComponentInTag, - includeVInTag: (_t = pathConfig.includeVInTag) !== null && _t !== void 0 ? _t : defaultConfig.includeVInTag, - tagSeparator: (_u = pathConfig.tagSeparator) !== null && _u !== void 0 ? _u : defaultConfig.tagSeparator, - pullRequestTitlePattern: (_v = pathConfig.pullRequestTitlePattern) !== null && _v !== void 0 ? _v : defaultConfig.pullRequestTitlePattern, - separatePullRequests: (_w = pathConfig.separatePullRequests) !== null && _w !== void 0 ? _w : defaultConfig.separatePullRequests, - skipSnapshot: (_x = pathConfig.skipSnapshot) !== null && _x !== void 0 ? _x : defaultConfig.skipSnapshot, + versioning: (_e = pathConfig.versioning) !== null && _e !== void 0 ? _e : defaultConfig.versioning, + changelogSections: (_f = pathConfig.changelogSections) !== null && _f !== void 0 ? _f : defaultConfig.changelogSections, + changelogPath: (_g = pathConfig.changelogPath) !== null && _g !== void 0 ? _g : defaultConfig.changelogPath, + changelogHost: (_h = pathConfig.changelogHost) !== null && _h !== void 0 ? _h : defaultConfig.changelogHost, + changelogType: (_j = pathConfig.changelogType) !== null && _j !== void 0 ? _j : defaultConfig.changelogType, + releaseAs: (_k = pathConfig.releaseAs) !== null && _k !== void 0 ? _k : defaultConfig.releaseAs, + skipGithubRelease: (_l = pathConfig.skipGithubRelease) !== null && _l !== void 0 ? _l : defaultConfig.skipGithubRelease, + draft: (_m = pathConfig.draft) !== null && _m !== void 0 ? _m : defaultConfig.draft, + prerelease: (_o = pathConfig.prerelease) !== null && _o !== void 0 ? _o : defaultConfig.prerelease, + component: (_p = pathConfig.component) !== null && _p !== void 0 ? _p : defaultConfig.component, + packageName: (_q = pathConfig.packageName) !== null && _q !== void 0 ? _q : defaultConfig.packageName, + versionFile: (_r = pathConfig.versionFile) !== null && _r !== void 0 ? _r : defaultConfig.versionFile, + extraFiles: (_s = pathConfig.extraFiles) !== null && _s !== void 0 ? _s : defaultConfig.extraFiles, + includeComponentInTag: (_t = pathConfig.includeComponentInTag) !== null && _t !== void 0 ? _t : defaultConfig.includeComponentInTag, + includeVInTag: (_u = pathConfig.includeVInTag) !== null && _u !== void 0 ? _u : defaultConfig.includeVInTag, + tagSeparator: (_v = pathConfig.tagSeparator) !== null && _v !== void 0 ? _v : defaultConfig.tagSeparator, + pullRequestTitlePattern: (_w = pathConfig.pullRequestTitlePattern) !== null && _w !== void 0 ? _w : defaultConfig.pullRequestTitlePattern, + separatePullRequests: (_x = pathConfig.separatePullRequests) !== null && _x !== void 0 ? _x : defaultConfig.separatePullRequests, + skipSnapshot: (_y = pathConfig.skipSnapshot) !== null && _y !== void 0 ? _y : defaultConfig.skipSnapshot, }; } /** @@ -114386,7 +114398,7 @@ module.exports = {}; /***/ ((module) => { "use strict"; -module.exports = {"i8":"13.20.0"}; +module.exports = {"i8":"13.21.0"}; /***/ }),