renovate 44.164.3 → 44.164.5
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/util/git/auth.js +1 -0
- package/dist/util/git/auth.js.map +1 -1
- package/dist/util/git/url.js +10 -3
- package/dist/util/git/url.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/package.json +1 -1
- package/renovate-schema.json +2 -2
package/dist/util/git/auth.js
CHANGED
|
@@ -55,6 +55,7 @@ function getAuthenticationRules(gitUrl, hostType, token) {
|
|
|
55
55
|
if (!sshPort || isEmptyString(sshPort)) sshPort = "7999";
|
|
56
56
|
}
|
|
57
57
|
const url = { ...insteadUrl };
|
|
58
|
+
if (hasUser && url.source === "bitbucket.org") url.source = "bitbucket";
|
|
58
59
|
const protocol = regEx(/^https?$/).test(url.protocol) ? url.protocol : "https";
|
|
59
60
|
url.token = hasUser ? token : `ssh:${token}`;
|
|
60
61
|
authenticationRules.push({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","names":[],"sources":["../../../lib/util/git/auth.ts"],"sourcesContent":["import { isEmptyString } from '@sindresorhus/is';\nimport { PLATFORM_HOST_TYPES } from '../../constants/platforms.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { HostRule } from '../../types/index.ts';\nimport { detectPlatform } from '../common.ts';\nimport type { ResolvedChildEnv } from '../exec/utils.ts';\nimport { find, getAll } from '../host-rules.ts';\nimport { regEx } from '../regex.ts';\nimport { createURLFromHostOrURL, isHttpUrl } from '../url.ts';\nimport { addGitConfigEnvironmentVariables } from './config.ts';\nimport type { AuthenticationRule } from './types.ts';\nimport { getTokenCredentials, parseGitUrl } from './url.ts';\n\nconst platformHostTypes = new Set<string>(PLATFORM_HOST_TYPES);\n\nconst githubApiUrls = new Set([\n 'github.com',\n 'api.github.com',\n 'https://api.github.com',\n 'https://api.github.com/',\n]);\n\n/**\n * Append Git authentication configuration to a resolved child environment.\n * @returns a new environment without modifying the input\n */\nexport function getGitAuthenticatedEnvironmentVariables(\n environmentVariables: Readonly<ResolvedChildEnv>,\n originalGitUrl: string,\n { token, username, password, hostType, matchHost }: HostRule,\n): ResolvedChildEnv {\n if (!token && !(username && password)) {\n logger.warn(\n { host: matchHost },\n `Could not create environment variable for host as neither token or username and password was set`,\n );\n return { ...environmentVariables };\n }\n\n let authenticationRules: AuthenticationRule[];\n if (token) {\n authenticationRules = getAuthenticationRulesWithToken(\n originalGitUrl,\n hostType,\n token,\n );\n } else {\n const encodedUsername = encodeURIComponent(username!);\n const encodedPassword = encodeURIComponent(password!);\n\n authenticationRules = getAuthenticationRules(\n originalGitUrl,\n hostType,\n `${encodedUsername}:${encodedPassword}`,\n );\n }\n\n return addGitConfigEnvironmentVariables(\n environmentVariables,\n authenticationRules.map((rule) => ({\n key: `url.${rule.url}.insteadOf`,\n value: rule.insteadOf,\n })),\n );\n}\n\nfunction getAuthenticationRulesWithToken(\n url: string,\n hostType: string | undefined | null,\n authToken: string,\n): AuthenticationRule[] {\n const type = hostType ?? detectPlatform(url);\n const platform =\n hostType && platformHostTypes.has(hostType)\n ? hostType\n : detectPlatform(url);\n return getAuthenticationRules(\n url,\n type,\n getTokenCredentials(platform, authToken),\n );\n}\n\n/**\n * Generates the authentication rules for later git usage for the given host\n * @link https://coolaj86.com/articles/vanilla-devops-git-credentials-cheatsheet/\n * @param gitUrl Git repository URL\n * @param hostType Git host type\n * @param token Authentication token or `username:password` string\n */\nexport function getAuthenticationRules(\n gitUrl: string,\n hostType: string | undefined | null,\n token: string,\n): AuthenticationRule[] {\n const authenticationRules = [];\n const hasUser = token.split(':').length > 1;\n const insteadUrl = parseGitUrl(gitUrl);\n let sshPort = insteadUrl.port;\n\n if (hostType === 'bitbucket-server') {\n // For Bitbucket Server/Data Center, `source` must be `bitbucket-server`\n // to generate HTTP(s) URLs correctly.\n // https://github.com/IonicaBizau/git-url-parse/blob/28828546c148d58bbcff61409915a4e1e8f7eb11/lib/index.js#L304\n insteadUrl.source = 'bitbucket-server';\n\n // sshPort is string, wrong type!\n // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/72361\n // https://github.com/IonicaBizau/parse-path/blob/87f71f273da90f85f6845937a70b7c032eeae4e3/lib/index.js#L45\n // v8 ignore next -- TODO: add test #40625\n if (!sshPort || isEmptyString(sshPort)) {\n // By default, bitbucket-server SSH port is 7999.\n // For non-default port, the generated auth config will likely be incorrect.\n sshPort = '7999';\n }\n }\n\n const url = { ...insteadUrl };\n const protocol = regEx(/^https?$/).test(url.protocol)\n ? url.protocol\n : 'https';\n\n // ssh protocol with user if empty\n url.token = hasUser ? token : `ssh:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n // only edge case, need to stringify ourself because the exact syntax is not supported by the library\n // https://github.com/IonicaBizau/git-url-parse/blob/246c9119fb42c2ea1c280028fe77c53eb34c190c/lib/index.js#L246\n insteadOf: `ssh://git@${insteadUrl.resource}${\n sshPort ? `:${sshPort}` : ''\n }/${insteadUrl.full_name}${insteadUrl.git_suffix ? '.git' : ''}`,\n });\n\n // alternative ssh protocol with user if empty\n url.token = hasUser ? token : `git:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: { ...insteadUrl, port: sshPort }.toString('ssh'),\n });\n\n // https protocol with no user as default fallback\n url.token = token;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: insteadUrl.toString(protocol),\n });\n\n return authenticationRules;\n}\n\nexport function getGitEnvironmentVariables(\n environmentVariables: Readonly<ResolvedChildEnv>,\n hostTypes: readonly string[] = [],\n): ResolvedChildEnv {\n let gitEnvironmentVariables: ResolvedChildEnv = { ...environmentVariables };\n\n // hard-coded logic to use authentication for github.com based on the githubToken for api.github.com\n const gitHubHostRule = find({\n hostType: 'github',\n url: 'https://api.github.com/',\n });\n\n if (gitHubHostRule?.token) {\n gitEnvironmentVariables = getGitAuthenticatedEnvironmentVariables(\n gitEnvironmentVariables,\n 'https://github.com/',\n gitHubHostRule,\n );\n }\n\n // Manager-scoped rules are opt-in so unrelated credentials are not exposed to Git.\n const gitAllowedHostTypes = new Set<string>([\n ...PLATFORM_HOST_TYPES,\n ...hostTypes,\n ]);\n\n // filter rules without `matchHost` and `token` or username and password and github api github rules\n const hostRules = getAll()\n .filter((r) => r.matchHost && (r.token ?? (r.username && r.password)))\n .filter((r) => !gitHubHostRule || !githubApiUrls.has(r.matchHost!));\n\n // for each hostRule without hostType we add additional authentication variables to the environmentVariables\n // for each hostRule with hostType we add additional authentication variables to the environmentVariables\n for (const hostRule of hostRules) {\n if (!hostRule.hostType || gitAllowedHostTypes.has(hostRule.hostType)) {\n gitEnvironmentVariables = addAuthFromHostRule(\n hostRule,\n gitEnvironmentVariables,\n );\n }\n }\n return gitEnvironmentVariables;\n}\n\nfunction addAuthFromHostRule(\n hostRule: HostRule,\n environmentVariables: Readonly<ResolvedChildEnv>,\n): ResolvedChildEnv {\n const httpUrl = createURLFromHostOrURL(hostRule.matchHost!)?.toString();\n if (isHttpUrl(httpUrl)) {\n logger.trace(`Adding Git authentication for ${httpUrl} using token auth.`);\n return getGitAuthenticatedEnvironmentVariables(\n environmentVariables,\n httpUrl!,\n hostRule,\n );\n }\n\n logger.debug(\n `Could not parse registryUrl ${hostRule.matchHost!} or not using http(s). Ignoring`,\n );\n return { ...environmentVariables };\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAM,oBAAoB,IAAI,IAAY,mBAAmB;AAE7D,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,wCACd,sBACA,gBACA,EAAE,OAAO,UAAU,UAAU,UAAU,aACrB;CAClB,IAAI,CAAC,SAAS,EAAE,YAAY,WAAW;EACrC,OAAO,KACL,EAAE,MAAM,UAAU,GAClB,kGACF;EACA,OAAO,EAAE,GAAG,qBAAqB;CACnC;CAEA,IAAI;CACJ,IAAI,OACF,sBAAsB,gCACpB,gBACA,UACA,KACF;MAKA,sBAAsB,uBACpB,gBACA,UACA,GANsB,mBAAmB,QAMxB,EAAE,GALG,mBAAmB,QAKL,GACtC;CAGF,OAAO,iCACL,sBACA,oBAAoB,KAAK,UAAU;EACjC,KAAK,OAAO,KAAK,IAAI;EACrB,OAAO,KAAK;CACd,EAAE,CACJ;AACF;AAEA,SAAS,gCACP,KACA,UACA,WACsB;CACtB,MAAM,OAAO,YAAY,eAAe,GAAG;CAC3C,MAAM,WACJ,YAAY,kBAAkB,IAAI,QAAQ,IACtC,WACA,eAAe,GAAG;CACxB,OAAO,uBACL,KACA,MACA,oBAAoB,UAAU,SAAS,CACzC;AACF;;;;;;;;AASA,SAAgB,uBACd,QACA,UACA,OACsB;CACtB,MAAM,sBAAsB,CAAC;CAC7B,MAAM,UAAU,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS;CAC1C,MAAM,aAAa,YAAY,MAAM;CACrC,IAAI,UAAU,WAAW;CAEzB,IAAI,aAAa,oBAAoB;EAInC,WAAW,SAAS;;EAMpB,IAAI,CAAC,WAAW,cAAc,OAAO,GAGnC,UAAU;CAEd;CAEA,MAAM,MAAM,EAAE,GAAG,WAAW;
|
|
1
|
+
{"version":3,"file":"auth.js","names":[],"sources":["../../../lib/util/git/auth.ts"],"sourcesContent":["import { isEmptyString } from '@sindresorhus/is';\nimport { PLATFORM_HOST_TYPES } from '../../constants/platforms.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { HostRule } from '../../types/index.ts';\nimport { detectPlatform } from '../common.ts';\nimport type { ResolvedChildEnv } from '../exec/utils.ts';\nimport { find, getAll } from '../host-rules.ts';\nimport { regEx } from '../regex.ts';\nimport { createURLFromHostOrURL, isHttpUrl } from '../url.ts';\nimport { addGitConfigEnvironmentVariables } from './config.ts';\nimport type { AuthenticationRule } from './types.ts';\nimport { getTokenCredentials, parseGitUrl } from './url.ts';\n\nconst platformHostTypes = new Set<string>(PLATFORM_HOST_TYPES);\n\nconst githubApiUrls = new Set([\n 'github.com',\n 'api.github.com',\n 'https://api.github.com',\n 'https://api.github.com/',\n]);\n\n/**\n * Append Git authentication configuration to a resolved child environment.\n * @returns a new environment without modifying the input\n */\nexport function getGitAuthenticatedEnvironmentVariables(\n environmentVariables: Readonly<ResolvedChildEnv>,\n originalGitUrl: string,\n { token, username, password, hostType, matchHost }: HostRule,\n): ResolvedChildEnv {\n if (!token && !(username && password)) {\n logger.warn(\n { host: matchHost },\n `Could not create environment variable for host as neither token or username and password was set`,\n );\n return { ...environmentVariables };\n }\n\n let authenticationRules: AuthenticationRule[];\n if (token) {\n authenticationRules = getAuthenticationRulesWithToken(\n originalGitUrl,\n hostType,\n token,\n );\n } else {\n const encodedUsername = encodeURIComponent(username!);\n const encodedPassword = encodeURIComponent(password!);\n\n authenticationRules = getAuthenticationRules(\n originalGitUrl,\n hostType,\n `${encodedUsername}:${encodedPassword}`,\n );\n }\n\n return addGitConfigEnvironmentVariables(\n environmentVariables,\n authenticationRules.map((rule) => ({\n key: `url.${rule.url}.insteadOf`,\n value: rule.insteadOf,\n })),\n );\n}\n\nfunction getAuthenticationRulesWithToken(\n url: string,\n hostType: string | undefined | null,\n authToken: string,\n): AuthenticationRule[] {\n const type = hostType ?? detectPlatform(url);\n const platform =\n hostType && platformHostTypes.has(hostType)\n ? hostType\n : detectPlatform(url);\n return getAuthenticationRules(\n url,\n type,\n getTokenCredentials(platform, authToken),\n );\n}\n\n/**\n * Generates the authentication rules for later git usage for the given host\n * @link https://coolaj86.com/articles/vanilla-devops-git-credentials-cheatsheet/\n * @param gitUrl Git repository URL\n * @param hostType Git host type\n * @param token Authentication token or `username:password` string\n */\nexport function getAuthenticationRules(\n gitUrl: string,\n hostType: string | undefined | null,\n token: string,\n): AuthenticationRule[] {\n const authenticationRules = [];\n const hasUser = token.split(':').length > 1;\n const insteadUrl = parseGitUrl(gitUrl);\n let sshPort = insteadUrl.port;\n\n if (hostType === 'bitbucket-server') {\n // For Bitbucket Server/Data Center, `source` must be `bitbucket-server`\n // to generate HTTP(s) URLs correctly.\n // https://github.com/IonicaBizau/git-url-parse/blob/28828546c148d58bbcff61409915a4e1e8f7eb11/lib/index.js#L304\n insteadUrl.source = 'bitbucket-server';\n\n // sshPort is string, wrong type!\n // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/72361\n // https://github.com/IonicaBizau/parse-path/blob/87f71f273da90f85f6845937a70b7c032eeae4e3/lib/index.js#L45\n // v8 ignore next -- TODO: add test #40625\n if (!sshPort || isEmptyString(sshPort)) {\n // By default, bitbucket-server SSH port is 7999.\n // For non-default port, the generated auth config will likely be incorrect.\n sshPort = '7999';\n }\n }\n\n const url = { ...insteadUrl };\n // git-url-parse would prefix `x-token-auth:` again on bitbucket.org\n if (hasUser && url.source === 'bitbucket.org') {\n url.source = 'bitbucket';\n }\n const protocol = regEx(/^https?$/).test(url.protocol)\n ? url.protocol\n : 'https';\n\n // ssh protocol with user if empty\n url.token = hasUser ? token : `ssh:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n // only edge case, need to stringify ourself because the exact syntax is not supported by the library\n // https://github.com/IonicaBizau/git-url-parse/blob/246c9119fb42c2ea1c280028fe77c53eb34c190c/lib/index.js#L246\n insteadOf: `ssh://git@${insteadUrl.resource}${\n sshPort ? `:${sshPort}` : ''\n }/${insteadUrl.full_name}${insteadUrl.git_suffix ? '.git' : ''}`,\n });\n\n // alternative ssh protocol with user if empty\n url.token = hasUser ? token : `git:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: { ...insteadUrl, port: sshPort }.toString('ssh'),\n });\n\n // https protocol with no user as default fallback\n url.token = token;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: insteadUrl.toString(protocol),\n });\n\n return authenticationRules;\n}\n\nexport function getGitEnvironmentVariables(\n environmentVariables: Readonly<ResolvedChildEnv>,\n hostTypes: readonly string[] = [],\n): ResolvedChildEnv {\n let gitEnvironmentVariables: ResolvedChildEnv = { ...environmentVariables };\n\n // hard-coded logic to use authentication for github.com based on the githubToken for api.github.com\n const gitHubHostRule = find({\n hostType: 'github',\n url: 'https://api.github.com/',\n });\n\n if (gitHubHostRule?.token) {\n gitEnvironmentVariables = getGitAuthenticatedEnvironmentVariables(\n gitEnvironmentVariables,\n 'https://github.com/',\n gitHubHostRule,\n );\n }\n\n // Manager-scoped rules are opt-in so unrelated credentials are not exposed to Git.\n const gitAllowedHostTypes = new Set<string>([\n ...PLATFORM_HOST_TYPES,\n ...hostTypes,\n ]);\n\n // filter rules without `matchHost` and `token` or username and password and github api github rules\n const hostRules = getAll()\n .filter((r) => r.matchHost && (r.token ?? (r.username && r.password)))\n .filter((r) => !gitHubHostRule || !githubApiUrls.has(r.matchHost!));\n\n // for each hostRule without hostType we add additional authentication variables to the environmentVariables\n // for each hostRule with hostType we add additional authentication variables to the environmentVariables\n for (const hostRule of hostRules) {\n if (!hostRule.hostType || gitAllowedHostTypes.has(hostRule.hostType)) {\n gitEnvironmentVariables = addAuthFromHostRule(\n hostRule,\n gitEnvironmentVariables,\n );\n }\n }\n return gitEnvironmentVariables;\n}\n\nfunction addAuthFromHostRule(\n hostRule: HostRule,\n environmentVariables: Readonly<ResolvedChildEnv>,\n): ResolvedChildEnv {\n const httpUrl = createURLFromHostOrURL(hostRule.matchHost!)?.toString();\n if (isHttpUrl(httpUrl)) {\n logger.trace(`Adding Git authentication for ${httpUrl} using token auth.`);\n return getGitAuthenticatedEnvironmentVariables(\n environmentVariables,\n httpUrl!,\n hostRule,\n );\n }\n\n logger.debug(\n `Could not parse registryUrl ${hostRule.matchHost!} or not using http(s). Ignoring`,\n );\n return { ...environmentVariables };\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAM,oBAAoB,IAAI,IAAY,mBAAmB;AAE7D,MAAM,gCAAgB,IAAI,IAAI;CAC5B;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,wCACd,sBACA,gBACA,EAAE,OAAO,UAAU,UAAU,UAAU,aACrB;CAClB,IAAI,C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(url);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Gives a token without a `:`
|
|
12
|
+
* Gives a token without a `:` the username and non-empty password expected by the given platform.
|
|
13
13
|
* Tokens containing a `:` and tokens of other platforms are returned unchanged.
|
|
14
14
|
*/
|
|
15
15
|
function getTokenCredentials(platform, token) {
|
|
16
16
|
if (token.includes(":")) return token;
|
|
17
17
|
switch (platform) {
|
|
18
18
|
case "gitlab": return `gitlab-ci-token:${token}`;
|
|
19
|
-
case "
|
|
19
|
+
case "azure":
|
|
20
|
+
case "github":
|
|
21
|
+
case "scm-manager": return `x-access-token:${token}`;
|
|
22
|
+
case "bitbucket":
|
|
23
|
+
case "bitbucket-server": return `x-token-auth:${token}`;
|
|
20
24
|
case "gitea":
|
|
21
25
|
case "forgejo": return `${token}:x-oauth-basic`;
|
|
22
26
|
default: return token;
|
|
@@ -33,7 +37,10 @@ function getHttpUrl(url, token) {
|
|
|
33
37
|
parsedUrl.user = "";
|
|
34
38
|
parsedUrl.token = token ?? "";
|
|
35
39
|
const platform = detectPlatform(parsedUrl.toString(protocol));
|
|
36
|
-
if (token)
|
|
40
|
+
if (token) {
|
|
41
|
+
parsedUrl.token = getTokenCredentials(platform, token);
|
|
42
|
+
if (parsedUrl.source === "bitbucket.org") parsedUrl.source = "bitbucket";
|
|
43
|
+
}
|
|
37
44
|
switch (platform) {
|
|
38
45
|
case "bitbucket-server":
|
|
39
46
|
// v8 ignore else -- TODO: add test #40625
|
package/dist/util/git/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","names":["hostRules.find"],"sources":["../../../lib/util/git/url.ts"],"sourcesContent":["import gitUrlParse from 'git-url-parse';\nimport { logger } from '../../logger/index.ts';\nimport { detectPlatform } from '../common.ts';\nimport * as hostRules from '../host-rules.ts';\nimport { regEx } from '../regex.ts';\nimport { parseUrl } from '../url.ts';\n\nexport function parseGitUrl(url: string): gitUrlParse.GitUrl {\n return gitUrlParse(url);\n}\n\n/**\n * Gives a token without a `:`
|
|
1
|
+
{"version":3,"file":"url.js","names":["hostRules.find"],"sources":["../../../lib/util/git/url.ts"],"sourcesContent":["import gitUrlParse from 'git-url-parse';\nimport { logger } from '../../logger/index.ts';\nimport { detectPlatform } from '../common.ts';\nimport * as hostRules from '../host-rules.ts';\nimport { regEx } from '../regex.ts';\nimport { parseUrl } from '../url.ts';\n\nexport function parseGitUrl(url: string): gitUrlParse.GitUrl {\n return gitUrlParse(url);\n}\n\n/**\n * Gives a token without a `:` the username and non-empty password expected by the given platform.\n * Tokens containing a `:` and tokens of other platforms are returned unchanged.\n */\nexport function getTokenCredentials(\n platform: string | null | undefined,\n token: string,\n): string {\n if (token.includes(':')) {\n return token;\n }\n switch (platform) {\n case 'gitlab':\n return `gitlab-ci-token:${token}`;\n case 'azure':\n case 'github':\n case 'scm-manager':\n return `x-access-token:${token}`;\n case 'bitbucket':\n case 'bitbucket-server':\n return `x-token-auth:${token}`;\n case 'gitea':\n case 'forgejo':\n return `${token}:x-oauth-basic`;\n default:\n return token;\n }\n}\n\nexport function getHttpUrl(url: string, token?: string): string {\n const parsedUrl = parseGitUrl(url);\n\n let { protocol } = parsedUrl;\n const origProtocol = protocol;\n\n // Convert non-https URLs to https and strip port\n if (!regEx(/^https?$/).test(protocol)) {\n parsedUrl.port = '443';\n protocol = 'https';\n }\n\n parsedUrl.user = '';\n parsedUrl.token = token ?? '';\n\n const platform = detectPlatform(parsedUrl.toString(protocol));\n if (token) {\n parsedUrl.token = getTokenCredentials(platform, token);\n // git-url-parse would prefix `x-token-auth:` again on bitbucket.org\n if (parsedUrl.source === 'bitbucket.org') {\n parsedUrl.source = 'bitbucket';\n }\n }\n\n switch (platform) {\n case 'bitbucket-server':\n // SSH URLs look like ssh://git@git.my.com:7999/project/repo.git\n // HTTPS URLs look like https://git.my.com/scm/project/repo.git\n // git-url-parse can't detect bitbucket-server from SSH URL\n // and thus doesn't know it should insert '/scm/'\n // v8 ignore else -- TODO: add test #40625\n if (origProtocol === 'ssh') {\n parsedUrl.source = 'bitbucket-server';\n }\n break;\n }\n\n const httpUrl = parseUrl(parsedUrl.toString(protocol));\n // v8 ignore if: git-url-parse always produces a parseable URL string\n if (!httpUrl) {\n throw new Error(`Failed to parse git URL: ${parsedUrl.toString(protocol)}`);\n }\n return httpUrl.href;\n}\n\nexport function getRemoteUrlWithToken(url: string, hostType?: string): string {\n let coercedUrl: string;\n\n try {\n coercedUrl = getHttpUrl(url);\n } catch {\n logger.warn({ url }, `Attempting to use non-git url for git operations`);\n\n coercedUrl = url;\n }\n\n const hostRule = hostRules.find({ url: coercedUrl, hostType });\n\n if (hostRule?.token) {\n logger.debug(`Found hostRules token for url ${url}`);\n\n return getHttpUrl(url, encodeURIComponent(hostRule.token));\n }\n\n if (hostRule?.username && hostRule?.password) {\n logger.debug(`Found hostRules username and password for url ${url}`);\n const encodedUsername = encodeURIComponent(hostRule.username);\n const encodedPassword = encodeURIComponent(hostRule.password);\n\n return getHttpUrl(url, `${encodedUsername}:${encodedPassword}`);\n }\n\n return url;\n}\n"],"mappings":";;;;;;;AAOA,SAAgB,YAAY,KAAiC;CAC3D,OAAO,YAAY,GAAG;AACxB;;;;;AAMA,SAAgB,oBACd,UACA,OACQ;CACR,IAAI,MAAM,SAAS,GAAG,GACpB,OAAO;CAET,QAAQ,UAAR;EACE,KAAK,UACH,OAAO,mBAAmB;EAC5B,KAAK;EACL,KAAK;EACL,KAAK,eACH,OAAO,kBAAkB;EAC3B,KAAK;EACL,KAAK,oBACH,OAAO,gBAAgB;EACzB,KAAK;EACL,KAAK,WACH,OAAO,GAAG,MAAM;EAClB,SACE,OAAO;CACX;AACF;AAEA,SAAgB,WAAW,KAAa,OAAwB;CAC9D,MAAM,YAAY,YAAY,GAAG;CAEjC,IAAI,EAAE,aAAa;CACnB,MAAM,eAAe;CAGrB,IAAI,CAAC,MAAM,UAAU,CAAC,CAAC,KAAK,QAAQ,GAAG;EACrC,UAAU,OAAO;EACjB,WAAW;CACb;CAEA,UAAU,OAAO;CACjB,UAAU,QAAQ,SAAS;CAE3B,MAAM,WAAW,eAAe,UAAU,SAAS,QAAQ,CAAC;CAC5D,IAAI,OAAO;EACT,UAAU,QAAQ,oBAAoB,UAAU,KAAK;EAErD,IAAI,UAAU,WAAW,iBACvB,UAAU,SAAS;CAEvB;CAEA,QAAQ,UAAR;EACE,KAAK;;EAMH,IAAI,iBAAiB,OACnB,UAAU,SAAS;CAGzB;CAEA,MAAM,UAAU,SAAS,UAAU,SAAS,QAAQ,CAAC;;CAErD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,4BAA4B,UAAU,SAAS,QAAQ,GAAG;CAE5E,OAAO,QAAQ;AACjB;AAEA,SAAgB,sBAAsB,KAAa,UAA2B;CAC5E,IAAI;CAEJ,IAAI;EACF,aAAa,WAAW,GAAG;CAC7B,QAAQ;EACN,OAAO,KAAK,EAAE,IAAI,GAAG,kDAAkD;EAEvE,aAAa;CACf;CAEA,MAAM,WAAWA,KAAe;EAAE,KAAK;EAAY;CAAS,CAAC;CAE7D,IAAI,UAAU,OAAO;EACnB,OAAO,MAAM,iCAAiC,KAAK;EAEnD,OAAO,WAAW,KAAK,mBAAmB,SAAS,KAAK,CAAC;CAC3D;CAEA,IAAI,UAAU,YAAY,UAAU,UAAU;EAC5C,OAAO,MAAM,iDAAiD,KAAK;EAInE,OAAO,WAAW,KAAK,GAHC,mBAAmB,SAAS,QAGZ,EAAE,GAFlB,mBAAmB,SAAS,QAEO,GAAG;CAChE;CAEA,OAAO;AACT"}
|
|
@@ -217,6 +217,7 @@ async function executePostUpgradeCommands(config) {
|
|
|
217
217
|
manager: config.manager,
|
|
218
218
|
depName: config.upgrades.map(({ depName }) => depName).join(" "),
|
|
219
219
|
branchName: config.branchName,
|
|
220
|
+
constraints: config.constraints,
|
|
220
221
|
postUpgradeTasks: config.postUpgradeTasks.executionMode === "branch" ? config.postUpgradeTasks : void 0
|
|
221
222
|
}];
|
|
222
223
|
const { updatedArtifacts, artifactErrors } = await postUpgradeCommandsExecutor(config.upgrades.filter(({ postUpgradeTasks }) => !postUpgradeTasks?.executionMode || postUpgradeTasks.executionMode === "update"), config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-post-upgrade-commands.js","names":[],"sources":["../../../../../lib/workers/repository/update/branch/execute-post-upgrade-commands.ts"],"sourcesContent":["// TODO #22198\n\nimport crypto from 'node:crypto';\nimport { isArray, isNonEmptyArray, isString } from '@sindresorhus/is';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport { addMeta, logger } from '../../../../logger/index.ts';\nimport type { ArtifactError } from '../../../../modules/manager/types.ts';\nimport { coerceArray } from '../../../../util/array.ts';\nimport {\n type ExecOptions,\n isConstraintName,\n isToolName,\n} from '../../../../util/exec/types.ts';\nimport {\n ensureLocalDir,\n localPathIsFile,\n outputCacheFile,\n privateCacheDir,\n readLocalFile,\n statLocalFile,\n writeLocalFile,\n} from '../../../../util/fs/index.ts';\nimport { withGitEnvironment } from '../../../../util/git/exec.ts';\nimport {\n getRepoStatus,\n isFileModeEnabled,\n} from '../../../../util/git/index.ts';\nimport type { FileChange } from '../../../../util/git/types.ts';\nimport { minimatch } from '../../../../util/minimatch.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { sanitize } from '../../../../util/sanitize.ts';\nimport { compile } from '../../../../util/template/index.ts';\nimport type { BranchConfig, BranchUpgradeConfig } from '../../../types.ts';\n\nexport interface PostUpgradeCommandsExecutionResult {\n updatedArtifacts: FileChange[];\n artifactErrors: ArtifactError[];\n}\n\nconst ownerExecutePermission = 0o100;\nconst gitExec = withGitEnvironment();\n\nasync function detectExecutable(\n relativePath: string,\n canReadFileMode: boolean,\n): Promise<true | undefined> {\n if (!canReadFileMode) {\n return undefined;\n }\n\n const fileStats = await statLocalFile(relativePath);\n if (!fileStats?.isFile()) {\n return undefined;\n }\n\n if ((fileStats.mode & ownerExecutePermission) === 0) {\n return undefined;\n }\n\n // Git derives its executable flag from the owner's execute permission.\n return true;\n}\n\nexport async function postUpgradeCommandsExecutor(\n filteredUpgradeCommands: BranchUpgradeConfig[],\n config: BranchConfig,\n): Promise<PostUpgradeCommandsExecutionResult> {\n let updatedArtifacts = [...coerceArray(config.updatedArtifacts)];\n const artifactErrors = [...coerceArray(config.artifactErrors)];\n const allowedCommands = GlobalConfig.get('allowedCommands');\n\n for (const upgrade of filteredUpgradeCommands) {\n addMeta({ dep: upgrade.depName });\n logger.trace(\n {\n tasks: upgrade.postUpgradeTasks,\n allowedCommands,\n },\n `Checking for post-upgrade tasks`,\n );\n const commands = upgrade.postUpgradeTasks?.commands;\n const dataFileTemplate = upgrade.postUpgradeTasks?.dataFileTemplate;\n const fileFilters = upgrade.postUpgradeTasks?.fileFilters ?? ['**/*'];\n if (isNonEmptyArray(commands)) {\n // Persist updated files in file system so any executed commands can see them\n const previouslyModifiedFiles =\n config.updatedPackageFiles!.concat(updatedArtifacts);\n for (const file of previouslyModifiedFiles) {\n const canWriteFile = await localPathIsFile(file.path);\n if (file.type === 'addition' && !file.isSymlink && canWriteFile) {\n let contents: Buffer | null;\n if (isString(file.contents)) {\n contents = Buffer.from(file.contents);\n } else {\n contents = file.contents;\n }\n // TODO #22198\n await writeLocalFile(file.path, contents!);\n }\n }\n\n let dataFilePath: string | null = null;\n if (dataFileTemplate) {\n const dataFileContent = sanitize(\n compile(dataFileTemplate, mergeChildConfig(config, upgrade)),\n );\n logger.debug(\n { dataFileTemplate },\n 'Processed post-upgrade commands data file template.',\n );\n\n const dataFileName = `post-upgrade-data-file-${crypto.randomBytes(8).toString('hex')}.tmp`;\n dataFilePath = upath.join(privateCacheDir(), dataFileName);\n\n try {\n await outputCacheFile(dataFilePath, dataFileContent);\n\n logger.debug(\n { dataFilePath, dataFileContent },\n 'Created post-upgrade commands data file.',\n );\n } catch (error) {\n artifactErrors.push({\n stderr: sanitize(\n `Failed to create post-upgrade commands data file at ${dataFilePath}, reason: ${error.message}`,\n ),\n });\n\n dataFilePath = null;\n }\n }\n\n const workingDirTemplate = upgrade.postUpgradeTasks?.workingDirTemplate;\n let workingDir = GlobalConfig.get('localDir');\n\n if (workingDirTemplate) {\n workingDir = sanitize(\n compile(workingDirTemplate, mergeChildConfig(config, upgrade)),\n );\n workingDir = await ensureLocalDir(workingDir);\n logger.trace(\n { workingDirTemplate },\n 'Processed post-upgrade commands working directory template.',\n );\n }\n\n for (const cmd of commands) {\n const compiledCmd = compile(cmd, mergeChildConfig(config, upgrade));\n if (compiledCmd !== cmd) {\n logger.debug(\n { rawCmd: cmd, compiledCmd },\n 'Post-upgrade command has been compiled',\n );\n }\n if (compiledCmd === '') {\n logger.trace({ rawCmd: cmd }, 'Skipping empty post-upgrade task');\n continue;\n }\n if (\n allowedCommands.some((pattern) => regEx(pattern).test(compiledCmd))\n ) {\n try {\n logger.trace({ cmd: compiledCmd }, 'Executing post-upgrade task');\n\n const execOpts: ExecOptions = {\n // oxlint-disable-next-line renovate/no-exec-shell-option -- some self-hosted adminstrators allow their users to use shell features (pipes, globbing, sub-shells), so this is allowed for that purpose when it's opted in via allowShellExecutorForPostUpgradeCommands\n shell: GlobalConfig.get(\n 'allowShellExecutorForPostUpgradeCommands',\n ),\n\n cwd: workingDir,\n };\n if (dataFilePath) {\n execOpts.env = {\n RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE: dataFilePath,\n };\n }\n if (upgrade.postUpgradeTasks?.installTools) {\n execOpts.toolConstraints ??= [];\n\n for (const [tool] of Object.entries(\n upgrade.postUpgradeTasks?.installTools,\n )) {\n const validTool = isToolName(tool);\n const validConstraint = isConstraintName(tool);\n if (!validTool) {\n logger.warn(\n {\n tool,\n validTool,\n validConstraint,\n },\n 'Skipping constraint that is not a tool that Containerbase knows',\n );\n continue;\n }\n\n execOpts.toolConstraints.push({\n toolName: tool,\n constraint: upgrade.constraints?.[tool],\n });\n }\n }\n const execResult = await gitExec(compiledCmd, execOpts);\n\n logger.debug(\n { cmd: compiledCmd, ...execResult },\n 'Executed post-upgrade task',\n );\n } catch (error) {\n artifactErrors.push({\n fileName: upgrade.packageFile,\n stderr: sanitize(error.message),\n });\n }\n } else {\n logger.warn(\n {\n cmd: compiledCmd,\n allowedCommands,\n },\n 'Post-upgrade task did not match any on allowedCommands list',\n );\n artifactErrors.push({\n fileName: upgrade.packageFile,\n stderr: sanitize(\n `Post-upgrade command '${compiledCmd}' has not been added to the allowed list in allowedCommands`,\n ),\n });\n }\n }\n\n const status = await getRepoStatus();\n\n logger.trace({ status }, 'git status after post-upgrade tasks');\n\n logger.debug(\n {\n addedCount: status.not_added?.length,\n modifiedCount: status.modified?.length,\n deletedCount: status.deleted?.length,\n renamedCount: status.renamed?.length,\n },\n 'git status counts after post-upgrade tasks',\n );\n\n const addedOrModifiedFiles = [\n ...coerceArray(status.not_added),\n ...coerceArray(status.modified),\n ...coerceArray(status.renamed?.map((x) => x.to)),\n ];\n const changedFiles = [\n ...addedOrModifiedFiles,\n ...coerceArray(status.deleted),\n ...coerceArray(status.renamed?.map((x) => x.from)),\n ];\n\n // Check for files which were previously deleted but have been re-added without modification\n const previouslyDeletedFiles = updatedArtifacts.filter(\n (ua) => ua.type === 'deletion',\n );\n for (const previouslyDeletedFile of previouslyDeletedFiles) {\n /* v8 ignore if -- TODO: needs test */\n if (!changedFiles.includes(previouslyDeletedFile.path)) {\n logger.debug(\n { file: previouslyDeletedFile.path },\n 'Previously deleted file has been restored without modification',\n );\n updatedArtifacts = updatedArtifacts.filter(\n (ua) =>\n !(\n ua.type === 'deletion' && ua.path === previouslyDeletedFile.path\n ),\n );\n }\n }\n\n logger.trace({ addedOrModifiedFiles }, 'Added or modified files');\n logger.debug(\n `Checking ${addedOrModifiedFiles.length} added or modified files for post-upgrade changes`,\n );\n\n const fileExcludes: string[] = [];\n if (config.npmrc) {\n fileExcludes.push('.npmrc');\n }\n const canReadFileMode = await isFileModeEnabled();\n\n for (const relativePath of addedOrModifiedFiles) {\n if (\n fileExcludes.some((pattern) =>\n minimatch(pattern, { dot: true }).match(relativePath),\n )\n ) {\n continue;\n }\n\n let fileMatched = false;\n for (const pattern of fileFilters) {\n if (minimatch(pattern, { dot: true }).match(relativePath)) {\n fileMatched = true;\n logger.debug(\n { file: relativePath, pattern },\n 'Post-upgrade file saved',\n );\n const existingContent = await readLocalFile(relativePath);\n const isExecutable = await detectExecutable(\n relativePath,\n canReadFileMode,\n );\n const existingUpdatedArtifacts = updatedArtifacts.find(\n (ua) => ua.path === relativePath,\n );\n if (existingUpdatedArtifacts?.type === 'addition') {\n existingUpdatedArtifacts.contents = existingContent;\n if (isExecutable !== undefined) {\n existingUpdatedArtifacts.isExecutable = isExecutable;\n }\n } else {\n const updatedArtifact: FileChange = {\n type: 'addition',\n path: relativePath,\n contents: existingContent,\n };\n if (isExecutable !== undefined) {\n updatedArtifact.isExecutable = isExecutable;\n }\n updatedArtifacts.push(updatedArtifact);\n }\n // If the file is deleted by a previous post-update command, remove the deletion from updatedArtifacts\n updatedArtifacts = updatedArtifacts.filter(\n (ua) => !(ua.type === 'deletion' && ua.path === relativePath),\n );\n }\n }\n if (!fileMatched) {\n logger.debug(\n { file: relativePath },\n 'Post-upgrade file did not match any file filters',\n );\n }\n }\n\n for (const relativePath of coerceArray(status.deleted)) {\n for (const pattern of fileFilters) {\n if (minimatch(pattern, { dot: true }).match(relativePath)) {\n if (\n !updatedArtifacts.some(\n (ua) => ua.path === relativePath && ua.type === 'deletion',\n )\n ) {\n logger.debug(\n { file: relativePath, pattern },\n 'Post-upgrade file removed',\n );\n updatedArtifacts.push({\n type: 'deletion',\n path: relativePath,\n });\n }\n // If the file is created or modified by a previous post-update command, remove the modification from updatedArtifacts\n updatedArtifacts = updatedArtifacts.filter(\n (ua) => !(ua.type === 'addition' && ua.path === relativePath),\n );\n }\n }\n }\n }\n }\n return { updatedArtifacts, artifactErrors };\n}\n\nexport default async function executePostUpgradeCommands(\n config: BranchConfig,\n): Promise<PostUpgradeCommandsExecutionResult | null> {\n const hasChangedFiles =\n (isArray(config.updatedPackageFiles) &&\n config.updatedPackageFiles.length > 0) ||\n (isArray(config.updatedArtifacts) && config.updatedArtifacts.length > 0);\n\n if (!hasChangedFiles) {\n /* Only run post-upgrade tasks if there are changes to package files... */\n logger.debug('No changes to package files, skipping post-upgrade tasks');\n return null;\n }\n\n const branchUpgradeCommands: BranchUpgradeConfig[] = [\n {\n manager: config.manager,\n depName: config.upgrades.map(({ depName }) => depName).join(' '),\n branchName: config.branchName,\n postUpgradeTasks:\n config.postUpgradeTasks!.executionMode === 'branch'\n ? config.postUpgradeTasks\n : undefined,\n },\n ];\n\n const updateUpgradeCommands: BranchUpgradeConfig[] = config.upgrades.filter(\n ({ postUpgradeTasks }) =>\n !postUpgradeTasks?.executionMode ||\n postUpgradeTasks.executionMode === 'update',\n );\n\n const { updatedArtifacts, artifactErrors } =\n await postUpgradeCommandsExecutor(updateUpgradeCommands, config);\n return postUpgradeCommandsExecutor(branchUpgradeCommands, {\n ...config,\n updatedArtifacts,\n artifactErrors,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,MAAM,yBAAyB;AAC/B,MAAM,UAAU,mBAAmB;AAEnC,eAAe,iBACb,cACA,iBAC2B;CAC3B,IAAI,CAAC,iBACH;CAGF,MAAM,YAAY,MAAM,cAAc,YAAY;CAClD,IAAI,CAAC,WAAW,OAAO,GACrB;CAGF,KAAK,UAAU,OAAO,4BAA4B,GAChD;CAIF,OAAO;AACT;AAEA,eAAsB,4BACpB,yBACA,QAC6C;CAC7C,IAAI,mBAAmB,CAAC,GAAG,YAAY,OAAO,gBAAgB,CAAC;CAC/D,MAAM,iBAAiB,CAAC,GAAG,YAAY,OAAO,cAAc,CAAC;CAC7D,MAAM,kBAAkB,aAAa,IAAI,iBAAiB;CAE1D,KAAK,MAAM,WAAW,yBAAyB;EAC7C,QAAQ,EAAE,KAAK,QAAQ,QAAQ,CAAC;EAChC,OAAO,MACL;GACE,OAAO,QAAQ;GACf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0D;EACvE,OAAO;CACT;CAEA,MAAM,wBAA+C,CACnD;EACE,SAAS,OAAO;EAChB,SAAS,OAAO,SAAS,KAAK,EAAE,cAAc,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D,YAAY,OAAO;EACnB,kBACE,OAAO,iBAAkB,kBAAkB,WACvC,OAAO,mBACP,KAAA;CACR,CACF;CAQA,MAAM,EAAE,kBAAkB,mBACxB,MAAM,4BAP6C,OAAO,SAAS,QAClE,EAAE,uBACD,CAAC,kBAAkB,iBACnB,iBAAiB,kBAAkB,QAIiB,GAAG,MAAM;CACjE,OAAO,4BAA4B,uBAAuB;EACxD,GAAG;EACH;EACA;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"execute-post-upgrade-commands.js","names":[],"sources":["../../../../../lib/workers/repository/update/branch/execute-post-upgrade-commands.ts"],"sourcesContent":["// TODO #22198\n\nimport crypto from 'node:crypto';\nimport { isArray, isNonEmptyArray, isString } from '@sindresorhus/is';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport { addMeta, logger } from '../../../../logger/index.ts';\nimport type { ArtifactError } from '../../../../modules/manager/types.ts';\nimport { coerceArray } from '../../../../util/array.ts';\nimport {\n type ExecOptions,\n isConstraintName,\n isToolName,\n} from '../../../../util/exec/types.ts';\nimport {\n ensureLocalDir,\n localPathIsFile,\n outputCacheFile,\n privateCacheDir,\n readLocalFile,\n statLocalFile,\n writeLocalFile,\n} from '../../../../util/fs/index.ts';\nimport { withGitEnvironment } from '../../../../util/git/exec.ts';\nimport {\n getRepoStatus,\n isFileModeEnabled,\n} from '../../../../util/git/index.ts';\nimport type { FileChange } from '../../../../util/git/types.ts';\nimport { minimatch } from '../../../../util/minimatch.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { sanitize } from '../../../../util/sanitize.ts';\nimport { compile } from '../../../../util/template/index.ts';\nimport type { BranchConfig, BranchUpgradeConfig } from '../../../types.ts';\n\nexport interface PostUpgradeCommandsExecutionResult {\n updatedArtifacts: FileChange[];\n artifactErrors: ArtifactError[];\n}\n\nconst ownerExecutePermission = 0o100;\nconst gitExec = withGitEnvironment();\n\nasync function detectExecutable(\n relativePath: string,\n canReadFileMode: boolean,\n): Promise<true | undefined> {\n if (!canReadFileMode) {\n return undefined;\n }\n\n const fileStats = await statLocalFile(relativePath);\n if (!fileStats?.isFile()) {\n return undefined;\n }\n\n if ((fileStats.mode & ownerExecutePermission) === 0) {\n return undefined;\n }\n\n // Git derives its executable flag from the owner's execute permission.\n return true;\n}\n\nexport async function postUpgradeCommandsExecutor(\n filteredUpgradeCommands: BranchUpgradeConfig[],\n config: BranchConfig,\n): Promise<PostUpgradeCommandsExecutionResult> {\n let updatedArtifacts = [...coerceArray(config.updatedArtifacts)];\n const artifactErrors = [...coerceArray(config.artifactErrors)];\n const allowedCommands = GlobalConfig.get('allowedCommands');\n\n for (const upgrade of filteredUpgradeCommands) {\n addMeta({ dep: upgrade.depName });\n logger.trace(\n {\n tasks: upgrade.postUpgradeTasks,\n allowedCommands,\n },\n `Checking for post-upgrade tasks`,\n );\n const commands = upgrade.postUpgradeTasks?.commands;\n const dataFileTemplate = upgrade.postUpgradeTasks?.dataFileTemplate;\n const fileFilters = upgrade.postUpgradeTasks?.fileFilters ?? ['**/*'];\n if (isNonEmptyArray(commands)) {\n // Persist updated files in file system so any executed commands can see them\n const previouslyModifiedFiles =\n config.updatedPackageFiles!.concat(updatedArtifacts);\n for (const file of previouslyModifiedFiles) {\n const canWriteFile = await localPathIsFile(file.path);\n if (file.type === 'addition' && !file.isSymlink && canWriteFile) {\n let contents: Buffer | null;\n if (isString(file.contents)) {\n contents = Buffer.from(file.contents);\n } else {\n contents = file.contents;\n }\n // TODO #22198\n await writeLocalFile(file.path, contents!);\n }\n }\n\n let dataFilePath: string | null = null;\n if (dataFileTemplate) {\n const dataFileContent = sanitize(\n compile(dataFileTemplate, mergeChildConfig(config, upgrade)),\n );\n logger.debug(\n { dataFileTemplate },\n 'Processed post-upgrade commands data file template.',\n );\n\n const dataFileName = `post-upgrade-data-file-${crypto.randomBytes(8).toString('hex')}.tmp`;\n dataFilePath = upath.join(privateCacheDir(), dataFileName);\n\n try {\n await outputCacheFile(dataFilePath, dataFileContent);\n\n logger.debug(\n { dataFilePath, dataFileContent },\n 'Created post-upgrade commands data file.',\n );\n } catch (error) {\n artifactErrors.push({\n stderr: sanitize(\n `Failed to create post-upgrade commands data file at ${dataFilePath}, reason: ${error.message}`,\n ),\n });\n\n dataFilePath = null;\n }\n }\n\n const workingDirTemplate = upgrade.postUpgradeTasks?.workingDirTemplate;\n let workingDir = GlobalConfig.get('localDir');\n\n if (workingDirTemplate) {\n workingDir = sanitize(\n compile(workingDirTemplate, mergeChildConfig(config, upgrade)),\n );\n workingDir = await ensureLocalDir(workingDir);\n logger.trace(\n { workingDirTemplate },\n 'Processed post-upgrade commands working directory template.',\n );\n }\n\n for (const cmd of commands) {\n const compiledCmd = compile(cmd, mergeChildConfig(config, upgrade));\n if (compiledCmd !== cmd) {\n logger.debug(\n { rawCmd: cmd, compiledCmd },\n 'Post-upgrade command has been compiled',\n );\n }\n if (compiledCmd === '') {\n logger.trace({ rawCmd: cmd }, 'Skipping empty post-upgrade task');\n continue;\n }\n if (\n allowedCommands.some((pattern) => regEx(pattern).test(compiledCmd))\n ) {\n try {\n logger.trace({ cmd: compiledCmd }, 'Executing post-upgrade task');\n\n const execOpts: ExecOptions = {\n // oxlint-disable-next-line renovate/no-exec-shell-option -- some self-hosted adminstrators allow their users to use shell features (pipes, globbing, sub-shells), so this is allowed for that purpose when it's opted in via allowShellExecutorForPostUpgradeCommands\n shell: GlobalConfig.get(\n 'allowShellExecutorForPostUpgradeCommands',\n ),\n\n cwd: workingDir,\n };\n if (dataFilePath) {\n execOpts.env = {\n RENOVATE_POST_UPGRADE_COMMAND_DATA_FILE: dataFilePath,\n };\n }\n if (upgrade.postUpgradeTasks?.installTools) {\n execOpts.toolConstraints ??= [];\n\n for (const [tool] of Object.entries(\n upgrade.postUpgradeTasks?.installTools,\n )) {\n const validTool = isToolName(tool);\n const validConstraint = isConstraintName(tool);\n if (!validTool) {\n logger.warn(\n {\n tool,\n validTool,\n validConstraint,\n },\n 'Skipping constraint that is not a tool that Containerbase knows',\n );\n continue;\n }\n\n execOpts.toolConstraints.push({\n toolName: tool,\n constraint: upgrade.constraints?.[tool],\n });\n }\n }\n const execResult = await gitExec(compiledCmd, execOpts);\n\n logger.debug(\n { cmd: compiledCmd, ...execResult },\n 'Executed post-upgrade task',\n );\n } catch (error) {\n artifactErrors.push({\n fileName: upgrade.packageFile,\n stderr: sanitize(error.message),\n });\n }\n } else {\n logger.warn(\n {\n cmd: compiledCmd,\n allowedCommands,\n },\n 'Post-upgrade task did not match any on allowedCommands list',\n );\n artifactErrors.push({\n fileName: upgrade.packageFile,\n stderr: sanitize(\n `Post-upgrade command '${compiledCmd}' has not been added to the allowed list in allowedCommands`,\n ),\n });\n }\n }\n\n const status = await getRepoStatus();\n\n logger.trace({ status }, 'git status after post-upgrade tasks');\n\n logger.debug(\n {\n addedCount: status.not_added?.length,\n modifiedCount: status.modified?.length,\n deletedCount: status.deleted?.length,\n renamedCount: status.renamed?.length,\n },\n 'git status counts after post-upgrade tasks',\n );\n\n const addedOrModifiedFiles = [\n ...coerceArray(status.not_added),\n ...coerceArray(status.modified),\n ...coerceArray(status.renamed?.map((x) => x.to)),\n ];\n const changedFiles = [\n ...addedOrModifiedFiles,\n ...coerceArray(status.deleted),\n ...coerceArray(status.renamed?.map((x) => x.from)),\n ];\n\n // Check for files which were previously deleted but have been re-added without modification\n const previouslyDeletedFiles = updatedArtifacts.filter(\n (ua) => ua.type === 'deletion',\n );\n for (const previouslyDeletedFile of previouslyDeletedFiles) {\n /* v8 ignore if -- TODO: needs test */\n if (!changedFiles.includes(previouslyDeletedFile.path)) {\n logger.debug(\n { file: previouslyDeletedFile.path },\n 'Previously deleted file has been restored without modification',\n );\n updatedArtifacts = updatedArtifacts.filter(\n (ua) =>\n !(\n ua.type === 'deletion' && ua.path === previouslyDeletedFile.path\n ),\n );\n }\n }\n\n logger.trace({ addedOrModifiedFiles }, 'Added or modified files');\n logger.debug(\n `Checking ${addedOrModifiedFiles.length} added or modified files for post-upgrade changes`,\n );\n\n const fileExcludes: string[] = [];\n if (config.npmrc) {\n fileExcludes.push('.npmrc');\n }\n const canReadFileMode = await isFileModeEnabled();\n\n for (const relativePath of addedOrModifiedFiles) {\n if (\n fileExcludes.some((pattern) =>\n minimatch(pattern, { dot: true }).match(relativePath),\n )\n ) {\n continue;\n }\n\n let fileMatched = false;\n for (const pattern of fileFilters) {\n if (minimatch(pattern, { dot: true }).match(relativePath)) {\n fileMatched = true;\n logger.debug(\n { file: relativePath, pattern },\n 'Post-upgrade file saved',\n );\n const existingContent = await readLocalFile(relativePath);\n const isExecutable = await detectExecutable(\n relativePath,\n canReadFileMode,\n );\n const existingUpdatedArtifacts = updatedArtifacts.find(\n (ua) => ua.path === relativePath,\n );\n if (existingUpdatedArtifacts?.type === 'addition') {\n existingUpdatedArtifacts.contents = existingContent;\n if (isExecutable !== undefined) {\n existingUpdatedArtifacts.isExecutable = isExecutable;\n }\n } else {\n const updatedArtifact: FileChange = {\n type: 'addition',\n path: relativePath,\n contents: existingContent,\n };\n if (isExecutable !== undefined) {\n updatedArtifact.isExecutable = isExecutable;\n }\n updatedArtifacts.push(updatedArtifact);\n }\n // If the file is deleted by a previous post-update command, remove the deletion from updatedArtifacts\n updatedArtifacts = updatedArtifacts.filter(\n (ua) => !(ua.type === 'deletion' && ua.path === relativePath),\n );\n }\n }\n if (!fileMatched) {\n logger.debug(\n { file: relativePath },\n 'Post-upgrade file did not match any file filters',\n );\n }\n }\n\n for (const relativePath of coerceArray(status.deleted)) {\n for (const pattern of fileFilters) {\n if (minimatch(pattern, { dot: true }).match(relativePath)) {\n if (\n !updatedArtifacts.some(\n (ua) => ua.path === relativePath && ua.type === 'deletion',\n )\n ) {\n logger.debug(\n { file: relativePath, pattern },\n 'Post-upgrade file removed',\n );\n updatedArtifacts.push({\n type: 'deletion',\n path: relativePath,\n });\n }\n // If the file is created or modified by a previous post-update command, remove the modification from updatedArtifacts\n updatedArtifacts = updatedArtifacts.filter(\n (ua) => !(ua.type === 'addition' && ua.path === relativePath),\n );\n }\n }\n }\n }\n }\n return { updatedArtifacts, artifactErrors };\n}\n\nexport default async function executePostUpgradeCommands(\n config: BranchConfig,\n): Promise<PostUpgradeCommandsExecutionResult | null> {\n const hasChangedFiles =\n (isArray(config.updatedPackageFiles) &&\n config.updatedPackageFiles.length > 0) ||\n (isArray(config.updatedArtifacts) && config.updatedArtifacts.length > 0);\n\n if (!hasChangedFiles) {\n /* Only run post-upgrade tasks if there are changes to package files... */\n logger.debug('No changes to package files, skipping post-upgrade tasks');\n return null;\n }\n\n const branchUpgradeCommands: BranchUpgradeConfig[] = [\n {\n manager: config.manager,\n depName: config.upgrades.map(({ depName }) => depName).join(' '),\n branchName: config.branchName,\n constraints: config.constraints,\n postUpgradeTasks:\n config.postUpgradeTasks!.executionMode === 'branch'\n ? config.postUpgradeTasks\n : undefined,\n },\n ];\n\n const updateUpgradeCommands: BranchUpgradeConfig[] = config.upgrades.filter(\n ({ postUpgradeTasks }) =>\n !postUpgradeTasks?.executionMode ||\n postUpgradeTasks.executionMode === 'update',\n );\n\n const { updatedArtifacts, artifactErrors } =\n await postUpgradeCommandsExecutor(updateUpgradeCommands, config);\n return postUpgradeCommandsExecutor(branchUpgradeCommands, {\n ...config,\n updatedArtifacts,\n artifactErrors,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAyCA,MAAM,yBAAyB;AAC/B,MAAM,UAAU,mBAAmB;AAEnC,eAAe,iBACb,cACA,iBAC2B;CAC3B,IAAI,CAAC,iBACH;CAGF,MAAM,YAAY,MAAM,cAAc,YAAY;CAClD,IAAI,CAAC,WAAW,OAAO,GACrB;CAGF,KAAK,UAAU,OAAO,4BAA4B,GAChD;CAIF,OAAO;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AC;IACH;IAEA,mBAAmB,iBAAiB,QACjC,OAAO,EAAE,GAAG,SAAS,cAAc,GAAG,SAAS,aAClD;GACF;EAGN;CACF;CACA,OAAO;EAAE;EAAkB;CAAe;AAC5C;AAEA,eAA8B,2BAC5B,QACoD;CAMpD,IAAI,EAJD,QAAQ,OAAO,mBAAmB,KACjC,OAAO,oBAAoB,SAAS,KACrC,QAAQ,OAAO,gBAAgB,KAAK,OAAO,iBAAiB,SAAS,IAElD;EAEpB,OAAO,MAAM,0DAA0D;EACvE,OAAO;CACT;CAEA,MAAM,wBAA+C,CACnD;EACE,SAAS,OAAO;EAChB,SAAS,OAAO,SAAS,KAAK,EAAE,cAAc,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D,YAAY,OAAO;EACnB,aAAa,OAAO;EACpB,kBACE,OAAO,iBAAkB,kBAAkB,WACvC,OAAO,mBACP,KAAA;CACR,CACF;CAQA,MAAM,EAAE,kBAAkB,mBACxB,MAAM,4BAP6C,OAAO,SAAS,QAClE,EAAE,uBACD,CAAC,kBAAkB,iBACnB,iBAAiB,kBAAkB,QAIiB,GAAG,MAAM;CACjE,OAAO,4BAA4B,uBAAuB;EACxD,GAAG;EACH;EACA;CACF,CAAC;AACH"}
|
package/package.json
CHANGED
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 44.164.
|
|
3
|
+
"title": "JSON schema for Renovate 44.164.5 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.164.
|
|
5
|
+
"x-renovate-version": "44.164.5",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|