renovate 39.242.2 → 39.244.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.
@@ -14,6 +14,10 @@ const exporter_trace_otlp_http_1 = require("@opentelemetry/exporter-trace-otlp-h
|
|
14
14
|
const instrumentation_1 = require("@opentelemetry/instrumentation");
|
15
15
|
const instrumentation_bunyan_1 = require("@opentelemetry/instrumentation-bunyan");
|
16
16
|
const instrumentation_http_1 = require("@opentelemetry/instrumentation-http");
|
17
|
+
const resource_detector_aws_1 = require("@opentelemetry/resource-detector-aws");
|
18
|
+
const resource_detector_azure_1 = require("@opentelemetry/resource-detector-azure");
|
19
|
+
const resource_detector_gcp_1 = require("@opentelemetry/resource-detector-gcp");
|
20
|
+
const resource_detector_github_1 = require("@opentelemetry/resource-detector-github");
|
17
21
|
const resources_1 = require("@opentelemetry/resources");
|
18
22
|
const sdk_trace_base_1 = require("@opentelemetry/sdk-trace-base");
|
19
23
|
const sdk_trace_node_1 = require("@opentelemetry/sdk-trace-node");
|
@@ -36,15 +40,31 @@ function init() {
|
|
36
40
|
const exporter = new exporter_trace_otlp_http_1.OTLPTraceExporter();
|
37
41
|
spanProcessors.push(new sdk_trace_base_1.BatchSpanProcessor(exporter));
|
38
42
|
}
|
43
|
+
const baseResource = (0, resources_1.resourceFromAttributes)({
|
44
|
+
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value
|
45
|
+
[semantic_conventions_1.ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'renovate',
|
46
|
+
// https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
47
|
+
// https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688
|
48
|
+
['service.namespace']: process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',
|
49
|
+
[semantic_conventions_1.ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? expose_cjs_1.pkg.version,
|
50
|
+
});
|
51
|
+
const detectedResource = (0, resources_1.detectResources)({
|
52
|
+
detectors: [
|
53
|
+
resource_detector_aws_1.awsBeanstalkDetector,
|
54
|
+
resource_detector_aws_1.awsEc2Detector,
|
55
|
+
resource_detector_aws_1.awsEcsDetector,
|
56
|
+
resource_detector_aws_1.awsEksDetector,
|
57
|
+
resource_detector_aws_1.awsLambdaDetector,
|
58
|
+
resource_detector_azure_1.azureAppServiceDetector,
|
59
|
+
resource_detector_azure_1.azureFunctionsDetector,
|
60
|
+
resource_detector_azure_1.azureVmDetector,
|
61
|
+
resource_detector_gcp_1.gcpDetector,
|
62
|
+
resource_detector_github_1.gitHubDetector,
|
63
|
+
resources_1.envDetector,
|
64
|
+
],
|
65
|
+
});
|
39
66
|
const traceProvider = new sdk_trace_node_1.NodeTracerProvider({
|
40
|
-
resource: (
|
41
|
-
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#semantic-attributes-with-sdk-provided-default-value
|
42
|
-
[semantic_conventions_1.ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'renovate',
|
43
|
-
// https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
44
|
-
// https://github.com/open-telemetry/opentelemetry-js/blob/e9d3c71918635d490b6a9ac9f8259265b38394d0/semantic-conventions/src/experimental_attributes.ts#L7688
|
45
|
-
['service.namespace']: process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',
|
46
|
-
[semantic_conventions_1.ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? expose_cjs_1.pkg.version,
|
47
|
-
}),
|
67
|
+
resource: baseResource.merge(detectedResource),
|
48
68
|
spanProcessors,
|
49
69
|
});
|
50
70
|
const contextManager = new context_async_hooks_1.AsyncLocalStorageContextManager();
|
@@ -1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AC1B,OAAO,EAAE,IAAA,wBAAgB,EAAC,CAAC,CAAC;aAC7B,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ClientRequest } from 'node:http';\nimport type {\n Context,\n Span,\n SpanOptions,\n Tracer,\n TracerProvider,\n} 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 { resourceFromAttributes } 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 { pkg } from '../expose.cjs';\nimport {\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils';\n\nlet instrumentations: Instrumentation[] = [];\n\ninit();\n\nexport function init(): void {\n if (!isTracingEnabled()) {\n return;\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 }\n\n const traceProvider = new NodeTracerProvider({\n resource: 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]: process.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']:\n process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: process.env.OTEL_SERVICE_VERSION ?? pkg.version,\n }),\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 */\n }),\n new BunyanInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n/* v8 ignore start -- not easily testable */\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\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/* v8 ignore stop */\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: SpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: SpanOptions = {},\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 (ret instanceof Promise) {\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"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/instrumentation/index.ts"],"names":[],"mappings":";;AA0DA,oBA0EC;AAID,4BAUC;AAGD,0DAIC;AAED,8CAEC;AAeD,gCAiCC;;AA7MD,yCAA0C;AAQ1C,gEAA0C;AAC1C,4CAAyE;AACzE,4EAAqF;AACrF,sFAA4E;AAE5E,oEAA0E;AAC1E,kFAA8E;AAC9E,8EAA0E;AAC1E,gFAM8C;AAC9C,oFAIgD;AAChD,gFAAmE;AACnE,sFAAyE;AACzE,wDAIkC;AAClC,kEAKuC;AACvC,kEAAmE;AACnE,8EAG6C;AAC7C,8CAAoC;AACpC,mCAKiB;AAEjB,IAAI,gBAAgB,GAAsB,EAAE,CAAC;AAE7C,IAAI,EAAE,CAAC;AAEP,SAAgB,IAAI;IAClB,IAAI,CAAC,IAAA,wBAAgB,GAAE,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,cAAc,GAAoB,EAAE,CAAC;IAC3C,iBAAiB;IACjB,IAAI,IAAA,+BAAuB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AC;AACnD,CAAC;AAWD,SAAgB,UAAU,CACxB,IAAY,EACZ,EAAK,EACL,UAAuB,EAAE,EACzB,UAAmB,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE;IAEvC,OAAO,SAAS,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,IAAU,EAAE,EAAE;QACxE,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,EAAE,EAAE,CAAC;YACjB,IAAI,GAAG,YAAY,OAAO,EAAE,CAAC;gBAC3B,OAAO,GAAG;qBACP,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;oBACX,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;oBACxB,IAAI,CAAC,SAAS,CAAC;wBACb,IAAI,EAAE,oBAAc,CAAC,KAAK;wBAC1B,OAAO,EAAE,IAAA,wBAAgB,EAAC,CAAC,CAAC;qBAC7B,CAAC,CAAC;oBACH,MAAM,CAAC,CAAC;gBACV,CAAC,CAAC;qBACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAkB,CAAC;YAChD,CAAC;YACD,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,OAAO,GAAG,CAAC;QACb,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,SAAS,CAAC;gBACb,IAAI,EAAE,oBAAc,CAAC,KAAK;gBAC1B,OAAO,EAAE,IAAA,wBAAgB,EAAC,CAAC,CAAC;aAC7B,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ClientRequest } from 'node:http';\nimport type {\n Context,\n Span,\n SpanOptions,\n Tracer,\n TracerProvider,\n} 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 {\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 { pkg } from '../expose.cjs';\nimport {\n isTraceDebuggingEnabled,\n isTraceSendingEnabled,\n isTracingEnabled,\n massageThrowable,\n} from './utils';\n\nlet instrumentations: Instrumentation[] = [];\n\ninit();\n\nexport function init(): void {\n if (!isTracingEnabled()) {\n return;\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 }\n\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]: process.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']:\n process.env.OTEL_SERVICE_NAMESPACE ?? 'renovatebot.com',\n [ATTR_SERVICE_VERSION]: process.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 */\n }),\n new BunyanInstrumentation(),\n ];\n registerInstrumentations({\n instrumentations,\n });\n}\n\n/* v8 ignore start -- not easily testable */\n// https://github.com/open-telemetry/opentelemetry-js-api/issues/34\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/* v8 ignore stop */\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: SpanOptions,\n): ReturnType<F>;\nexport function instrument<F extends () => ReturnType<F>>(\n name: string,\n fn: F,\n options: SpanOptions = {},\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 (ret instanceof Promise) {\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"]}
|
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getPrConfigDescription = getPrConfigDescription;
|
4
|
+
const tslib_1 = require("tslib");
|
5
|
+
const croner_1 = require("croner");
|
6
|
+
const cronstrue_1 = tslib_1.__importDefault(require("cronstrue"));
|
4
7
|
const emoji_1 = require("../../../../../util/emoji");
|
8
|
+
const string_1 = require("../../../../../util/string");
|
5
9
|
function getPrConfigDescription(config) {
|
6
10
|
let prBody = `\n\n---\n\n### Configuration\n\n`;
|
7
11
|
prBody += (0, emoji_1.emojify)(`:date: **Schedule**: `);
|
@@ -46,7 +50,8 @@ function getPrConfigDescription(config) {
|
|
46
50
|
function scheduleToString(schedule, timezone) {
|
47
51
|
let scheduleString = '';
|
48
52
|
if (schedule && schedule[0] !== 'at any time') {
|
49
|
-
scheduleString
|
53
|
+
scheduleString =
|
54
|
+
getReadableCronSchedule(schedule) ?? `"${String(schedule)}"`;
|
50
55
|
if (timezone) {
|
51
56
|
scheduleString += ` in timezone ${timezone}`;
|
52
57
|
}
|
@@ -59,4 +64,24 @@ function scheduleToString(schedule, timezone) {
|
|
59
64
|
}
|
60
65
|
return scheduleString;
|
61
66
|
}
|
67
|
+
/**
|
68
|
+
* Return human-readable cron schedule summary if the schedule is a valid cron
|
69
|
+
* else return null
|
70
|
+
*/
|
71
|
+
function getReadableCronSchedule(scheduleText) {
|
72
|
+
// assuming if one schedule is cron the others in the array will be cron too
|
73
|
+
try {
|
74
|
+
new croner_1.CronPattern(scheduleText[0]); // validate cron
|
75
|
+
return scheduleText
|
76
|
+
.map((cron) => (0, string_1.capitalize)(cronstrue_1.default
|
77
|
+
.toString(cron, {
|
78
|
+
throwExceptionOnParseError: false,
|
79
|
+
})
|
80
|
+
.replace('Every minute, ', '')) + ` ( ${cron} )`)
|
81
|
+
.join(', ');
|
82
|
+
}
|
83
|
+
catch {
|
84
|
+
return null;
|
85
|
+
}
|
86
|
+
}
|
62
87
|
//# sourceMappingURL=config-description.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config-description.js","sourceRoot":"","sources":["../../../../../../lib/workers/repository/update/pr/body/config-description.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"config-description.js","sourceRoot":"","sources":["../../../../../../lib/workers/repository/update/pr/body/config-description.ts"],"names":[],"mappings":";;AAMA,wDA0CC;;AAhDD,mCAAqC;AACrC,kEAAkC;AAClC,qDAAoD;AACpD,uDAAwD;AAGxD,SAAgB,sBAAsB,CAAC,MAAoB;IACzD,IAAI,MAAM,GAAG,kCAAkC,CAAC;IAChD,MAAM,IAAI,IAAA,eAAO,EAAC,uBAAuB,CAAC,CAAC;IAC3C,MAAM;QACJ,oBAA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AAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CACvB,QAA8B,EAC9B,QAA4B;IAE5B,IAAI,cAAc,GAAG,EAAE,CAAC;IACxB,IAAI,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE,CAAC;QAC9C,cAAc;YACZ,uBAAuB,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QAC/D,IAAI,QAAQ,EAAE,CAAC;YACb,cAAc,IAAI,gBAAgB,QAAQ,EAAE,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,cAAc,IAAI,QAAQ,CAAC;QAC7B,CAAC;IACH,CAAC;SAAM,CAAC;QACN,cAAc,IAAI,mCAAmC,CAAC;IACxD,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,SAAS,uBAAuB,CAAC,YAAsB;IACrD,4EAA4E;IAC5E,IAAI,CAAC;QACH,IAAI,oBAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;QAClD,OAAO,YAAY;aAChB,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,IAAA,mBAAU,EACR,mBAAS;aACN,QAAQ,CAAC,IAAI,EAAE;YACd,0BAA0B,EAAE,KAAK;SAClC,CAAC;aACD,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CACjC,GAAG,MAAM,IAAI,IAAI,CACrB;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import { CronPattern } from 'croner';\nimport cronstrue from 'cronstrue';\nimport { emojify } from '../../../../../util/emoji';\nimport { capitalize } from '../../../../../util/string';\nimport type { BranchConfig } from '../../../../types';\n\nexport function getPrConfigDescription(config: BranchConfig): string {\n let prBody = `\\n\\n---\\n\\n### Configuration\\n\\n`;\n prBody += emojify(`:date: **Schedule**: `);\n prBody +=\n 'Branch creation - ' + scheduleToString(config.schedule, config.timezone);\n prBody +=\n ', Automerge - ' +\n scheduleToString(config.automergeSchedule, config.timezone) +\n '.';\n\n prBody += '\\n\\n';\n prBody += emojify(':vertical_traffic_light: **Automerge**: ');\n if (config.automerge) {\n prBody += 'Enabled.';\n } else if (config.automergedPreviously) {\n prBody += 'Disabled because a matching PR was automerged previously.';\n } else {\n prBody +=\n 'Disabled by config. Please merge this manually once you are satisfied.';\n }\n prBody += '\\n\\n';\n prBody += emojify(':recycle: **Rebasing**: ');\n if (config.rebaseWhen === 'behind-base-branch') {\n prBody += 'Whenever PR is behind base branch';\n } else if (config.rebaseWhen === 'never' || config.stopUpdating) {\n prBody += 'Never';\n } else {\n prBody += 'Whenever PR becomes conflicted';\n }\n prBody += `, or you tick the rebase/retry checkbox.\\n\\n`;\n if (config.recreateClosed) {\n prBody += emojify(\n `:ghost: **Immortal**: This PR will be recreated if closed unmerged. Get [config help](${config.productLinks?.help}) if that's undesired.\\n\\n`,\n );\n } else {\n prBody += emojify(\n `:no_bell: **Ignore**: Close this PR and you won't be reminded about ${\n config.upgrades.length === 1 ? 'this update' : 'these updates'\n } again.\\n\\n`,\n );\n }\n return prBody;\n}\n\nfunction scheduleToString(\n schedule: string[] | undefined,\n timezone: string | undefined,\n): string {\n let scheduleString = '';\n if (schedule && schedule[0] !== 'at any time') {\n scheduleString =\n getReadableCronSchedule(schedule) ?? `\"${String(schedule)}\"`;\n if (timezone) {\n scheduleString += ` in timezone ${timezone}`;\n } else {\n scheduleString += ` (UTC)`;\n }\n } else {\n scheduleString += 'At any time (no schedule defined)';\n }\n return scheduleString;\n}\n\n/**\n * Return human-readable cron schedule summary if the schedule is a valid cron\n * else return null\n */\nfunction getReadableCronSchedule(scheduleText: string[]): string | null {\n // assuming if one schedule is cron the others in the array will be cron too\n try {\n new CronPattern(scheduleText[0]); // validate cron\n return scheduleText\n .map(\n (cron) =>\n capitalize(\n cronstrue\n .toString(cron, {\n throwExceptionOnParseError: false,\n })\n .replace('Every minute, ', ''),\n ) + ` ( ${cron} )`,\n )\n .join(', ');\n } catch {\n return null;\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "renovate",
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
4
|
-
"version": "39.
|
4
|
+
"version": "39.244.0",
|
5
5
|
"type": "commonjs",
|
6
6
|
"bin": {
|
7
7
|
"renovate": "dist/renovate.js",
|
@@ -161,6 +161,10 @@
|
|
161
161
|
"@opentelemetry/instrumentation": "0.200.0",
|
162
162
|
"@opentelemetry/instrumentation-bunyan": "0.46.0",
|
163
163
|
"@opentelemetry/instrumentation-http": "0.200.0",
|
164
|
+
"@opentelemetry/resource-detector-aws": "2.0.0",
|
165
|
+
"@opentelemetry/resource-detector-azure": "0.7.0",
|
166
|
+
"@opentelemetry/resource-detector-gcp": "0.34.0",
|
167
|
+
"@opentelemetry/resource-detector-github": "0.31.0",
|
164
168
|
"@opentelemetry/resources": "2.0.0",
|
165
169
|
"@opentelemetry/sdk-trace-base": "2.0.0",
|
166
170
|
"@opentelemetry/sdk-trace-node": "2.0.0",
|
@@ -203,7 +207,7 @@
|
|
203
207
|
"find-packages": "10.0.4",
|
204
208
|
"find-up": "5.0.0",
|
205
209
|
"fs-extra": "11.3.0",
|
206
|
-
"git-url-parse": "16.0
|
210
|
+
"git-url-parse": "16.1.0",
|
207
211
|
"github-url-from-git": "1.5.0",
|
208
212
|
"glob": "11.0.1",
|
209
213
|
"global-agent": "3.0.0",
|
@@ -285,7 +289,7 @@
|
|
285
289
|
"@types/diff": "7.0.2",
|
286
290
|
"@types/eslint-config-prettier": "6.11.3",
|
287
291
|
"@types/fs-extra": "11.0.4",
|
288
|
-
"@types/git-url-parse": "16.0.
|
292
|
+
"@types/git-url-parse": "16.0.2",
|
289
293
|
"@types/github-url-from-git": "1.5.3",
|
290
294
|
"@types/global-agent": "3.0.0",
|
291
295
|
"@types/ini": "4.1.1",
|