renovate 43.31.3 → 43.31.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/config-validator.js +1 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/instrumentation/index.js +2 -4
- package/dist/instrumentation/index.js.map +1 -1
- package/dist/renovate.js +11 -11
- package/dist/renovate.js.map +1 -1
- package/dist/util/unicode.js +5 -1
- package/dist/util/unicode.js.map +1 -1
- package/dist/workers/global/index.js +1 -1
- package/dist/workers/repository/index.js +1 -1
- package/package.json +1 -1
- package/renovate-schema.json +2 -2
package/dist/config-validator.js
CHANGED
|
@@ -11,8 +11,8 @@ import { validateConfig } from "./config/validation.js";
|
|
|
11
11
|
import { getParsedContent } from "./workers/global/config/parse/util.js";
|
|
12
12
|
import { getConfig } from "./workers/global/config/parse/file.js";
|
|
13
13
|
import { parseConfigs } from "./workers/global/config/parse/index.js";
|
|
14
|
-
import { Command, CommanderError } from "commander";
|
|
15
14
|
import "source-map-support/register.js";
|
|
15
|
+
import { Command, CommanderError } from "commander";
|
|
16
16
|
import { dequal } from "dequal";
|
|
17
17
|
import fs from "fs-extra";
|
|
18
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-validator.js","names":["getFileConfig"],"sources":["../lib/config-validator.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command, CommanderError } from 'commander';\nimport 'source-map-support/register.js';\nimport './punycode.cjs';\nimport { dequal } from 'dequal';\nimport fs from 'fs-extra';\nimport { getConfigFileNames } from './config/app-strings.ts';\nimport { GlobalConfig } from './config/global.ts';\nimport { massageConfig } from './config/massage.ts';\nimport { migrateConfig } from './config/migration.ts';\nimport type { RenovateConfig } from './config/types.ts';\nimport { validateConfig } from './config/validation.ts';\nimport { pkg } from './expose.ts';\nimport { logger } from './logger/index.ts';\nimport { getEnv } from './util/env.ts';\nimport { getConfig as getFileConfig } from './workers/global/config/parse/file.ts';\nimport { parseConfigs } from './workers/global/config/parse/index.ts';\nimport { getParsedContent } from './workers/global/config/parse/util.ts';\n\nconst { pathExists, readFile } = fs;\n\nlet returnVal = 0;\n\n/**\n * Make sure that we've resolved configuration from the different places that Renovate users would expect them to be specified\n *\n * This then allows a `configType=repo` config to i.e. be validated alongside a `config.js` or `env RENOVATE_ALLOWED_COMMANDS=...`\n *\n * Note that we intentionally don't fully initialize Renovate and its modules, as we're not fully running, and it would require a Platform to be configured\n * */\nasync function partiallyGlobalInitialize(): Promise<void> {\n // NOTE that this doesn't allow command-line arguments\n const globalConfig = await parseConfigs(getEnv(), []);\n GlobalConfig.set(globalConfig);\n}\n\nasync function validate(\n configType: 'global' | 'repo',\n desc: string,\n config: RenovateConfig,\n strict: boolean,\n isPreset = false,\n): Promise<void> {\n const { isMigrated, migratedConfig } = migrateConfig(config);\n if (isMigrated) {\n logger.warn(\n {\n oldConfig: config,\n newConfig: migratedConfig,\n },\n 'Config migration necessary',\n );\n if (strict) {\n returnVal = 1;\n }\n }\n const massagedConfig = massageConfig(migratedConfig);\n const res = await validateConfig(configType, massagedConfig, isPreset);\n if (res.errors.length) {\n logger.error(\n { file: desc, errors: res.errors },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n if (res.warnings.length) {\n logger.warn(\n { file: desc, warnings: res.warnings },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n}\n\ninterface PackageJson {\n renovate?: RenovateConfig;\n 'renovate-config'?: Record<string, RenovateConfig>;\n}\n\n(async () => {\n await partiallyGlobalInitialize();\n\n const program = new Command('renovate-config-validator')\n .summary('Validate Renovate configuration files')\n .description(\n `Validate your Renovate configuration (repo config, shared presets or global configuration) files\\n` +\n 'If no [config-files...] are given, renovate-config-validator will look at the default config file locations (https://docs.renovatebot.com/configuration-options/)',\n )\n .addHelpText(\n 'after',\n `\nWhen specifying [config-files...], Renovate will treat them as global self-hosted configuration files. You can disable this behaviour with --no-global\n\nExamples:\n\n $ renovate-config-validator\n $ renovate-config-validator --strict\n $ renovate-config-validator first_config.json\n $ renovate-config-validator --strict config.js\n $ renovate-config-validator --no-global renovate.json5\n $ env RENOVATE_CONFIG_FILE=obscure-name.json renovate-config-validator\n\nGlobal configuration:\n\nIf you have specified global self-hosted configuration (https://docs.renovatebot.com/self-hosted-configuration/) in environment variables or in a \\`config.js\\`, this will be detected:\n\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator\n # if passing the filename, make sure it's not validating as a global config\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator --no-global renovate.json`,\n )\n .argument('[config-files...]')\n .version(pkg.version, '-v, --version')\n .option(\n '--strict',\n 'Fail command if any configuration warnings, errors, or a migration is needed',\n )\n .option(\n '--no-global',\n 'When specifying [config-files], do not treat them as global self-hosted configuration file(s)',\n true,\n )\n // allow us to manage the exit code\n .exitOverride();\n\n program.action(async (files, opts) => {\n const strict = opts.strict ?? false;\n\n if (files.length) {\n let isGlobalConfig = true;\n if (opts.global === false) {\n isGlobalConfig = false;\n }\n const configType = isGlobalConfig ? 'global' : 'repo';\n for (const file of files) {\n try {\n if (!(await pathExists(file))) {\n returnVal = 1;\n logger.error({ file }, 'File does not exist');\n break;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file} as ${configType} config`);\n await validate(configType, file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n }\n } else {\n for (const file of getConfigFileNames().filter(\n (name) => name !== 'package.json',\n )) {\n try {\n if (!(await pathExists(file))) {\n continue;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file}`);\n await validate('repo', file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n }\n try {\n const pkgJson = JSON.parse(\n await readFile('package.json', 'utf8'),\n ) as PackageJson;\n if (pkgJson.renovate) {\n logger.info(`Validating package.json > renovate`);\n await validate(\n 'repo',\n 'package.json > renovate',\n pkgJson.renovate,\n strict,\n );\n }\n if (pkgJson['renovate-config']) {\n logger.info(`Validating package.json > renovate-config`);\n for (const presetConfig of Object.values(\n pkgJson['renovate-config'],\n )) {\n await validate(\n 'repo',\n 'package.json > renovate-config',\n presetConfig,\n strict,\n true,\n );\n }\n }\n } catch {\n // ignore\n }\n try {\n const env = getEnv();\n const fileConfig = await getFileConfig(env);\n if (!dequal(fileConfig, {})) {\n const file = env.RENOVATE_CONFIG_FILE ?? 'config.js';\n logger.info(`Validating ${file}`);\n try {\n await validate('global', file, fileConfig, strict);\n } catch (err) {\n logger.error({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n }\n } catch {\n // ignore\n }\n }\n if (returnVal !== 0) {\n process.exit(returnVal);\n }\n logger.info('Config validated successfully');\n });\n\n await program.parseAsync();\n})().catch((e) => {\n if (e instanceof CommanderError) {\n // Commander throws an error at the end of Action execution i.e. as part of the `help` command, and so we don't want to return an error code in this case\n if (e.code === 'commander.helpDisplayed') {\n return;\n }\n }\n\n // oxlint-disable-next-line no-console -- intentional: display critical error on CLI\n console.error(e);\n process.exit(99);\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,EAAE,YAAY,aAAa;AAEjC,IAAI,YAAY;;;;;;;;AAShB,eAAe,4BAA2C;CAExD,MAAM,eAAe,MAAM,aAAa,QAAQ,EAAE,EAAE,CAAC;AACrD,cAAa,IAAI,aAAa;;AAGhC,eAAe,SACb,YACA,MACA,QACA,QACA,WAAW,OACI;CACf,MAAM,EAAE,YAAY,mBAAmB,cAAc,OAAO;AAC5D,KAAI,YAAY;AACd,SAAO,KACL;GACE,WAAW;GACX,WAAW;GACZ,EACD,6BACD;AACD,MAAI,OACF,aAAY;;CAIhB,MAAM,MAAM,MAAM,eAAe,YADV,cAA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","names":["getFileConfig"],"sources":["../lib/config-validator.ts"],"sourcesContent":["#!/usr/bin/env node\nimport 'source-map-support/register.js';\nimport './punycode.cjs';\n\nimport { Command, CommanderError } from 'commander';\nimport { dequal } from 'dequal';\nimport fs from 'fs-extra';\nimport { getConfigFileNames } from './config/app-strings.ts';\nimport { GlobalConfig } from './config/global.ts';\nimport { massageConfig } from './config/massage.ts';\nimport { migrateConfig } from './config/migration.ts';\nimport type { RenovateConfig } from './config/types.ts';\nimport { validateConfig } from './config/validation.ts';\nimport { pkg } from './expose.ts';\nimport { logger } from './logger/index.ts';\nimport { getEnv } from './util/env.ts';\nimport { getConfig as getFileConfig } from './workers/global/config/parse/file.ts';\nimport { parseConfigs } from './workers/global/config/parse/index.ts';\nimport { getParsedContent } from './workers/global/config/parse/util.ts';\n\nconst { pathExists, readFile } = fs;\n\nlet returnVal = 0;\n\n/**\n * Make sure that we've resolved configuration from the different places that Renovate users would expect them to be specified\n *\n * This then allows a `configType=repo` config to i.e. be validated alongside a `config.js` or `env RENOVATE_ALLOWED_COMMANDS=...`\n *\n * Note that we intentionally don't fully initialize Renovate and its modules, as we're not fully running, and it would require a Platform to be configured\n * */\nasync function partiallyGlobalInitialize(): Promise<void> {\n // NOTE that this doesn't allow command-line arguments\n const globalConfig = await parseConfigs(getEnv(), []);\n GlobalConfig.set(globalConfig);\n}\n\nasync function validate(\n configType: 'global' | 'repo',\n desc: string,\n config: RenovateConfig,\n strict: boolean,\n isPreset = false,\n): Promise<void> {\n const { isMigrated, migratedConfig } = migrateConfig(config);\n if (isMigrated) {\n logger.warn(\n {\n oldConfig: config,\n newConfig: migratedConfig,\n },\n 'Config migration necessary',\n );\n if (strict) {\n returnVal = 1;\n }\n }\n const massagedConfig = massageConfig(migratedConfig);\n const res = await validateConfig(configType, massagedConfig, isPreset);\n if (res.errors.length) {\n logger.error(\n { file: desc, errors: res.errors },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n if (res.warnings.length) {\n logger.warn(\n { file: desc, warnings: res.warnings },\n 'Found errors in configuration',\n );\n returnVal = 1;\n }\n}\n\ninterface PackageJson {\n renovate?: RenovateConfig;\n 'renovate-config'?: Record<string, RenovateConfig>;\n}\n\n(async () => {\n await partiallyGlobalInitialize();\n\n const program = new Command('renovate-config-validator')\n .summary('Validate Renovate configuration files')\n .description(\n `Validate your Renovate configuration (repo config, shared presets or global configuration) files\\n` +\n 'If no [config-files...] are given, renovate-config-validator will look at the default config file locations (https://docs.renovatebot.com/configuration-options/)',\n )\n .addHelpText(\n 'after',\n `\nWhen specifying [config-files...], Renovate will treat them as global self-hosted configuration files. You can disable this behaviour with --no-global\n\nExamples:\n\n $ renovate-config-validator\n $ renovate-config-validator --strict\n $ renovate-config-validator first_config.json\n $ renovate-config-validator --strict config.js\n $ renovate-config-validator --no-global renovate.json5\n $ env RENOVATE_CONFIG_FILE=obscure-name.json renovate-config-validator\n\nGlobal configuration:\n\nIf you have specified global self-hosted configuration (https://docs.renovatebot.com/self-hosted-configuration/) in environment variables or in a \\`config.js\\`, this will be detected:\n\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator\n # if passing the filename, make sure it's not validating as a global config\n $ env RENOVATE_ALLOWED_ENV='[\"GO*\"]' renovate-config-validator --no-global renovate.json`,\n )\n .argument('[config-files...]')\n .version(pkg.version, '-v, --version')\n .option(\n '--strict',\n 'Fail command if any configuration warnings, errors, or a migration is needed',\n )\n .option(\n '--no-global',\n 'When specifying [config-files], do not treat them as global self-hosted configuration file(s)',\n true,\n )\n // allow us to manage the exit code\n .exitOverride();\n\n program.action(async (files, opts) => {\n const strict = opts.strict ?? false;\n\n if (files.length) {\n let isGlobalConfig = true;\n if (opts.global === false) {\n isGlobalConfig = false;\n }\n const configType = isGlobalConfig ? 'global' : 'repo';\n for (const file of files) {\n try {\n if (!(await pathExists(file))) {\n returnVal = 1;\n logger.error({ file }, 'File does not exist');\n break;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file} as ${configType} config`);\n await validate(configType, file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n }\n } else {\n for (const file of getConfigFileNames().filter(\n (name) => name !== 'package.json',\n )) {\n try {\n if (!(await pathExists(file))) {\n continue;\n }\n const parsedContent = await getParsedContent(file);\n try {\n logger.info(`Validating ${file}`);\n await validate('repo', file, parsedContent, strict);\n } catch (err) {\n logger.warn({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n } catch (err) {\n logger.warn({ file, err }, 'File could not be parsed');\n returnVal = 1;\n }\n }\n try {\n const pkgJson = JSON.parse(\n await readFile('package.json', 'utf8'),\n ) as PackageJson;\n if (pkgJson.renovate) {\n logger.info(`Validating package.json > renovate`);\n await validate(\n 'repo',\n 'package.json > renovate',\n pkgJson.renovate,\n strict,\n );\n }\n if (pkgJson['renovate-config']) {\n logger.info(`Validating package.json > renovate-config`);\n for (const presetConfig of Object.values(\n pkgJson['renovate-config'],\n )) {\n await validate(\n 'repo',\n 'package.json > renovate-config',\n presetConfig,\n strict,\n true,\n );\n }\n }\n } catch {\n // ignore\n }\n try {\n const env = getEnv();\n const fileConfig = await getFileConfig(env);\n if (!dequal(fileConfig, {})) {\n const file = env.RENOVATE_CONFIG_FILE ?? 'config.js';\n logger.info(`Validating ${file}`);\n try {\n await validate('global', file, fileConfig, strict);\n } catch (err) {\n logger.error({ file, err }, 'File is not valid Renovate config');\n returnVal = 1;\n }\n }\n } catch {\n // ignore\n }\n }\n if (returnVal !== 0) {\n process.exit(returnVal);\n }\n logger.info('Config validated successfully');\n });\n\n await program.parseAsync();\n})().catch((e) => {\n if (e instanceof CommanderError) {\n // Commander throws an error at the end of Action execution i.e. as part of the `help` command, and so we don't want to return an error code in this case\n if (e.code === 'commander.helpDisplayed') {\n return;\n }\n }\n\n // oxlint-disable-next-line no-console -- intentional: display critical error on CLI\n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AwB;AACzC,YAAO,KAAK,cAAc,OAAO;AACjC,SAAI;AACF,YAAM,SAAS,UAAU,MAAM,YAAY,OAAO;cAC3C,KAAK;AACZ,aAAO,MAAM;OAAE;OAAM;OAAK,EAAE,oCAAoC;AAChE,kBAAY;;;WAGV;;AAIV,MAAI,cAAc,EAChB,SAAQ,KAAK,UAAU;AAEzB,SAAO,KAAK,gCAAgC;GAC5C;AAEF,OAAM,QAAQ,YAAY;IACxB,CAAC,OAAO,MAAM;AAChB,KAAI,aAAa,gBAEf;MAAI,EAAE,SAAS,0BACb;;AAKJ,SAAQ,MAAM,EAAE;AAChB,SAAQ,KAAK,GAAG;EAChB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { pkg } from "../expose.js";
|
|
2
|
-
import { getEnv } from "../util/env.js";
|
|
3
2
|
import { GitOperationSpanProcessor } from "../util/git/span-processor.js";
|
|
4
3
|
import { isTraceDebuggingEnabled, isTraceSendingEnabled, isTracingEnabled, massageThrowable } from "./utils.js";
|
|
5
4
|
import { isPromise } from "@sindresorhus/is";
|
|
@@ -23,7 +22,6 @@ import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic
|
|
|
23
22
|
|
|
24
23
|
//#region lib/instrumentation/index.ts
|
|
25
24
|
let instrumentations = [];
|
|
26
|
-
init();
|
|
27
25
|
function init() {
|
|
28
26
|
if (!isTracingEnabled()) return;
|
|
29
27
|
// v8 ignore if -- TODO add tests
|
|
@@ -35,7 +33,7 @@ function init() {
|
|
|
35
33
|
spanProcessors.push(new BatchSpanProcessor(exporter));
|
|
36
34
|
spanProcessors.push(new GitOperationSpanProcessor());
|
|
37
35
|
}
|
|
38
|
-
const env =
|
|
36
|
+
const env = process.env;
|
|
39
37
|
const baseResource = resourceFromAttributes({
|
|
40
38
|
[ATTR_SERVICE_NAME]: env.OTEL_SERVICE_NAME ?? "renovate",
|
|
41
39
|
["service.namespace"]: env.OTEL_SERVICE_NAMESPACE ?? "renovatebot.com",
|
|
@@ -111,5 +109,5 @@ function instrument(name, fn, options = {}, context = api.context.active()) {
|
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
//#endregion
|
|
114
|
-
export { instrument, shutdown };
|
|
112
|
+
export { init, instrument, shutdown };
|
|
115
113
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../lib/instrumentation/index.ts"],"sourcesContent":["import { ClientRequest } from 'node:http';\nimport type { Context, Span, Tracer, TracerProvider } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api';\nimport { ProxyTracerProvider, SpanStatusCode } from '@opentelemetry/api';\nimport { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';\nimport {\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n} from '@opentelemetry/resource-detector-aws';\nimport {\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n} from '@opentelemetry/resource-detector-azure';\nimport { gcpDetector } from '@opentelemetry/resource-detector-gcp';\nimport { gitHubDetector } from '@opentelemetry/resource-detector-github';\nimport {\n detectResources,\n envDetector,\n resourceFromAttributes,\n} from '@opentelemetry/resources';\nimport {\n BatchSpanProcessor,\n ConsoleSpanExporter,\n SimpleSpanProcessor,\n type SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { isPromise } from '@sindresorhus/is';\nimport { pkg } from '../expose.ts';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../lib/instrumentation/index.ts"],"sourcesContent":["import { ClientRequest } from 'node:http';\nimport type { Context, Span, Tracer, TracerProvider } from '@opentelemetry/api';\nimport * as api from '@opentelemetry/api';\nimport { ProxyTracerProvider, SpanStatusCode } from '@opentelemetry/api';\nimport { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport { RedisInstrumentation } from '@opentelemetry/instrumentation-redis';\nimport {\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n} from '@opentelemetry/resource-detector-aws';\nimport {\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n} from '@opentelemetry/resource-detector-azure';\nimport { gcpDetector } from '@opentelemetry/resource-detector-gcp';\nimport { gitHubDetector } from '@opentelemetry/resource-detector-github';\nimport {\n detectResources,\n envDetector,\n resourceFromAttributes,\n} from '@opentelemetry/resources';\nimport {\n BatchSpanProcessor,\n ConsoleSpanExporter,\n SimpleSpanProcessor,\n type SpanProcessor,\n} from '@opentelemetry/sdk-trace-base';\nimport { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';\nimport {\n ATTR_SERVICE_NAME,\n ATTR_SERVICE_VERSION,\n} from '@opentelemetry/semantic-conventions';\nimport { isPromise } from '@sindresorhus/is';\nimport { pkg } from '../expose.ts';\nimport { GitOperationSpanProcessor } from '../util/git/span-processor.ts';\nimport type { RenovateSpanOptions } from './types.ts';\nimport {\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils.ts';\n\nlet instrumentations: Instrumentation[] = [];\n\nexport function init(): void {\n if (!isTracingEnabled()) {\n return;\n }\n\n // v8 ignore if -- TODO add tests\n if (process.env.OTEL_LOG_LEVEL) {\n api.diag.setLogger(\n new api.DiagConsoleLogger(),\n api.DiagLogLevel[\n process.env.OTEL_LOG_LEVEL.toUpperCase() as keyof typeof api.DiagLogLevel\n ],\n );\n }\n\n const spanProcessors: SpanProcessor[] = [];\n // add processors\n if (isTraceDebuggingEnabled()) {\n spanProcessors.push(new SimpleSpanProcessor(new ConsoleSpanExporter()));\n }\n\n // OTEL specification environment variable\n if (isTraceSendingEnabled()) {\n const exporter = new OTLPTraceExporter();\n spanProcessors.push(new BatchSpanProcessor(exporter));\n // TODO: fix me, transitive initializes logger\n spanProcessors.push(new GitOperationSpanProcessor());\n }\n\n const env = process.env; // don't use getEnv() here to avoid circular dependency with env variables used in the resource detectors\n const baseResource = resourceFromAttributes({\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value\n [ATTR_SERVICE_NAME]: env.OTEL_SERVICE_NAME ?? 'renovate',\n // https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n // https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688\n ['service.namespace']: env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: env.OTEL_SERVICE_VERSION ?? pkg.version,\n });\n\n const detectedResource = detectResources({\n detectors: [\n awsBeanstalkDetector,\n awsEc2Detector,\n awsEcsDetector,\n awsEksDetector,\n awsLambdaDetector,\n azureAppServiceDetector,\n azureFunctionsDetector,\n azureVmDetector,\n gcpDetector,\n gitHubDetector,\n envDetector,\n ],\n });\n\n const traceProvider = new NodeTracerProvider({\n resource: baseResource.merge(detectedResource),\n spanProcessors,\n });\n\n const contextManager = new AsyncLocalStorageContextManager();\n traceProvider.register({\n contextManager,\n });\n\n instrumentations = [\n new HttpInstrumentation({\n /* v8 ignore start -- not easily testable */\n applyCustomAttributesOnSpan: (span, request, response) => {\n // ignore 404 errors when the branch protection of Github could not be found. This is expected if no rules are configured\n if (\n request instanceof ClientRequest &&\n request.host === `api.github.com` &&\n request.path.endsWith(`/protection`) &&\n response.statusCode === 404\n ) {\n span.setStatus({ code: SpanStatusCode.OK });\n }\n },\n /* v8 ignore stop -- not easily testable */\n }),\n new BunyanInstrumentation(),\n new RedisInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\n/* v8 ignore next -- not easily testable */\nexport async function shutdown(): Promise<void> {\n const traceProvider = getTracerProvider();\n if (traceProvider instanceof NodeTracerProvider) {\n await traceProvider.shutdown();\n } else if (traceProvider instanceof ProxyTracerProvider) {\n const delegateProvider = traceProvider.getDelegate();\n if (delegateProvider instanceof NodeTracerProvider) {\n await delegateProvider.shutdown();\n }\n }\n}\n\nexport function disableInstrumentations(): void {\n for (const instrumentation of instrumentations) {\n instrumentation.disable();\n }\n}\n\nexport function getTracerProvider(): TracerProvider {\n return api.trace.getTracerProvider();\n}\n\nfunction getTracer(): Tracer {\n return getTracerProvider().getTracer('renovate');\n}\n\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions,\n context: Context,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: RenovateSpanOptions = {},\n context: Context = api.context.active(),\n): ReturnType<F> {\n return getTracer().startActiveSpan(name, options, context, (span: Span) => {\n try {\n const ret = fn();\n if (isPromise(ret)) {\n return ret\n .catch((e) => {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n throw e;\n })\n .finally(() => span.end()) as ReturnType<F>;\n }\n span.end();\n return ret;\n } catch (e) {\n span.recordException(e);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: massageThrowable(e),\n });\n span.end();\n throw e;\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAI,mBAAsC,EAAE;AAE5C,SAAgB,OAAa;AAC3B,KAAI,CAAC,kBAAkB,CACrB;;AAIF,KAAI,QAAQ,IAAI,eACd,KAAI,KAAK,UACP,IAAI,IAAI,mBAAmB,EAC3B,IAAI,aACF,QAAQ,IAAI,eAAe,aAAa,EAE3C;CAGH,MAAM,iBAAkC,EAAE;AAE1C,KAAI,yBAAyB,CAC3B,gBAAe,KAAK,IAAI,oBAAoB,IAAI,qBAAqB,CAAC,CAAC;AAIzE,KAAI,uBAAuB,EAAE;EAC3B,MAAM,WAAW,IAAI,mBAAmB;AACxC,iBAAe,KAAK,IAAI,mBAAmB,SAAS,CAAC;AAErD,iBAAe,KAAK,IAAI,2BAA2B,CAAC;;CAGtD,MAAM,MAAM,QAAQ;CACpB,MAAM,eAAe,uBAAuB;GAEzC,oBAAoB,IAAI,qBAAqB;GAG7C,sBAAsB,IAAI,0BAA0B;GACpD,uBAAuB,IAAI,wBAAwB,IAAI;EACzD,CAAC;CAEF,MAAM,mBAAmB,gBAAgB,EACvC,WAAW;EACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CAAC;CAEF,MAAM,gBAAgB,IAAI,mBAAmB;EAC3C,UAAU,aAAa,MAAM,iBAAiB;EAC9C;EACD,CAAC;CAEF,MAAM,iBAAiB,IAAI,iCAAiC;AAC5D,eAAc,SAAS,EACrB,gBACD,CAAC;AAEF,oBAAmB;EACjB,IAAI,oBAAoB,EAEtB,8BAA8B,MAAM,SAAS,aAAa;AAExD,OACE,mBAAmB,iBACnB,QAAQ,SAAS,oBACjB,QAAQ,KAAK,SAAS,cAAc,IACpC,SAAS,eAAe,IAExB,MAAK,UAAU,EAAE,MAAM,eAAe,IAAI,CAAC;KAIhD,CAAC;EACF,IAAI,uBAAuB;EAC3B,IAAI,sBAAsB;EAC3B;AACD,0BAAyB,EACvB,kBACD,CAAC;;;AAKJ,eAAsB,WAA0B;CAC9C,MAAM,gBAAgB,mBAAmB;AACzC,KAAI,yBAAyB,mBAC3B,OAAM,cAAc,UAAU;UACrB,yBAAyB,qBAAqB;EACvD,MAAM,mBAAmB,cAAc,aAAa;AACpD,MAAI,4BAA4B,mBAC9B,OAAM,iBAAiB,UAAU;;;AAWvC,SAAgB,oBAAoC;AAClD,QAAO,IAAI,MAAM,mBAAmB;;AAGtC,SAAS,YAAoB;AAC3B,QAAO,mBAAmB,CAAC,UAAU,WAAW;;AAkBlD,SAAgB,WACd,MACA,IACA,UAA+B,EAAE,EACjC,UAAmB,IAAI,QAAQ,QAAQ,EACxB;AACf,QAAO,WAAW,CAAC,gBAAgB,MAAM,SAAS,UAAU,SAAe;AACzE,MAAI;GACF,MAAM,MAAM,IAAI;AAChB,OAAI,UAAU,IAAI,CAChB,QAAO,IACJ,OAAO,MAAM;AACZ,SAAK,gBAAgB,EAAE;AACvB,SAAK,UAAU;KACb,MAAM,eAAe;KACrB,SAAS,iBAAiB,EAAE;KAC7B,CAAC;AACF,UAAM;KACN,CACD,cAAc,KAAK,KAAK,CAAC;AAE9B,QAAK,KAAK;AACV,UAAO;WACA,GAAG;AACV,QAAK,gBAAgB,EAAE;AACvB,QAAK,UAAU;IACb,MAAM,eAAe;IACrB,SAAS,iBAAiB,EAAE;IAC7B,CAAC;AACF,QAAK,KAAK;AACV,SAAM;;GAER"}
|
package/dist/renovate.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { require_punycode } from "./punycode.js";
|
|
3
|
-
import { logger } from "./logger/index.js";
|
|
4
|
-
import { bootstrap } from "./proxy.js";
|
|
5
|
-
import { instrument, shutdown } from "./instrumentation/index.js";
|
|
6
|
-
import { start } from "./workers/global/index.js";
|
|
7
3
|
import "source-map-support/register.js";
|
|
8
4
|
|
|
9
5
|
//#region lib/renovate.ts
|
|
10
6
|
var import_punycode = require_punycode();
|
|
11
|
-
/* v8 ignore next 3 -- not easily testable */
|
|
12
|
-
process.on("unhandledRejection", (err) => {
|
|
13
|
-
logger.error({ err }, "unhandledRejection");
|
|
14
|
-
});
|
|
15
|
-
bootstrap();
|
|
16
7
|
(async () => {
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const otel = await import("./instrumentation/index.js");
|
|
9
|
+
otel.init();
|
|
10
|
+
(await import("./proxy.js")).bootstrap();
|
|
11
|
+
const { logger } = await import("./logger/index.js");
|
|
12
|
+
const { start } = await import("./workers/global/index.js");
|
|
13
|
+
/* v8 ignore next 3 -- not easily testable */
|
|
14
|
+
process.on("unhandledRejection", (err) => {
|
|
15
|
+
logger.error({ err }, "unhandledRejection");
|
|
16
|
+
});
|
|
17
|
+
process.exitCode = await otel.instrument("run", start);
|
|
18
|
+
await otel.shutdown();
|
|
19
19
|
/* v8 ignore next 3 -- no test required */
|
|
20
20
|
if (process.env.RENOVATE_X_HARD_EXIT) process.exit(process.exitCode);
|
|
21
21
|
})();
|
package/dist/renovate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renovate.js","names":[
|
|
1
|
+
{"version":3,"file":"renovate.js","names":[],"sources":["../lib/renovate.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport 'source-map-support/register.js';\nimport './punycode.cjs';\n\nvoid (async (): Promise<void> => {\n // has to be imported before logger and other libraries which are instrumentalised\n const otel = await import('./instrumentation/index.ts');\n otel.init();\n (await import('./proxy.ts')).bootstrap();\n const { logger } = await import('./logger/index.ts');\n const { start } = await import('./workers/global/index.ts');\n /* v8 ignore next 3 -- not easily testable */\n process.on('unhandledRejection', (err) => {\n logger.error({ err }, 'unhandledRejection');\n });\n process.exitCode = await otel.instrument('run', start);\n await otel.shutdown(); //gracefully shutdown OpenTelemetry\n\n /* v8 ignore next 3 -- no test required */\n if (process.env.RENOVATE_X_HARD_EXIT) {\n process.exit(process.exitCode);\n }\n})();\n"],"mappings":";;;;;;CAKM,YAA2B;CAE/B,MAAM,OAAO,MAAM,OAAO;AAC1B,MAAK,MAAM;AACX,EAAC,MAAM,OAAO,eAAe,WAAW;CACxC,MAAM,EAAE,WAAW,MAAM,OAAO;CAChC,MAAM,EAAE,UAAU,MAAM,OAAO;;AAE/B,SAAQ,GAAG,uBAAuB,QAAQ;AACxC,SAAO,MAAM,EAAE,KAAK,EAAE,qBAAqB;GAC3C;AACF,SAAQ,WAAW,MAAM,KAAK,WAAW,OAAO,MAAM;AACtD,OAAM,KAAK,UAAU;;AAGrB,KAAI,QAAQ,IAAI,qBACd,SAAQ,KAAK,QAAQ,SAAS;IAE9B"}
|
package/dist/util/unicode.js
CHANGED
|
@@ -4,7 +4,11 @@ import { logger } from "../logger/index.js";
|
|
|
4
4
|
//#region lib/util/unicode.ts
|
|
5
5
|
function logWarningIfUnicodeHiddenCharactersInPackageFile(file, content) {
|
|
6
6
|
const hiddenCharacters = content.toString("utf8").match(hiddenUnicodeCharactersRegex);
|
|
7
|
-
if (hiddenCharacters) logger.once.
|
|
7
|
+
if (hiddenCharacters) if (hiddenCharacters.length === 1 && hiddenCharacters[0] === "") logger.once.trace({
|
|
8
|
+
file,
|
|
9
|
+
hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
|
|
10
|
+
}, `Hidden Byte Order Mark (BOM) Unicode characters has been discovered in the file \`${file}\`. This is likely safe, if you are using Microsoft Windows, but please confirm that they are intended to be there, as they could be an attempt to "smuggle" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`);
|
|
11
|
+
else logger.once.warn({
|
|
8
12
|
file,
|
|
9
13
|
hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
|
|
10
14
|
}, `Hidden Unicode characters have been discovered in the file \`${file}\`. Please confirm that they are intended to be there, as they could be an attempt to "smuggle" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`);
|
package/dist/util/unicode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const hiddenCharacters = content\n .toString('utf8')\n .match(hiddenUnicodeCharactersRegex);\n if (hiddenCharacters) {\n logger.once.
|
|
1
|
+
{"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const hiddenCharacters = content\n .toString('utf8')\n .match(hiddenUnicodeCharactersRegex);\n if (hiddenCharacters) {\n if (hiddenCharacters.length === 1 && hiddenCharacters[0] === '\\uFEFF') {\n logger.once.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Byte Order Mark (BOM) Unicode characters has been discovered in the file \\`${file}\\`. This is likely safe, if you are using Microsoft Windows, but please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n } else {\n logger.once.warn(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Unicode characters have been discovered in the file \\`${file}\\`. Please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n }\n }\n}\n"],"mappings":";;;;AAGA,SAAgB,iDACd,MACA,SACM;CACN,MAAM,mBAAmB,QACtB,SAAS,OAAO,CAChB,MAAM,6BAA6B;AACtC,KAAI,iBACF,KAAI,iBAAiB,WAAW,KAAK,iBAAiB,OAAO,IAC3D,QAAO,KAAK,MACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qFAAqF,KAAK,8PAC3F;KAED,QAAO,KAAK,KACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,gEAAgE,KAAK,iMACtE"}
|
|
@@ -15,10 +15,10 @@ import { mergeChildConfig } from "../../config/utils.js";
|
|
|
15
15
|
import { resolveConfigPresets } from "../../config/presets/index.js";
|
|
16
16
|
import { validateConfigSecretsAndVariables } from "../../config/secrets.js";
|
|
17
17
|
import { parseConfigs } from "./config/parse/index.js";
|
|
18
|
+
import { autodiscoverRepositories } from "./autodiscover.js";
|
|
18
19
|
import { filterConfig } from "../../config/index.js";
|
|
19
20
|
import { exportStats, finalizeReport } from "../../instrumentation/reporting.js";
|
|
20
21
|
import { renovateRepository } from "../repository/index.js";
|
|
21
|
-
import { autodiscoverRepositories } from "./autodiscover.js";
|
|
22
22
|
import { globalFinalize, globalInitialize } from "./initialize.js";
|
|
23
23
|
import fs from "fs-extra";
|
|
24
24
|
import { isNonEmptyString, isNonEmptyStringAndNotWhitespace, isString } from "@sindresorhus/is";
|
|
@@ -13,6 +13,7 @@ import { instrument } from "../../instrumentation/index.js";
|
|
|
13
13
|
import { removeDanglingContainers } from "../../util/exec/docker/index.js";
|
|
14
14
|
import { isCloned } from "../../util/git/index.js";
|
|
15
15
|
import { applySecretsAndVariablesToConfig } from "../../config/secrets.js";
|
|
16
|
+
import { processResult } from "./result.js";
|
|
16
17
|
import { addExtractionStats } from "../../instrumentation/reporting.js";
|
|
17
18
|
import { detectSemanticCommits } from "../../util/git/semantic.js";
|
|
18
19
|
import { addSplit, getSplits, splitInit } from "../../util/split.js";
|
|
@@ -27,7 +28,6 @@ import { pruneStaleBranches } from "./finalize/prune.js";
|
|
|
27
28
|
import { finalizeRepo } from "./finalize/index.js";
|
|
28
29
|
import { initRepo } from "./init/index.js";
|
|
29
30
|
import { ensureOnboardingPr } from "./onboarding/pr/index.js";
|
|
30
|
-
import { processResult } from "./result.js";
|
|
31
31
|
import fs from "fs-extra";
|
|
32
32
|
|
|
33
33
|
//#region lib/workers/repository/index.ts
|
package/package.json
CHANGED
package/renovate-schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"title": "JSON schema for Renovate 43.31.
|
|
2
|
+
"title": "JSON schema for Renovate 43.31.5 config files (https://renovatebot.com/)",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"x-renovate-version": "43.31.
|
|
4
|
+
"x-renovate-version": "43.31.5",
|
|
5
5
|
"allowComments": true,
|
|
6
6
|
"type": "object",
|
|
7
7
|
"properties": {
|