renovate 42.19.10 → 42.20.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/dist/config/migrate-validate.js +1 -2
- package/dist/config/migrate-validate.js.map +1 -1
- package/dist/config/migration.js +0 -1
- package/dist/config/migration.js.map +1 -1
- package/dist/config/options/index.js +1 -1
- package/dist/config/options/index.js.map +1 -1
- package/dist/instrumentation/index.js +3 -4
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/modules/datasource/crate/index.js +1 -1
- package/dist/modules/datasource/crate/index.js.map +1 -1
- package/dist/modules/datasource/docker/common.js +6 -0
- package/dist/modules/datasource/docker/common.js.map +1 -1
- package/dist/modules/datasource/docker/schema.js +1 -1
- package/dist/modules/datasource/docker/schema.js.map +1 -1
- package/dist/modules/datasource/go/index.js +1 -2
- package/dist/modules/datasource/go/index.js.map +1 -1
- package/dist/modules/datasource/maven/index.js +2 -2
- package/dist/modules/datasource/maven/index.js.map +1 -1
- package/dist/modules/datasource/maven/util.js +2 -2
- package/dist/modules/datasource/maven/util.js.map +1 -1
- package/dist/modules/manager/bazel/artifacts.js +2 -2
- package/dist/modules/manager/bazel/artifacts.js.map +1 -1
- package/dist/modules/manager/maven-wrapper/artifacts.js +2 -2
- package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
- package/dist/modules/manager/npm/extract/common/package-file.js +2 -2
- package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
- package/dist/modules/manager/npm/extract/yarn.js +2 -2
- package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
- package/dist/modules/manager/npm/post-update/index.js +14 -18
- package/dist/modules/manager/npm/post-update/index.js.map +1 -1
- package/dist/modules/manager/npm/post-update/npm.js +4 -4
- package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +4 -4
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/post-update/yarn.js +6 -6
- package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/index.js +3 -4
- package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
- package/dist/modules/manager/npm/update/dependency/pnpm.js +2 -2
- package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
- package/dist/modules/manager/npm/update/index.js +1 -0
- package/dist/modules/manager/npm/update/index.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/common/parent-version.js +8 -8
- package/dist/modules/manager/npm/update/locked-dependency/common/parent-version.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js +2 -2
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/dep-constraints.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js +5 -5
- package/dist/modules/manager/npm/update/locked-dependency/package-lock/index.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js +4 -4
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/get-locked.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js +2 -2
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/index.js.map +1 -1
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js +2 -2
- package/dist/modules/manager/npm/update/locked-dependency/yarn-lock/replace.js.map +1 -1
- package/dist/modules/manager/npm/update/package-version/index.js +1 -2
- package/dist/modules/manager/npm/update/package-version/index.js.map +1 -1
- package/dist/modules/manager/npm/utils.js +8 -8
- package/dist/modules/manager/npm/utils.js.map +1 -1
- package/dist/modules/platform/azure/azure-helper.js +2 -2
- package/dist/modules/platform/azure/azure-helper.js.map +1 -1
- package/dist/modules/platform/azure/index.js +14 -14
- package/dist/modules/platform/azure/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/comments.js +4 -4
- package/dist/modules/platform/bitbucket/comments.js.map +1 -1
- package/dist/modules/platform/bitbucket/index.js +31 -31
- package/dist/modules/platform/bitbucket/index.js.map +1 -1
- package/dist/modules/platform/bitbucket/utils.js +2 -2
- package/dist/modules/platform/bitbucket/utils.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/index.js +32 -34
- package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
- package/dist/modules/platform/bitbucket-server/utils.js +2 -4
- package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
- package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
- package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
- package/dist/modules/platform/codecommit/index.js +24 -24
- package/dist/modules/platform/codecommit/index.js.map +1 -1
- package/dist/modules/platform/gitea/index.js +4 -4
- package/dist/modules/platform/gitea/index.js.map +1 -1
- package/dist/modules/platform/github/index.js +68 -68
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/github/massage-markdown-links.js +2 -2
- package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
- package/dist/modules/platform/github/pr.js +2 -2
- package/dist/modules/platform/github/pr.js.map +1 -1
- package/dist/modules/platform/github/schema.js +1 -2
- package/dist/modules/platform/github/schema.js.map +1 -1
- package/dist/modules/platform/gitlab/index.js +29 -30
- package/dist/modules/platform/gitlab/index.js.map +1 -1
- package/dist/modules/platform/utils/pr-body.js +7 -3
- package/dist/modules/platform/utils/pr-body.js.map +1 -1
- package/dist/proxy.js +1 -2
- package/dist/proxy.js.map +1 -1
- package/dist/util/cache/package/index.js +2 -2
- package/dist/util/cache/package/index.js.map +1 -1
- package/dist/util/cache/package/namespaces.js +1 -1
- package/dist/util/cache/package/namespaces.js.map +1 -1
- package/dist/util/git/error.js +5 -4
- package/dist/util/git/error.js.map +1 -1
- package/dist/util/git/index.js +10 -12
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/private-key.js +2 -0
- package/dist/util/git/private-key.js.map +1 -1
- package/dist/util/http/bitbucket.js +1 -2
- package/dist/util/http/bitbucket.js.map +1 -1
- package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
- package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
- package/dist/util/http/http.js +1 -1
- package/dist/util/http/http.js.map +1 -1
- package/dist/util/stats.js +1 -1
- package/dist/util/stats.js.map +1 -1
- package/dist/workers/global/config/parse/codespaces.js +1 -2
- package/dist/workers/global/config/parse/codespaces.js.map +1 -1
- package/dist/workers/repository/update/branch/auto-replace.js +4 -2
- package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
- package/dist/workers/repository/update/branch/automerge.js +4 -1
- package/dist/workers/repository/update/branch/automerge.js.map +1 -1
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +1 -0
- package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
- package/dist/workers/repository/update/branch/index.js +16 -8
- package/dist/workers/repository/update/branch/index.js.map +1 -1
- package/package.json +3 -2
- package/renovate-schema.json +3 -3
|
@@ -57,9 +57,9 @@ function massageMarkdownLinks(content) {
|
|
|
57
57
|
}, content);
|
|
58
58
|
return result.trimEnd() + rightSpaces;
|
|
59
59
|
}
|
|
60
|
-
catch (err) /* v8 ignore
|
|
60
|
+
catch (err) /* v8 ignore next */ {
|
|
61
61
|
logger_1.logger.warn({ err }, `Unable to massage markdown text`);
|
|
62
62
|
return content;
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
64
|
}
|
|
65
65
|
//# sourceMappingURL=massage-markdown-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"massage-markdown-links.js","sourceRoot":"","sources":["../../../../lib/modules/platform/github/massage-markdown-links.ts"],"names":[],"mappings":";;AA4DA,oDAeC;AA1ED,mCAAgC;AAEhC,4CAAyC;AACzC,iDAAoD;AACpD,+CAA4C;AAQ5C,4DAA4D;AAC5D,MAAM,QAAQ,GACZ,8IAA8I,CAAC,CAAC,8CAA8C;AAEhM,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAClB,IAAA,aAAK,EAAC,s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AO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACzE,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE;YACpE,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;YACrC,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACjC,OAAO,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;QAC1C,CAAC,EAAE,OAAO,CAAC,CAAC;QACZ,OAAO,MAAM,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,oBAAoB,CAAC,CAAC;QAClC,eAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,iCAAiC,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC","sourcesContent":["import type { RootContent } from 'mdast';\nimport { remark } from 'remark';\nimport type { Plugin, Transformer } from 'unified';\nimport { logger } from '../../../logger';\nimport { coerceNumber } from '../../../util/number';\nimport { regEx } from '../../../util/regex';\n\ninterface UrlMatch {\n start: number;\n end: number;\n replaceTo: string;\n}\n\n//according to https://github.com/dead-claudia/github-limits\nconst urlRegex =\n /(?:https?:)?(?:\\/\\/)?(?:www\\.)?(?<!api\\.)(?:to)?github\\.com\\/[-a-z0-9]+\\/[-_a-z0-9.]+\\/(?:discussions|issues|pull)\\/[0-9]+(?:#[-_a-z0-9]+)?/i; // TODO #12872 (?<!re) after text not matching\n\nfunction massageLink(input: string): string {\n return input.replace(\n regEx(/(?:to|redirect\\.|www\\.)?github\\.com/i),\n 'redirect.github.com',\n );\n}\n\nfunction collectLinkPosition(input: string, matches: UrlMatch[]): Plugin {\n const transformer = (tree: RootContent): void => {\n const startOffset = coerceNumber(tree.position?.start.offset);\n const endOffset = coerceNumber(tree.position?.end.offset);\n\n if (tree.type === 'link') {\n const substr = input.slice(startOffset, endOffset);\n const url: string = tree.url;\n const offset: number = startOffset + substr.lastIndexOf(url);\n if (urlRegex.test(url)) {\n matches.push({\n start: offset,\n end: offset + url.length,\n replaceTo: massageLink(url),\n });\n }\n } else if (tree.type === 'text') {\n const globalUrlReg = new RegExp(urlRegex, 'gi');\n const urlMatches = [...tree.value.matchAll(globalUrlReg)];\n for (const match of urlMatches) {\n const [url] = match;\n const start = startOffset + coerceNumber(match.index);\n const end = start + url.length;\n const newUrl = massageLink(url);\n matches.push({ start, end, replaceTo: `[${url}](${newUrl})` });\n }\n } else if ('children' in tree) {\n tree.children.forEach((child: RootContent) => {\n transformer(child);\n });\n }\n };\n\n return () => transformer as Transformer;\n}\n\nexport function massageMarkdownLinks(content: string): string {\n try {\n const rightSpaces = content.replace(content.trimEnd(), '');\n const matches: UrlMatch[] = [];\n remark().use(collectLinkPosition(content, matches)).processSync(content);\n const result = matches.reduceRight((acc, { start, end, replaceTo }) => {\n const leftPart = acc.slice(0, start);\n const rightPart = acc.slice(end);\n return leftPart + replaceTo + rightPart;\n }, content);\n return result.trimEnd() + rightSpaces;\n } catch (err) /* v8 ignore next */ {\n logger.warn({ err }, `Unable to massage markdown text`);\n return content;\n }\n}\n"]}
|
|
@@ -100,10 +100,10 @@ async function getPrCache(http, repo, username) {
|
|
|
100
100
|
apiQuotaAffected,
|
|
101
101
|
}, `PR cache: getPrList success`);
|
|
102
102
|
}
|
|
103
|
-
catch (err) /* v8 ignore
|
|
103
|
+
catch (err) /* v8 ignore next */ {
|
|
104
104
|
logger_1.logger.debug({ err }, 'PR cache: getPrList err');
|
|
105
105
|
throw new external_host_error_1.ExternalHostError(err, 'github');
|
|
106
|
-
}
|
|
106
|
+
}
|
|
107
107
|
return prApiCache.getItems();
|
|
108
108
|
}
|
|
109
109
|
function updatePrCache(pr) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.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C,EAAE,GAAG,EAAE,EAAE,yBAAyB,CAAC,CAAC;QACjD,MAAM,IAAI,uCAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,SAAgB,aAAa,CAAC,EAAQ;IACpC,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC;IAC9B,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { isEmptyArray } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { getCache } from '../../../util/cache/repository';\nimport { repoCacheProvider } from '../../../util/http/cache/repository-http-cache-provider';\nimport type { GithubHttp, GithubHttpOptions } from '../../../util/http/github';\nimport { parseLinkHeader } from '../../../util/url';\nimport { ApiCache } from './api-cache';\nimport { coerceRestPr } from './common';\nimport type { ApiPageCache, GhPr, GhRestPr } from './types';\n\nfunction getPrApiCache(): ApiCache<GhPr> {\n const repoCache = getCache();\n if (!repoCache?.platform?.github?.pullRequestsCache) {\n logger.debug('PR cache: cached data not found, creating new cache');\n repoCache.platform ??= {};\n repoCache.platform.github ??= {};\n repoCache.platform.github.pullRequestsCache ??= { items: {} };\n }\n\n const prApiCache = new ApiCache<GhPr>(\n repoCache.platform.github.pullRequestsCache as ApiPageCache<GhPr>,\n );\n return prApiCache;\n}\n\n/**\n * Fetch and return Pull Requests from GitHub repository:\n *\n * 1. Synchronize long-term cache.\n *\n * 2. Store items in raw format, i.e. exactly what\n * has been returned by GitHub REST API.\n *\n * 3. Convert items to the Renovate format and return.\n *\n * In order synchronize ApiCache properly, we handle 3 cases:\n *\n * a. We never fetched PR list for this repo before.\n * If cached PR list is empty, we assume it's the case.\n *\n * In this case, we're falling back to quick fetch via\n * `paginate=true` option (see `util/http/github.ts`).\n *\n * b. Some of PRs had changed since last run.\n *\n * In this case, we sequentially fetch page by page\n * until `ApiCache.coerce` function indicates that\n * no more fresh items can be found in the next page.\n *\n * We expect to fetch just one page per run in average,\n * since it's rare to have more than 100 updated PRs.\n */\nexport async function getPrCache(\n http: GithubHttp,\n repo: string,\n username?: string,\n): Promise<Record<number, GhPr>> {\n const prApiCache = getPrApiCache();\n const isInitial = isEmptyArray(prApiCache.getItems());\n\n try {\n let requestsTotal = 0;\n let apiQuotaAffected = false;\n let needNextPageFetch = true;\n let needNextPageSync = true;\n\n let pageIdx = 1;\n while (needNextPageFetch && needNextPageSync) {\n const opts: GithubHttpOptions = { paginate: false, memCache: false };\n if (pageIdx === 1) {\n opts.cacheProvider = repoCacheProvider;\n if (isInitial) {\n // Speed up initial fetch\n opts.paginate = true;\n }\n }\n\n let perPage: number;\n if (isInitial) {\n logger.debug('PR cache: initial fetch');\n perPage = 100;\n } else {\n logger.debug('PR cache: sync fetch');\n perPage = 20;\n }\n\n const urlPath = `repos/${repo}/pulls?per_page=${perPage}&state=all&sort=updated&direction=desc&page=${pageIdx}`;\n\n const res = await http.getJsonUnchecked<GhRestPr[]>(urlPath, opts);\n apiQuotaAffected = true;\n requestsTotal += 1;\n\n const {\n headers: { link: linkHeader },\n } = res;\n\n let { body: page } = res;\n\n if (username) {\n const filteredPage = page.filter(\n (ghPr) => ghPr?.user?.login && ghPr.user.login === username,\n );\n\n logger.debug(\n `PR cache: Filtered ${page.length} PRs to ${filteredPage.length} (user=${username})`,\n );\n\n page = filteredPage;\n }\n\n const items = page.map(coerceRestPr);\n\n needNextPageSync = prApiCache.reconcile(items);\n needNextPageFetch = !!parseLinkHeader(linkHeader)?.next;\n\n if (pageIdx === 1) {\n needNextPageFetch &&= !opts.paginate;\n }\n\n pageIdx += 1;\n }\n\n logger.debug(\n {\n pullsTotal: prApiCache.getItems().length,\n requestsTotal,\n apiQuotaAffected,\n },\n `PR cache: getPrList success`,\n );\n } catch (err) /* v8 ignore next */ {\n logger.debug({ err }, 'PR cache: getPrList err');\n throw new ExternalHostError(err, 'github');\n }\n\n return prApiCache.getItems();\n}\n\nexport function updatePrCache(pr: GhPr): void {\n const cache = getPrApiCache();\n cache.updateItem(pr);\n}\n"]}
|
|
@@ -40,11 +40,10 @@ exports.GithubVulnerabilityAlert = (0, schema_utils_1.LooseArray)(zod_1.z.object
|
|
|
40
40
|
manifest_path: zod_1.z.string(),
|
|
41
41
|
}),
|
|
42
42
|
}), {
|
|
43
|
-
/* v8 ignore
|
|
43
|
+
/* v8 ignore next */
|
|
44
44
|
onError: ({ error }) => {
|
|
45
45
|
logger_1.logger.debug({ error }, 'Vulnerability Alert: Failed to parse some alerts');
|
|
46
46
|
},
|
|
47
|
-
/* v8 ignore stop */
|
|
48
47
|
});
|
|
49
48
|
// https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content
|
|
50
49
|
const GithubResponseMetadata = zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/platform/github/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,6DAAwD;AAExD,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IACvB,SAAS,EAAE,OAAC,CAAC,KAAK,CAAC;QACjB,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAClB,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QAChB,OAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QAClB,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;QAChB,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACrB,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACjB,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QACrB,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,OAAC;KAC5B,MAAM,CAAC;IAC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CAAC,EAAE,CAAC,qBAAa,CAAC,CAAC;AAEjE,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,sBAAsB,EAAE,OAAC;SACtB,MAAM,CAAC;QACN,MAAM,EAAE,OAAC,CAAC,OAAO,EAAE;KACpB,CAAC;SACD,OAAO,EAAE;SACT,QAAQ,EAAE;CACd,CAAC,CAAC;AAGH,MAAM,iBAAiB,GAAG,OAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACrD,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;KACpC,CAAC;IACF,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;QACzC,UAAU,EAAE,OAAC,CAAC,MAAM,CAAC;YACnB,oCAAoC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SAC7D,CAAC;KACH,CAAC;IACF,oBAAoB;IACpB,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;KAC5B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,oBAAoB,GAAG,IAAA,yBAAU,EAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { logger } from '../../../logger';\nimport { LooseArray } from '../../../util/schema-utils';\n\nconst Package = z.object({\n ecosystem: z.union([\n z.literal('maven'),\n z.literal('npm'),\n z.literal('nuget'),\n z.literal('pip'),\n z.literal('rubygems'),\n z.literal('rust'),\n z.literal('composer'),\n z.literal('go'),\n ]),\n name: z.string(),\n});\n\nconst SecurityVulnerability = z\n .object({\n first_patched_version: z.object({ identifier: z.string() }).nullish(),\n package: Package,\n vulnerable_version_range: z.string(),\n })\n .nullable();\n\nconst SecurityAdvisory = z.object({\n description: z.string(),\n identifiers: z.array(\n z.object({\n type: z.string(),\n value: z.string(),\n }),\n ),\n references: z.array(z.object({ url: z.string() })).optional(),\n});\n\nexport const GithubVulnerabilityAlert = LooseArray(\n z.object({\n dismissed_reason: z.string().nullish(),\n security_advisory: SecurityAdvisory,\n security_vulnerability: SecurityVulnerability,\n dependency: z.object({\n manifest_path: z.string(),\n }),\n }),\n {\n /* v8 ignore next */\n onError: ({ error }) => {\n logger.debug(\n { error },\n 'Vulnerability Alert: Failed to parse some alerts',\n );\n },\n },\n);\nexport type GithubVulnerabilityAlert = z.infer<typeof GithubVulnerabilityAlert>;\n\n// https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#get-repository-content\nconst GithubResponseMetadata = z.object({\n name: z.string(),\n path: z.string(),\n});\n\nexport const GithubFileMeta = GithubResponseMetadata.extend({\n type: z.literal('file'),\n});\nexport type GithubFileMeta = z.infer<typeof GithubFileMeta>;\n\nexport const GithubFile = GithubFileMeta.extend({\n content: z.string(),\n encoding: z.string(),\n});\nexport type GithubFile = z.infer<typeof GithubFile>;\n\nexport const GithubDirectory = GithubResponseMetadata.extend({\n type: z.literal('dir'),\n});\n\nexport type GithubDirectory = z.infer<typeof GithubDirectory>;\n\nexport const GithubOtherContent = GithubResponseMetadata.extend({\n type: z.literal('symlink').or(z.literal('submodule')),\n});\n\nexport type GithubOtherContent = z.infer<typeof GithubOtherContent>;\n\nexport const GithubElement = GithubFile.or(GithubFileMeta)\n .or(GithubDirectory)\n .or(GithubOtherContent);\nexport type GithubElement = z.infer<typeof GithubElement>;\n\nexport const GithubContentResponse = z.array(GithubElement).or(GithubElement);\n\nexport const GithubBranchProtection = z.object({\n required_status_checks: z\n .object({\n strict: z.boolean(),\n })\n .nullish()\n .optional(),\n});\nexport type GithubBranchProtection = z.infer<typeof GithubBranchProtection>;\n\nconst GithubRulesetRule = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('non_fast_forward'),\n }),\n z.object({\n type: z.literal('required_status_checks'),\n parameters: z.object({\n strict_required_status_checks_policy: z.boolean().optional(),\n }),\n }),\n // prevents deletion\n z.object({\n type: z.literal('deletion'),\n }),\n]);\n\nexport const GithubBranchRulesets = LooseArray(GithubRulesetRule);\nexport type GithubBranchRulesets = z.infer<typeof GithubBranchRulesets>;\n"]}
|
|
@@ -95,10 +95,10 @@ async function initPlatform({ endpoint, username, token, gitAuthor, }) {
|
|
|
95
95
|
botUserName = user.name;
|
|
96
96
|
}
|
|
97
97
|
const env = (0, env_1.getEnv)();
|
|
98
|
-
/* v8 ignore
|
|
98
|
+
/* v8 ignore next: experimental feature */
|
|
99
99
|
if (env.RENOVATE_X_PLATFORM_VERSION) {
|
|
100
100
|
gitlabVersion = env.RENOVATE_X_PLATFORM_VERSION;
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
else {
|
|
103
103
|
const version = (await http_1.gitlabApi.getJsonUnchecked('version', {
|
|
104
104
|
token,
|
|
@@ -207,11 +207,11 @@ async function initRepo({ repository, cloneSubmodules, cloneSubmodulesFilter, ig
|
|
|
207
207
|
throw new Error(error_messages_1.REPOSITORY_EMPTY);
|
|
208
208
|
}
|
|
209
209
|
config.defaultBranch = res.body.default_branch;
|
|
210
|
-
/* v8 ignore
|
|
210
|
+
/* v8 ignore next */
|
|
211
211
|
if (!config.defaultBranch) {
|
|
212
212
|
logger_1.logger.warn({ resBody: res.body }, 'Error fetching GitLab project');
|
|
213
213
|
throw new Error(error_messages_1.TEMPORARY_ERROR);
|
|
214
|
-
}
|
|
214
|
+
}
|
|
215
215
|
config.mergeMethod = res.body.merge_method || 'merge';
|
|
216
216
|
config.mergeTrainsEnabled = res.body.merge_trains_enabled ?? false;
|
|
217
217
|
if (res.body.squash_option) {
|
|
@@ -227,7 +227,7 @@ async function initRepo({ repository, cloneSubmodules, cloneSubmodulesFilter, ig
|
|
|
227
227
|
url,
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
catch (err) /* v8 ignore
|
|
230
|
+
catch (err) /* v8 ignore next */ {
|
|
231
231
|
logger_1.logger.debug({ err }, 'Caught initRepo error');
|
|
232
232
|
if (err.message.includes('HEAD is not a symbolic ref')) {
|
|
233
233
|
throw new Error(error_messages_1.REPOSITORY_EMPTY);
|
|
@@ -246,7 +246,7 @@ async function initRepo({ repository, cloneSubmodules, cloneSubmodulesFilter, ig
|
|
|
246
246
|
}
|
|
247
247
|
logger_1.logger.debug({ err }, 'Unknown GitLab initRepo error');
|
|
248
248
|
throw err;
|
|
249
|
-
}
|
|
249
|
+
}
|
|
250
250
|
const repoConfig = {
|
|
251
251
|
defaultBranch: config.defaultBranch,
|
|
252
252
|
isFork: !!res.body.forked_from_project,
|
|
@@ -276,13 +276,13 @@ async function getStatus(branchName, useCache = true) {
|
|
|
276
276
|
return (await http_1.gitlabApi.getJsonUnchecked(url, opts))
|
|
277
277
|
.body;
|
|
278
278
|
}
|
|
279
|
-
catch (err) /* v8 ignore
|
|
279
|
+
catch (err) /* v8 ignore next */ {
|
|
280
280
|
logger_1.logger.debug({ err }, 'Error getting commit status');
|
|
281
281
|
if (err.response?.statusCode === 404) {
|
|
282
282
|
throw new Error(error_messages_1.REPOSITORY_CHANGED);
|
|
283
283
|
}
|
|
284
284
|
throw err;
|
|
285
|
-
}
|
|
285
|
+
}
|
|
286
286
|
}
|
|
287
287
|
const gitlabToRenovateStatusMapping = {
|
|
288
288
|
pending: 'yellow',
|
|
@@ -303,11 +303,11 @@ async function getBranchStatus(branchName, internalChecksAsSuccess) {
|
|
|
303
303
|
throw new Error(error_messages_1.REPOSITORY_CHANGED);
|
|
304
304
|
}
|
|
305
305
|
const branchStatuses = await getStatus(branchName);
|
|
306
|
-
/* v8 ignore
|
|
306
|
+
/* v8 ignore next */
|
|
307
307
|
if (!(0, is_1.isArray)(branchStatuses)) {
|
|
308
308
|
logger_1.logger.warn({ branchName, branchStatuses }, 'Empty or unexpected branch statuses');
|
|
309
309
|
return 'yellow';
|
|
310
|
-
}
|
|
310
|
+
}
|
|
311
311
|
logger_1.logger.debug(`Got res with ${branchStatuses.length} results`);
|
|
312
312
|
const mr = await getBranchPr(branchName);
|
|
313
313
|
if (mr && mr.sha !== mr.headPipelineSha && mr.headPipelineStatus) {
|
|
@@ -447,9 +447,9 @@ async function tryPrAutomerge(pr, platformPrOptions) {
|
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
catch (err) /* v8 ignore
|
|
450
|
+
catch (err) /* v8 ignore next */ {
|
|
451
451
|
logger_1.logger.debug({ err }, 'Automerge on PR creation failed');
|
|
452
|
-
}
|
|
452
|
+
}
|
|
453
453
|
}
|
|
454
454
|
async function approveMr(mrNumber) {
|
|
455
455
|
const env = (0, env_1.getEnv)();
|
|
@@ -541,7 +541,7 @@ async function mergePr({ id }) {
|
|
|
541
541
|
});
|
|
542
542
|
return true;
|
|
543
543
|
}
|
|
544
|
-
catch (err) /* v8 ignore
|
|
544
|
+
catch (err) /* v8 ignore next */ {
|
|
545
545
|
if (err.statusCode === 401) {
|
|
546
546
|
logger_1.logger.debug('No permissions to merge PR');
|
|
547
547
|
return false;
|
|
@@ -553,7 +553,7 @@ async function mergePr({ id }) {
|
|
|
553
553
|
logger_1.logger.debug({ err }, 'merge PR error');
|
|
554
554
|
logger_1.logger.debug('PR merge failed');
|
|
555
555
|
return false;
|
|
556
|
-
}
|
|
556
|
+
}
|
|
557
557
|
}
|
|
558
558
|
function massageMarkdown(input) {
|
|
559
559
|
const desc = input
|
|
@@ -574,11 +574,10 @@ function maxBodyLength() {
|
|
|
574
574
|
return 1000000;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
/* v8 ignore
|
|
577
|
+
/* v8 ignore next: no need to test */
|
|
578
578
|
function labelCharLimit() {
|
|
579
579
|
return 255;
|
|
580
580
|
}
|
|
581
|
-
/* v8 ignore stop */
|
|
582
581
|
// Branch
|
|
583
582
|
function matchesState(state, desiredState) {
|
|
584
583
|
if (desiredState === 'all') {
|
|
@@ -682,7 +681,7 @@ async function setBranchStatus({ branchName, context, description, state: renova
|
|
|
682
681
|
// update status cache
|
|
683
682
|
await getStatus(branchName, false);
|
|
684
683
|
}
|
|
685
|
-
catch (err) /* v8 ignore
|
|
684
|
+
catch (err) /* v8 ignore next */ {
|
|
686
685
|
if (err.body?.message?.startsWith('Cannot transition status via :enqueue from :pending')) {
|
|
687
686
|
// https://gitlab.com/gitlab-org/gitlab-foss/issues/25807
|
|
688
687
|
logger_1.logger.debug('Ignoring status transition error');
|
|
@@ -691,7 +690,7 @@ async function setBranchStatus({ branchName, context, description, state: renova
|
|
|
691
690
|
logger_1.logger.debug({ err });
|
|
692
691
|
logger_1.logger.warn('Failed to set branch status');
|
|
693
692
|
}
|
|
694
|
-
}
|
|
693
|
+
}
|
|
695
694
|
}
|
|
696
695
|
// Issue
|
|
697
696
|
async function getIssueList() {
|
|
@@ -708,11 +707,11 @@ async function getIssueList() {
|
|
|
708
707
|
memCache: false,
|
|
709
708
|
paginate: true,
|
|
710
709
|
});
|
|
711
|
-
/* v8 ignore
|
|
710
|
+
/* v8 ignore next */
|
|
712
711
|
if (!(0, is_1.isArray)(res.body)) {
|
|
713
712
|
logger_1.logger.warn({ responseBody: res.body }, 'Could not retrieve issue list');
|
|
714
713
|
return [];
|
|
715
|
-
}
|
|
714
|
+
}
|
|
716
715
|
config.issueList = res.body.map((i) => ({
|
|
717
716
|
iid: i.iid,
|
|
718
717
|
title: i.title,
|
|
@@ -724,23 +723,23 @@ async function getIssueList() {
|
|
|
724
723
|
async function getIssue(number, useCache = true) {
|
|
725
724
|
try {
|
|
726
725
|
const opts = {};
|
|
727
|
-
/* v8 ignore
|
|
726
|
+
/* v8 ignore next: temporary code */
|
|
728
727
|
if (useCache) {
|
|
729
728
|
opts.cacheProvider = memory_http_cache_provider_1.memCacheProvider;
|
|
730
729
|
}
|
|
731
730
|
else {
|
|
732
731
|
opts.memCache = false;
|
|
733
|
-
}
|
|
732
|
+
}
|
|
734
733
|
const issueBody = (await http_1.gitlabApi.getJsonUnchecked(`projects/${config.repository}/issues/${number}`, opts)).body.description;
|
|
735
734
|
return {
|
|
736
735
|
number,
|
|
737
736
|
body: issueBody,
|
|
738
737
|
};
|
|
739
738
|
}
|
|
740
|
-
catch (err) /* v8 ignore
|
|
739
|
+
catch (err) /* v8 ignore next */ {
|
|
741
740
|
logger_1.logger.debug({ err, number }, 'Error getting issue');
|
|
742
741
|
return null;
|
|
743
|
-
}
|
|
742
|
+
}
|
|
744
743
|
}
|
|
745
744
|
async function findIssue(title) {
|
|
746
745
|
logger_1.logger.debug(`findIssue(${title})`);
|
|
@@ -752,10 +751,10 @@ async function findIssue(title) {
|
|
|
752
751
|
}
|
|
753
752
|
return await getIssue(issue.iid);
|
|
754
753
|
}
|
|
755
|
-
catch /* v8 ignore
|
|
754
|
+
catch /* v8 ignore next */ {
|
|
756
755
|
logger_1.logger.warn('Error finding issue');
|
|
757
756
|
return null;
|
|
758
|
-
}
|
|
757
|
+
}
|
|
759
758
|
}
|
|
760
759
|
async function ensureIssue({ title, reuseTitle, body, labels, confidential, }) {
|
|
761
760
|
logger_1.logger.debug(`ensureIssue()`);
|
|
@@ -794,14 +793,14 @@ async function ensureIssue({ title, reuseTitle, body, labels, confidential, }) {
|
|
|
794
793
|
return 'created';
|
|
795
794
|
}
|
|
796
795
|
}
|
|
797
|
-
catch (err) /* v8 ignore
|
|
796
|
+
catch (err) /* v8 ignore next */ {
|
|
798
797
|
if (err.message.startsWith('Issues are disabled for this repo')) {
|
|
799
798
|
logger_1.logger.debug(`Could not create issue: ${err.message}`);
|
|
800
799
|
}
|
|
801
800
|
else {
|
|
802
801
|
logger_1.logger.warn({ err }, 'Could not ensure issue');
|
|
803
802
|
}
|
|
804
|
-
}
|
|
803
|
+
}
|
|
805
804
|
return null;
|
|
806
805
|
}
|
|
807
806
|
async function ensureIssueClosing(title) {
|
|
@@ -899,9 +898,9 @@ async function deleteLabel(issueNo, label) {
|
|
|
899
898
|
body: { labels },
|
|
900
899
|
});
|
|
901
900
|
}
|
|
902
|
-
catch (err) /* v8 ignore
|
|
901
|
+
catch (err) /* v8 ignore next */ {
|
|
903
902
|
logger_1.logger.warn({ err, issueNo, label }, 'Failed to delete label');
|
|
904
|
-
}
|
|
903
|
+
}
|
|
905
904
|
}
|
|
906
905
|
async function getComments(issueNo) {
|
|
907
906
|
// GET projects/:owner/:repo/merge_requests/:number/notes
|