renovate 44.196.1 → 44.197.1
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/instrumentation/reporting.js +19 -1
- package/dist/instrumentation/reporting.js.map +1 -1
- package/dist/instrumentation/types.d.ts +27 -0
- package/dist/instrumentation/types.js.map +1 -1
- package/dist/workers/global/index.js +1 -1
- package/dist/workers/repository/finalize/index.js +3 -1
- package/dist/workers/repository/finalize/index.js.map +1 -1
- package/dist/workers/repository/finalize/repository-statistics.js +2 -1
- package/dist/workers/repository/finalize/repository-statistics.js.map +1 -1
- package/dist/workers/repository/index.js +1 -1
- package/dist/workers/repository/result.js +2 -0
- package/dist/workers/repository/result.js.map +1 -1
- package/package.json +6 -6
- package/renovate-schema.json +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { prettier } from "../expose.js";
|
|
2
|
+
import { GlobalConfig } from "../config/global.js";
|
|
2
3
|
import { sanitizeValue } from "../logger/utils.js";
|
|
3
4
|
import { getProblems, logger } from "../logger/index.js";
|
|
5
|
+
import { getInheritedOrGlobal } from "../util/common.js";
|
|
4
6
|
import { writeSystemFile } from "../util/fs/index.js";
|
|
5
7
|
import { getS3Client, parseS3Url } from "../util/s3.js";
|
|
6
8
|
import { isNullOrUndefined, isUndefined } from "@sindresorhus/is";
|
|
@@ -15,6 +17,22 @@ function addBranchStats(config, branchesInformation) {
|
|
|
15
17
|
coerceRepo(config.repository);
|
|
16
18
|
report.repositories[config.repository].branches = branchesInformation;
|
|
17
19
|
}
|
|
20
|
+
function addRepositoryMetadata(config, configFileName, prList) {
|
|
21
|
+
if (isNullOrUndefined(config.reportType)) return;
|
|
22
|
+
coerceRepo(config.repository);
|
|
23
|
+
const repoReport = report.repositories[config.repository];
|
|
24
|
+
repoReport.platform = GlobalConfig.get("platform");
|
|
25
|
+
repoReport.defaultBranch = config.defaultBranch;
|
|
26
|
+
repoReport.dependencyDashboardIssue = config.dependencyDashboardIssue ?? null;
|
|
27
|
+
if (configFileName) repoReport.configFileName = configFileName;
|
|
28
|
+
const onboardingBranch = getInheritedOrGlobal("onboardingBranch");
|
|
29
|
+
repoReport.onboardingPrNumber = prList.find((pr) => pr.sourceBranch === onboardingBranch && pr.state === "open")?.number ?? null;
|
|
30
|
+
}
|
|
31
|
+
function addRepositoryStatus(config, status) {
|
|
32
|
+
if (isNullOrUndefined(config.reportType)) return;
|
|
33
|
+
coerceRepo(config.repository);
|
|
34
|
+
report.repositories[config.repository].status = status;
|
|
35
|
+
}
|
|
18
36
|
function addExtractionStats(config, extractResult) {
|
|
19
37
|
if (isNullOrUndefined(config.reportType)) return;
|
|
20
38
|
coerceRepo(config.repository);
|
|
@@ -87,6 +105,6 @@ function coerceRepo(repository) {
|
|
|
87
105
|
};
|
|
88
106
|
}
|
|
89
107
|
//#endregion
|
|
90
|
-
export { addBranchStats, addExtractionStats, addLibYears, exportStats, finalizeReport };
|
|
108
|
+
export { addBranchStats, addExtractionStats, addLibYears, addRepositoryMetadata, addRepositoryStatus, exportStats, finalizeReport };
|
|
91
109
|
|
|
92
110
|
//# sourceMappingURL=reporting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporting.js","names":[],"sources":["../../lib/instrumentation/reporting.ts"],"sourcesContent":["import type { PutObjectCommandInput } from '@aws-sdk/client-s3';\nimport { PutObjectCommand } from '@aws-sdk/client-s3';\nimport { isNullOrUndefined, isUndefined } from '@sindresorhus/is';\nimport type { RenovateConfig } from '../config/types.ts';\nimport { prettier } from '../expose.ts';\nimport { getProblems, logger } from '../logger/index.ts';\nimport { sanitizeValue } from '../logger/utils.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport { writeSystemFile } from '../util/fs/index.ts';\nimport { getS3Client, parseS3Url } from '../util/s3.ts';\nimport type { ExtractResult } from '../workers/repository/process/extract-update.ts';\nimport type { LibYearsWithStatus, Report } from './types.ts';\n\nconst report: Report = {\n problems: [],\n repositories: {},\n};\n\n/**\n * Reset the report\n * Should only be used for testing\n */\nexport function resetReport(): void {\n report.problems = [];\n report.repositories = {};\n}\n\nexport function addBranchStats(\n config: RenovateConfig,\n branchesInformation: Partial<BranchCache>[],\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].branches = branchesInformation;\n}\n\nexport function addExtractionStats(\n config: RenovateConfig,\n extractResult: ExtractResult,\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].packageFiles =\n extractResult.packageFiles;\n}\n\nexport function addLibYears(\n config: RenovateConfig,\n libYearsWithDepCount: LibYearsWithStatus,\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].libYearsWithStatus =\n libYearsWithDepCount;\n}\n\nexport function finalizeReport(): void {\n const allProblems = structuredClone(getProblems());\n for (const problem of allProblems) {\n const repository = problem.repository;\n delete problem.repository;\n\n // if the problem can be connected to a repository add it their else add to the root list\n if (repository) {\n coerceRepo(repository);\n report.repositories[repository].problems.push(problem);\n } else {\n report.problems.push(problem);\n }\n }\n}\n\n/**\n * Returns the report as JSON, sanitized like a log record.\n */\nasync function getReportBody(config: RenovateConfig): Promise<string> {\n const json = JSON.stringify(sanitizeValue(report));\n if (!config.reportFormatting) {\n return json;\n }\n return prettier().format(json, { parser: 'json' });\n}\n\nexport async function exportStats(config: RenovateConfig): Promise<void> {\n try {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n if (config.reportType === 'logging') {\n logger.info({ report }, 'Printing report');\n return;\n }\n\n if (config.reportType === 'file') {\n const path = config.reportPath!;\n await writeSystemFile(path, await getReportBody(config));\n logger.debug({ path }, 'Writing report');\n return;\n }\n\n // v8 ignore else -- TODO: add test #40625\n if (config.reportType === 's3') {\n const s3Url = parseS3Url(config.reportPath!);\n if (isNullOrUndefined(s3Url)) {\n logger.warn(\n { reportPath: config.reportPath },\n 'Failed to parse s3 URL',\n );\n return;\n }\n\n const s3Params: PutObjectCommandInput = {\n Bucket: s3Url.Bucket,\n Key: s3Url.Key,\n Body: await getReportBody(config),\n ContentType: 'application/json',\n };\n\n const client = getS3Client(config.s3Endpoint, config.s3PathStyle);\n const command = new PutObjectCommand(s3Params);\n await client.send(command);\n }\n } catch (err) {\n logger.warn({ err }, 'Reporting.exportStats() - failure');\n }\n}\n\nexport function getReport(): Report {\n return structuredClone(report);\n}\n\nfunction coerceRepo(repository: string): void {\n if (!isUndefined(report.repositories[repository])) {\n return;\n }\n\n report.repositories[repository] = {\n problems: [],\n branches: [],\n packageFiles: {},\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reporting.js","names":[],"sources":["../../lib/instrumentation/reporting.ts"],"sourcesContent":["import type { PutObjectCommandInput } from '@aws-sdk/client-s3';\nimport { PutObjectCommand } from '@aws-sdk/client-s3';\nimport { isNullOrUndefined, isUndefined } from '@sindresorhus/is';\nimport { GlobalConfig } from '../config/global.ts';\nimport type { RenovateConfig } from '../config/types.ts';\nimport { prettier } from '../expose.ts';\nimport { getProblems, logger } from '../logger/index.ts';\nimport { sanitizeValue } from '../logger/utils.ts';\nimport type { Pr } from '../modules/platform/index.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport { getInheritedOrGlobal } from '../util/common.ts';\nimport { writeSystemFile } from '../util/fs/index.ts';\nimport { getS3Client, parseS3Url } from '../util/s3.ts';\nimport type { ExtractResult } from '../workers/repository/process/extract-update.ts';\nimport type { ProcessStatus } from '../workers/repository/result.ts';\nimport type { LibYearsWithStatus, Report } from './types.ts';\n\nconst report: Report = {\n problems: [],\n repositories: {},\n};\n\n/**\n * Reset the report\n * Should only be used for testing\n */\nexport function resetReport(): void {\n report.problems = [];\n report.repositories = {};\n}\n\nexport function addBranchStats(\n config: RenovateConfig,\n branchesInformation: Partial<BranchCache>[],\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].branches = branchesInformation;\n}\n\nexport function addRepositoryMetadata(\n config: RenovateConfig,\n configFileName: string | undefined,\n prList: Pr[],\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n const repoReport = report.repositories[config.repository!];\n repoReport.platform = GlobalConfig.get('platform');\n repoReport.defaultBranch = config.defaultBranch;\n repoReport.dependencyDashboardIssue = config.dependencyDashboardIssue ?? null;\n // Omit when there is no in-repo config file (cache stores an empty string).\n if (configFileName) {\n repoReport.configFileName = configFileName;\n }\n\n const onboardingBranch = getInheritedOrGlobal('onboardingBranch');\n const onboardingPr = prList.find(\n (pr) => pr.sourceBranch === onboardingBranch && pr.state === 'open',\n );\n repoReport.onboardingPrNumber = onboardingPr?.number ?? null;\n}\n\nexport function addRepositoryStatus(\n config: RenovateConfig,\n status: ProcessStatus,\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].status = status;\n}\n\nexport function addExtractionStats(\n config: RenovateConfig,\n extractResult: ExtractResult,\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].packageFiles =\n extractResult.packageFiles;\n}\n\nexport function addLibYears(\n config: RenovateConfig,\n libYearsWithDepCount: LibYearsWithStatus,\n): void {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n coerceRepo(config.repository!);\n report.repositories[config.repository!].libYearsWithStatus =\n libYearsWithDepCount;\n}\n\nexport function finalizeReport(): void {\n const allProblems = structuredClone(getProblems());\n for (const problem of allProblems) {\n const repository = problem.repository;\n delete problem.repository;\n\n // if the problem can be connected to a repository add it their else add to the root list\n if (repository) {\n coerceRepo(repository);\n report.repositories[repository].problems.push(problem);\n } else {\n report.problems.push(problem);\n }\n }\n}\n\n/**\n * Returns the report as JSON, sanitized like a log record.\n */\nasync function getReportBody(config: RenovateConfig): Promise<string> {\n const json = JSON.stringify(sanitizeValue(report));\n if (!config.reportFormatting) {\n return json;\n }\n return prettier().format(json, { parser: 'json' });\n}\n\nexport async function exportStats(config: RenovateConfig): Promise<void> {\n try {\n if (isNullOrUndefined(config.reportType)) {\n return;\n }\n\n if (config.reportType === 'logging') {\n logger.info({ report }, 'Printing report');\n return;\n }\n\n if (config.reportType === 'file') {\n const path = config.reportPath!;\n await writeSystemFile(path, await getReportBody(config));\n logger.debug({ path }, 'Writing report');\n return;\n }\n\n // v8 ignore else -- TODO: add test #40625\n if (config.reportType === 's3') {\n const s3Url = parseS3Url(config.reportPath!);\n if (isNullOrUndefined(s3Url)) {\n logger.warn(\n { reportPath: config.reportPath },\n 'Failed to parse s3 URL',\n );\n return;\n }\n\n const s3Params: PutObjectCommandInput = {\n Bucket: s3Url.Bucket,\n Key: s3Url.Key,\n Body: await getReportBody(config),\n ContentType: 'application/json',\n };\n\n const client = getS3Client(config.s3Endpoint, config.s3PathStyle);\n const command = new PutObjectCommand(s3Params);\n await client.send(command);\n }\n } catch (err) {\n logger.warn({ err }, 'Reporting.exportStats() - failure');\n }\n}\n\nexport function getReport(): Report {\n return structuredClone(report);\n}\n\nfunction coerceRepo(repository: string): void {\n if (!isUndefined(report.repositories[repository])) {\n return;\n }\n\n report.repositories[repository] = {\n problems: [],\n branches: [],\n packageFiles: {},\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { PlatformId } from "../constants/platforms.js";
|
|
1
2
|
import { BunyanRecord } from "../logger/types.js";
|
|
2
3
|
import { GitOperationType } from "../util/git/types.js";
|
|
3
4
|
import { BranchCache } from "../util/cache/repository/types.js";
|
|
5
|
+
import { ProcessStatus } from "../workers/repository/result.js";
|
|
4
6
|
import { PackageFile } from "../modules/manager/types.js";
|
|
5
7
|
import { RenovateSplit } from "../config/types.js";
|
|
6
8
|
import { Attributes, SpanKind, SpanOptions } from "@opentelemetry/api";
|
|
@@ -47,6 +49,31 @@ interface RepoReport {
|
|
|
47
49
|
branches: Partial<BranchCache>[];
|
|
48
50
|
packageFiles: Record<string, PackageFile[]>;
|
|
49
51
|
libYearsWithStatus?: LibYearsWithStatus;
|
|
52
|
+
/**
|
|
53
|
+
* The platform type of the repository (ex: `github`, `gitlab`).
|
|
54
|
+
*/
|
|
55
|
+
platform?: PlatformId;
|
|
56
|
+
/**
|
|
57
|
+
* The default branch name of the repository.
|
|
58
|
+
*/
|
|
59
|
+
defaultBranch?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The issue number of the Dependency Dashboard, or `null` if none exists.
|
|
62
|
+
*/
|
|
63
|
+
dependencyDashboardIssue?: number | null;
|
|
64
|
+
/**
|
|
65
|
+
* Path to the repository's Renovate config file (ex: `.github/renovate.json5`).
|
|
66
|
+
* Omitted when the repository has no in-repo config file.
|
|
67
|
+
*/
|
|
68
|
+
configFileName?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The repository's processing status (ex: `onboarding`, `onboarded`, `activated`).
|
|
71
|
+
*/
|
|
72
|
+
status?: ProcessStatus;
|
|
73
|
+
/**
|
|
74
|
+
* The number of the open (unmerged) onboarding PR, or `null` if none exists.
|
|
75
|
+
*/
|
|
76
|
+
onboardingPrNumber?: number | null;
|
|
50
77
|
}
|
|
51
78
|
export interface LibYearsWithStatus {
|
|
52
79
|
libYears: LibYears;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../lib/instrumentation/types.ts"],"sourcesContent":["import type { Attributes, SpanKind, SpanOptions } from '@opentelemetry/api';\nimport type { ATTR_CODE_FUNCTION_NAME } from '@opentelemetry/semantic-conventions';\nimport type { RenovateSplit } from '../config/types.ts';\nimport type { BunyanRecord } from '../logger/types.ts';\nimport type { PackageFile } from '../modules/manager/types.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport type { GitOperationType } from '../util/git/types.ts';\n\nexport type RenovateSpanOptions = {\n attributes?: RenovateSpanAttributes;\n} & SpanOptions;\n\nexport type RenovateSpanAttributes = {\n [ATTR_RENOVATE_SPLIT]?: RenovateSplit;\n [ATTR_VCS_GIT_OPERATION_TYPE]?: GitOperationType;\n [ATTR_CODE_FUNCTION_NAME]?: string;\n [ATTR_RENOVATE_DATASOURCE]?: string;\n [ATTR_RENOVATE_REGISTRY_URL]?: string;\n [ATTR_RENOVATE_PACKAGE_NAME]?: string;\n} & Attributes;\n\n/**\n * The instrumentation parameters.\n */\nexport interface SpanParameters {\n /**\n * The name of the span\n */\n name: string;\n\n /**\n * Attributes which should be added to the span\n */\n attributes?: RenovateSpanAttributes | undefined;\n\n /**\n * Should this span be added to the root span or to the current active span\n */\n ignoreParentSpan?: boolean;\n\n /**\n * Type of span this represents. Default: SpanKind.Internal\n */\n kind?: SpanKind;\n}\n\nexport interface Report {\n problems: BunyanRecord[];\n repositories: Record<string, RepoReport>;\n}\n\ninterface RepoReport {\n problems: BunyanRecord[];\n branches: Partial<BranchCache>[];\n packageFiles: Record<string, PackageFile[]>;\n libYearsWithStatus?: LibYearsWithStatus;\n}\n\nexport interface LibYearsWithStatus {\n libYears: LibYears;\n dependencyStatus: DependencyStatus;\n}\n\nexport interface LibYears {\n total: number;\n managers: Record<string, number>;\n}\n\nexport interface DependencyStatus {\n outdated: number;\n total: number;\n}\n\nexport const ATTR_RENOVATE_SPLIT = 'renovate.split';\n\n/**\n * The name of a Renovate datasource (ex: `github-tags`, `npm`, `docker`, etc).\n */\nexport const ATTR_RENOVATE_DATASOURCE = 'renovate.datasource';\n\n/**\n * The registry URL of a registry URL as might be used with a datasource and package name.\n */\nexport const ATTR_RENOVATE_REGISTRY_URL = 'renovate.registryUrl';\n\n/**\n * The package name of a package.\n */\nexport const ATTR_RENOVATE_PACKAGE_NAME = 'renovate.packageName';\n\n/**\n * the Git Version Control System (VCS)'s Operation Type\n *\n * @see GitOperationType\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n *\n */\nexport const ATTR_VCS_GIT_OPERATION_TYPE = 'vcs.git.operation.type';\n\n/**\n * the Git Version Control System (VCS)'s subcommand\n *\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n * */\nexport const ATTR_VCS_GIT_SUBCOMMAND = 'vcs.git.subcommand';\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../lib/instrumentation/types.ts"],"sourcesContent":["import type { Attributes, SpanKind, SpanOptions } from '@opentelemetry/api';\nimport type { ATTR_CODE_FUNCTION_NAME } from '@opentelemetry/semantic-conventions';\nimport type { RenovateSplit } from '../config/types.ts';\nimport type { PlatformId } from '../constants/index.ts';\nimport type { BunyanRecord } from '../logger/types.ts';\nimport type { PackageFile } from '../modules/manager/types.ts';\nimport type { BranchCache } from '../util/cache/repository/types.ts';\nimport type { GitOperationType } from '../util/git/types.ts';\nimport type { ProcessStatus } from '../workers/repository/result.ts';\n\nexport type RenovateSpanOptions = {\n attributes?: RenovateSpanAttributes;\n} & SpanOptions;\n\nexport type RenovateSpanAttributes = {\n [ATTR_RENOVATE_SPLIT]?: RenovateSplit;\n [ATTR_VCS_GIT_OPERATION_TYPE]?: GitOperationType;\n [ATTR_CODE_FUNCTION_NAME]?: string;\n [ATTR_RENOVATE_DATASOURCE]?: string;\n [ATTR_RENOVATE_REGISTRY_URL]?: string;\n [ATTR_RENOVATE_PACKAGE_NAME]?: string;\n} & Attributes;\n\n/**\n * The instrumentation parameters.\n */\nexport interface SpanParameters {\n /**\n * The name of the span\n */\n name: string;\n\n /**\n * Attributes which should be added to the span\n */\n attributes?: RenovateSpanAttributes | undefined;\n\n /**\n * Should this span be added to the root span or to the current active span\n */\n ignoreParentSpan?: boolean;\n\n /**\n * Type of span this represents. Default: SpanKind.Internal\n */\n kind?: SpanKind;\n}\n\nexport interface Report {\n problems: BunyanRecord[];\n repositories: Record<string, RepoReport>;\n}\n\ninterface RepoReport {\n problems: BunyanRecord[];\n branches: Partial<BranchCache>[];\n packageFiles: Record<string, PackageFile[]>;\n libYearsWithStatus?: LibYearsWithStatus;\n /**\n * The platform type of the repository (ex: `github`, `gitlab`).\n */\n platform?: PlatformId;\n /**\n * The default branch name of the repository.\n */\n defaultBranch?: string;\n /**\n * The issue number of the Dependency Dashboard, or `null` if none exists.\n */\n dependencyDashboardIssue?: number | null;\n /**\n * Path to the repository's Renovate config file (ex: `.github/renovate.json5`).\n * Omitted when the repository has no in-repo config file.\n */\n configFileName?: string;\n /**\n * The repository's processing status (ex: `onboarding`, `onboarded`, `activated`).\n */\n status?: ProcessStatus;\n /**\n * The number of the open (unmerged) onboarding PR, or `null` if none exists.\n */\n onboardingPrNumber?: number | null;\n}\n\nexport interface LibYearsWithStatus {\n libYears: LibYears;\n dependencyStatus: DependencyStatus;\n}\n\nexport interface LibYears {\n total: number;\n managers: Record<string, number>;\n}\n\nexport interface DependencyStatus {\n outdated: number;\n total: number;\n}\n\nexport const ATTR_RENOVATE_SPLIT = 'renovate.split';\n\n/**\n * The name of a Renovate datasource (ex: `github-tags`, `npm`, `docker`, etc).\n */\nexport const ATTR_RENOVATE_DATASOURCE = 'renovate.datasource';\n\n/**\n * The registry URL of a registry URL as might be used with a datasource and package name.\n */\nexport const ATTR_RENOVATE_REGISTRY_URL = 'renovate.registryUrl';\n\n/**\n * The package name of a package.\n */\nexport const ATTR_RENOVATE_PACKAGE_NAME = 'renovate.packageName';\n\n/**\n * the Git Version Control System (VCS)'s Operation Type\n *\n * @see GitOperationType\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n *\n */\nexport const ATTR_VCS_GIT_OPERATION_TYPE = 'vcs.git.operation.type';\n\n/**\n * the Git Version Control System (VCS)'s subcommand\n *\n * @see https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/\n * */\nexport const ATTR_VCS_GIT_SUBCOMMAND = 'vcs.git.subcommand';\n"],"mappings":";AAoGA,MAAa,sBAAsB;;;;AAKnC,MAAa,2BAA2B;;;;AAKxC,MAAa,6BAA6B;;;;AAK1C,MAAa,6BAA6B;;;;;;;;AAS1C,MAAa,8BAA8B;;;;;;AAO3C,MAAa,0BAA0B"}
|
|
@@ -16,8 +16,8 @@ import { clear as clear$1 } from "../../util/http/queue.js";
|
|
|
16
16
|
import { clear as clear$2 } from "../../util/http/throttle.js";
|
|
17
17
|
import { isLimitReached } from "./limits.js";
|
|
18
18
|
import { autodiscoverRepositories } from "./autodiscover.js";
|
|
19
|
-
import { filterConfig } from "../../config/index.js";
|
|
20
19
|
import { exportStats, finalizeReport } from "../../instrumentation/reporting.js";
|
|
20
|
+
import { filterConfig } from "../../config/index.js";
|
|
21
21
|
import { renovateRepository } from "../repository/index.js";
|
|
22
22
|
import { globalFinalize, globalInitialize } from "./initialize.js";
|
|
23
23
|
import { isNonEmptyObject, isNonEmptyString, isNonEmptyStringAndNotWhitespace, isString } from "@sindresorhus/is";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { logger } from "../../../logger/index.js";
|
|
2
2
|
import { getInheritedOrGlobal } from "../../../util/common.js";
|
|
3
|
-
import { saveCache } from "../../../util/cache/repository/index.js";
|
|
3
|
+
import { getCache, saveCache } from "../../../util/cache/repository/index.js";
|
|
4
4
|
import { clearRenovateRefs } from "../../../util/git/index.js";
|
|
5
5
|
import { platform } from "../../../modules/platform/index.js";
|
|
6
|
+
import { addRepositoryMetadata } from "../../../instrumentation/reporting.js";
|
|
6
7
|
import { PackageFiles } from "../package-files.js";
|
|
7
8
|
import { checkReconfigureBranch } from "../reconfigure/index.js";
|
|
8
9
|
import { pruneStaleBranches } from "./prune.js";
|
|
@@ -23,6 +24,7 @@ async function finalizeRepo(config, branchList, repoConfig) {
|
|
|
23
24
|
}
|
|
24
25
|
runBranchSummary(config);
|
|
25
26
|
runRenovateRepoStats(config, prList);
|
|
27
|
+
addRepositoryMetadata(config, getCache().configFileName, prList);
|
|
26
28
|
}
|
|
27
29
|
// istanbul ignore next
|
|
28
30
|
function ensureIssuesClosing() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["repositoryCache.saveCache"],"sources":["../../../../lib/workers/repository/finalize/index.ts"],"sourcesContent":["import type { AllConfig, RenovateConfig } from '../../../config/types.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { platform } from '../../../modules/platform/index.ts';\nimport * as repositoryCache from '../../../util/cache/repository/index.ts';\nimport { getInheritedOrGlobal } from '../../../util/common.ts';\nimport { clearRenovateRefs } from '../../../util/git/index.ts';\nimport { PackageFiles } from '../package-files.ts';\nimport { checkReconfigureBranch } from '../reconfigure/index.ts';\nimport { pruneStaleBranches } from './prune.ts';\nimport {\n runBranchSummary,\n runRenovateRepoStats,\n} from './repository-statistics.ts';\n\n// istanbul ignore next\nexport async function finalizeRepo(\n config: RenovateConfig,\n branchList: string[],\n repoConfig: AllConfig,\n): Promise<void> {\n await checkReconfigureBranch(config, repoConfig);\n await pruneStaleBranches(config, branchList);\n await repositoryCache.saveCache();\n await ensureIssuesClosing();\n await clearRenovateRefs();\n PackageFiles.clear();\n const prList = await platform.getPrList();\n if (\n prList?.some(\n (pr) =>\n pr.state === 'merged' &&\n pr.title !== 'Configure Renovate' &&\n pr.title !== getInheritedOrGlobal('onboardingPrTitle') &&\n pr.sourceBranch !== getInheritedOrGlobal('onboardingBranch'),\n )\n ) {\n logger.debug('Repo is activated');\n config.repoIsActivated = true;\n }\n runBranchSummary(config);\n runRenovateRepoStats(config, prList);\n}\n\n// istanbul ignore next\nfunction ensureIssuesClosing(): Promise<Awaited<void>[]> {\n return Promise.all([\n platform.ensureIssueClosing(`Action Required: Fix Renovate Configuration`),\n platform.ensureIssueClosing(`Action Required: Add missing credentials`),\n ]);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["repositoryCache.saveCache","repositoryCache.getCache"],"sources":["../../../../lib/workers/repository/finalize/index.ts"],"sourcesContent":["import type { AllConfig, RenovateConfig } from '../../../config/types.ts';\nimport { addRepositoryMetadata } from '../../../instrumentation/reporting.ts';\nimport { logger } from '../../../logger/index.ts';\nimport { platform } from '../../../modules/platform/index.ts';\nimport * as repositoryCache from '../../../util/cache/repository/index.ts';\nimport { getInheritedOrGlobal } from '../../../util/common.ts';\nimport { clearRenovateRefs } from '../../../util/git/index.ts';\nimport { PackageFiles } from '../package-files.ts';\nimport { checkReconfigureBranch } from '../reconfigure/index.ts';\nimport { pruneStaleBranches } from './prune.ts';\nimport {\n runBranchSummary,\n runRenovateRepoStats,\n} from './repository-statistics.ts';\n\n// istanbul ignore next\nexport async function finalizeRepo(\n config: RenovateConfig,\n branchList: string[],\n repoConfig: AllConfig,\n): Promise<void> {\n await checkReconfigureBranch(config, repoConfig);\n await pruneStaleBranches(config, branchList);\n await repositoryCache.saveCache();\n await ensureIssuesClosing();\n await clearRenovateRefs();\n PackageFiles.clear();\n const prList = await platform.getPrList();\n if (\n prList?.some(\n (pr) =>\n pr.state === 'merged' &&\n pr.title !== 'Configure Renovate' &&\n pr.title !== getInheritedOrGlobal('onboardingPrTitle') &&\n pr.sourceBranch !== getInheritedOrGlobal('onboardingBranch'),\n )\n ) {\n logger.debug('Repo is activated');\n config.repoIsActivated = true;\n }\n runBranchSummary(config);\n runRenovateRepoStats(config, prList);\n addRepositoryMetadata(\n config,\n repositoryCache.getCache().configFileName,\n prList,\n );\n}\n\n// istanbul ignore next\nfunction ensureIssuesClosing(): Promise<Awaited<void>[]> {\n return Promise.all([\n platform.ensureIssueClosing(`Action Required: Fix Renovate Configuration`),\n platform.ensureIssueClosing(`Action Required: Add missing credentials`),\n ]);\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,eAAsB,aACpB,QACA,YACA,YACe;CACf,MAAM,uBAAuB,QAAQ,UAAU;CAC/C,MAAM,mBAAmB,QAAQ,UAAU;CAC3C,MAAMA,UAA0B;CAChC,MAAM,oBAAoB;CAC1B,MAAM,kBAAkB;CACxB,aAAa,MAAM;CACnB,MAAM,SAAS,MAAM,SAAS,UAAU;CACxC,IACE,QAAQ,MACL,OACC,GAAG,UAAU,YACb,GAAG,UAAU,wBACb,GAAG,UAAU,qBAAqB,mBAAmB,KACrD,GAAG,iBAAiB,qBAAqB,kBAAkB,CAC/D,GACA;EACA,OAAO,MAAM,mBAAmB;EAChC,OAAO,kBAAkB;CAC3B;CACA,iBAAiB,MAAM;CACvB,qBAAqB,QAAQ,MAAM;CACnC,sBACE,QACAC,SAAyB,CAAC,CAAC,gBAC3B,MACF;AACF;;AAGA,SAAS,sBAAgD;CACvD,OAAO,QAAQ,IAAI,CACjB,SAAS,mBAAmB,6CAA6C,GACzE,SAAS,mBAAmB,0CAA0C,CACxE,CAAC;AACH"}
|
|
@@ -47,7 +47,7 @@ function filterDependencyDashboardData(branches) {
|
|
|
47
47
|
const branchesFiltered = [];
|
|
48
48
|
for (const branch of branches) {
|
|
49
49
|
const upgradesFiltered = [];
|
|
50
|
-
const { branchName, prNo, prTitle, result, upgrades, prBlockedBy } = branch;
|
|
50
|
+
const { baseBranch, branchName, prNo, prTitle, result, upgrades, prBlockedBy } = branch;
|
|
51
51
|
for (const upgrade of coerceArray(upgrades)) {
|
|
52
52
|
const { datasource, depName, displayPending, fixedVersion, currentVersion, currentValue, currentDigest, newValue, newVersion, newDigest, packageFile, updateType, packageName } = upgrade;
|
|
53
53
|
const filteredUpgrade = {
|
|
@@ -68,6 +68,7 @@ function filterDependencyDashboardData(branches) {
|
|
|
68
68
|
upgradesFiltered.push(filteredUpgrade);
|
|
69
69
|
}
|
|
70
70
|
const filteredBranch = {
|
|
71
|
+
baseBranch,
|
|
71
72
|
branchName,
|
|
72
73
|
prNo,
|
|
73
74
|
prTitle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-statistics.js","names":[],"sources":["../../../../lib/workers/repository/finalize/repository-statistics.ts"],"sourcesContent":["import type { RenovateConfig } from '../../../config/types.ts';\nimport { addBranchStats } from '../../../instrumentation/reporting.ts';\nimport { logger } from '../../../logger/index.ts';\nimport type { Pr } from '../../../modules/platform/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport {\n getCache,\n isCacheModified,\n} from '../../../util/cache/repository/index.ts';\nimport type {\n BranchCache,\n BranchUpgradeCache,\n} from '../../../util/cache/repository/types.ts';\nimport { getInheritedOrGlobal } from '../../../util/common.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport type {\n BaseBranchMetadata,\n BaseBranchUpdateSummary,\n BranchMetadata,\n BranchSummary,\n ManagerUpdateSummary,\n UpdateSummary,\n} from '../../types.ts';\n\nexport function runRenovateRepoStats(\n config: RenovateConfig,\n prList: Pr[],\n): void {\n const prStats = { total: 0, open: 0, closed: 0, merged: 0 };\n let lastPRMergedAt: string | undefined;\n\n for (const pr of prList) {\n if (\n pr.title === 'Configure Renovate' ||\n pr.title === getInheritedOrGlobal('onboardingPrTitle')\n ) {\n continue;\n }\n prStats.total += 1;\n switch (pr.state) {\n case 'merged':\n prStats.merged += 1;\n if (pr.closedAt && (!lastPRMergedAt || pr.closedAt > lastPRMergedAt)) {\n lastPRMergedAt = pr.closedAt;\n }\n break;\n case 'closed':\n prStats.closed += 1;\n break;\n case 'open':\n prStats.open += 1;\n break;\n default:\n break;\n }\n }\n logger.debug(\n { stats: prStats, lastPRMergedAt },\n `Renovate repository PR statistics`,\n );\n}\n\nfunction branchCacheToMetadata({\n automerge,\n baseBranch,\n baseBranchSha,\n branchName,\n isModified,\n pristine: isPristine,\n sha: branchSha,\n}: BranchCache): BranchMetadata {\n return {\n automerge,\n baseBranch,\n baseBranchSha,\n branchName,\n branchSha,\n isModified,\n isPristine,\n };\n}\n\nfunction filterDependencyDashboardData(\n branches: BranchCache[],\n): Partial<BranchCache>[] {\n const branchesFiltered: Partial<BranchCache>[] = [];\n for (const branch of branches) {\n const upgradesFiltered: Partial<BranchUpgradeCache>[] = [];\n const {
|
|
1
|
+
{"version":3,"file":"repository-statistics.js","names":[],"sources":["../../../../lib/workers/repository/finalize/repository-statistics.ts"],"sourcesContent":["import type { RenovateConfig } from '../../../config/types.ts';\nimport { addBranchStats } from '../../../instrumentation/reporting.ts';\nimport { logger } from '../../../logger/index.ts';\nimport type { Pr } from '../../../modules/platform/index.ts';\nimport { coerceArray } from '../../../util/array.ts';\nimport {\n getCache,\n isCacheModified,\n} from '../../../util/cache/repository/index.ts';\nimport type {\n BranchCache,\n BranchUpgradeCache,\n} from '../../../util/cache/repository/types.ts';\nimport { getInheritedOrGlobal } from '../../../util/common.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport type {\n BaseBranchMetadata,\n BaseBranchUpdateSummary,\n BranchMetadata,\n BranchSummary,\n ManagerUpdateSummary,\n UpdateSummary,\n} from '../../types.ts';\n\nexport function runRenovateRepoStats(\n config: RenovateConfig,\n prList: Pr[],\n): void {\n const prStats = { total: 0, open: 0, closed: 0, merged: 0 };\n let lastPRMergedAt: string | undefined;\n\n for (const pr of prList) {\n if (\n pr.title === 'Configure Renovate' ||\n pr.title === getInheritedOrGlobal('onboardingPrTitle')\n ) {\n continue;\n }\n prStats.total += 1;\n switch (pr.state) {\n case 'merged':\n prStats.merged += 1;\n if (pr.closedAt && (!lastPRMergedAt || pr.closedAt > lastPRMergedAt)) {\n lastPRMergedAt = pr.closedAt;\n }\n break;\n case 'closed':\n prStats.closed += 1;\n break;\n case 'open':\n prStats.open += 1;\n break;\n default:\n break;\n }\n }\n logger.debug(\n { stats: prStats, lastPRMergedAt },\n `Renovate repository PR statistics`,\n );\n}\n\nfunction branchCacheToMetadata({\n automerge,\n baseBranch,\n baseBranchSha,\n branchName,\n isModified,\n pristine: isPristine,\n sha: branchSha,\n}: BranchCache): BranchMetadata {\n return {\n automerge,\n baseBranch,\n baseBranchSha,\n branchName,\n branchSha,\n isModified,\n isPristine,\n };\n}\n\nfunction filterDependencyDashboardData(\n branches: BranchCache[],\n): Partial<BranchCache>[] {\n const branchesFiltered: Partial<BranchCache>[] = [];\n for (const branch of branches) {\n const upgradesFiltered: Partial<BranchUpgradeCache>[] = [];\n const {\n baseBranch,\n branchName,\n prNo,\n prTitle,\n result,\n upgrades,\n prBlockedBy,\n } = branch;\n\n for (const upgrade of coerceArray(upgrades)) {\n const {\n datasource,\n depName,\n displayPending,\n fixedVersion,\n currentVersion,\n currentValue,\n currentDigest,\n newValue,\n newVersion,\n newDigest,\n packageFile,\n updateType,\n packageName,\n } = upgrade;\n\n const filteredUpgrade: Partial<BranchUpgradeCache> = {\n datasource,\n depName,\n displayPending,\n fixedVersion,\n currentVersion,\n currentValue,\n currentDigest,\n newValue,\n newVersion,\n newDigest,\n packageFile,\n updateType,\n packageName,\n };\n upgradesFiltered.push(filteredUpgrade);\n }\n\n const filteredBranch: Partial<BranchCache> = {\n baseBranch,\n branchName,\n prNo,\n prTitle,\n result,\n prBlockedBy,\n upgrades: upgradesFiltered,\n };\n branchesFiltered.push(filteredBranch);\n }\n\n return branchesFiltered;\n}\n\nexport function runBranchSummary(config: RenovateConfig): void {\n const defaultBranch = config.defaultBranch;\n const { scan, branches } = getCache();\n\n const baseMetadata: BaseBranchMetadata[] = [];\n for (const [branchName, cached] of Object.entries(coerceObject(scan))) {\n baseMetadata.push({ branchName, sha: cached.sha });\n }\n\n const branchMetadata: BranchMetadata[] = [];\n const inactiveBranches: string[] = [];\n\n for (const branch of coerceArray(branches)) {\n if (branch.sha) {\n branchMetadata.push(branchCacheToMetadata(branch));\n } else {\n inactiveBranches.push(branch.branchName);\n }\n }\n\n const res: BranchSummary = {\n cacheModified: isCacheModified(),\n baseBranches: baseMetadata,\n branches: branchMetadata,\n defaultBranch,\n inactiveBranches,\n };\n\n logger.debug(res, 'Branch summary');\n\n if (branches?.length) {\n const branchesInformation = filterDependencyDashboardData(branches);\n addBranchStats(config, branchesInformation);\n logger.debug({ branchesInformation }, 'branches info extended');\n\n const updateSummary = getUpdateSummary(branches);\n logger.debug({ updateSummary }, 'Updates summary');\n }\n}\n\nexport function getUpdateSummary(branches: BranchCache[]): UpdateSummary {\n const summaryByBase = new Map<string, BaseBranchUpdateSummary>();\n\n for (const branch of branches) {\n const baseBranch = branch.baseBranch ?? '';\n let entry = summaryByBase.get(baseBranch);\n if (!entry) {\n entry = {\n baseBranch,\n total: 0,\n vulnerabilityAlert: 0,\n updates: {},\n managers: {},\n };\n summaryByBase.set(baseBranch, entry);\n }\n for (const upgrade of coerceArray(branch.upgrades)) {\n const { updateType } = upgrade;\n if (updateType) {\n entry.total += 1;\n if (upgrade.isVulnerabilityAlert) {\n entry.vulnerabilityAlert += 1;\n }\n\n entry.updates[updateType] = (entry.updates[updateType] ?? 0) + 1;\n\n const manager = upgrade.manager ?? '';\n let managerEntry: ManagerUpdateSummary | undefined =\n entry.managers[manager];\n if (!managerEntry) {\n managerEntry = { total: 0, vulnerabilityAlert: 0, updates: {} };\n entry.managers[manager] = managerEntry;\n }\n managerEntry.total += 1;\n if (upgrade.isVulnerabilityAlert) {\n managerEntry.vulnerabilityAlert += 1;\n }\n managerEntry.updates[updateType] =\n (managerEntry.updates[updateType] ?? 0) + 1;\n } else {\n logger.debug(\n { upgrade },\n 'Found an upgrade without an updateType, which should not be possible',\n );\n }\n }\n }\n\n return Array.from(summaryByBase.values());\n}\n"],"mappings":"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"}
|
|
@@ -13,8 +13,8 @@ import { clear } from "../../util/http/queue.js";
|
|
|
13
13
|
import { clear as clear$1 } from "../../util/http/throttle.js";
|
|
14
14
|
import { removeDanglingContainers } from "../../util/exec/docker/index.js";
|
|
15
15
|
import { isCloned } from "../../util/git/index.js";
|
|
16
|
-
import { processResult } from "./result.js";
|
|
17
16
|
import { addExtractionStats } from "../../instrumentation/reporting.js";
|
|
17
|
+
import { processResult } from "./result.js";
|
|
18
18
|
import { detectSemanticCommits } from "../../util/git/semantic.js";
|
|
19
19
|
import { addSplit, getSplits, splitInit } from "../../util/split.js";
|
|
20
20
|
import { setBranchCache } from "./cache.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CONFIG_SECRETS_EXPOSED, CONFIG_VALIDATION, ConfigErrors, EXTERNAL_HOST_ERROR, MANAGER_LOCKFILE_ERROR, MISSING_API_CREDENTIALS, PlatformErrors, RepositoryErrors, SystemErrors, TemporaryErrors, UNKNOWN_ERROR } from "../../constants/error-messages.js";
|
|
2
2
|
import { logger } from "../../logger/index.js";
|
|
3
|
+
import { addRepositoryStatus } from "../../instrumentation/reporting.js";
|
|
3
4
|
//#region lib/workers/repository/result.ts
|
|
4
5
|
/**
|
|
5
6
|
* Exit code per known error group, used when `exitCodeForErrors` is enabled.
|
|
@@ -51,6 +52,7 @@ function processResult(config, res) {
|
|
|
51
52
|
status = "unknown";
|
|
52
53
|
}
|
|
53
54
|
logger.debug(`Repository result: ${res}, status: ${status}, enabled: ${enabled}, onboarded: ${onboarded}`);
|
|
55
|
+
addRepositoryStatus(config, status);
|
|
54
56
|
return {
|
|
55
57
|
res,
|
|
56
58
|
status,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","names":[],"sources":["../../../lib/workers/repository/result.ts"],"sourcesContent":["import type { RenovateConfig } from '../../config/types.ts';\n\nimport {\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n ConfigErrors,\n EXTERNAL_HOST_ERROR,\n MANAGER_LOCKFILE_ERROR,\n MISSING_API_CREDENTIALS,\n PlatformErrors,\n RepositoryErrors,\n SystemErrors,\n TemporaryErrors,\n UNKNOWN_ERROR,\n} from '../../constants/error-messages.ts';\n\nimport { logger } from '../../logger/index.ts';\n\nexport type ProcessStatus =\n /**\n * The repository has been disabled, and will not be processed.\n *\n * See {@link RepositoryErrors} for information on which statuses lead to this.\n */\n | 'disabled'\n /**\n * The repository has onboarded to Renovate, so will see PRs and/or branches raised by Renovate.\n *\n * The repository has not yet merged any PRs, or the repository performs branch-based automerge and those have not been detected (TODO #40635).\n */\n | 'onboarded'\n /**\n * The repository has onboarded to Renovate, and has merged at least 1 Renovate PR.\n *\n * The repository may also perform branch-based automerge which has not been detected (TODO #40635).\n */\n | 'activated'\n /**\n * The repository has an onboarding PR from Renovate that has not yet been reviewed and merged.\n */\n | 'onboarding'\n | 'unknown';\n\nexport interface ProcessResult {\n res: RepositoryResult;\n status: ProcessStatus;\n enabled: boolean | undefined;\n onboarded: boolean | undefined;\n /** the process exit code this result maps to, used when `exitCodeForErrors` is enabled */\n exitCode: number;\n}\n\n/** a strong type for any repository result status that Renovate may report */\nexport type RepositoryResult =\n /** repository was processed successfully */\n | 'done'\n /** Renovate performed branch-based automerge on one branch during its run */\n | 'automerged'\n /** the repository is not yet onboarded, and its onboarding PR was processed during this run */\n | 'onboarding'\n // common set of errors\n | (typeof SystemErrors)[number]\n | (typeof RepositoryErrors)[number]\n | (typeof TemporaryErrors)[number]\n | (typeof ConfigErrors)[number]\n | (typeof PlatformErrors)[number]\n // other errors\n | typeof EXTERNAL_HOST_ERROR\n | typeof MISSING_API_CREDENTIALS\n | typeof MANAGER_LOCKFILE_ERROR\n | typeof UNKNOWN_ERROR;\n\n/**\n * Exit code per known error group, used when `exitCodeForErrors` is enabled.\n *\n * `RepositoryErrors` are deliberately absent: they mean the repository is disabled, not that the run failed.\n */\nconst exitCodes: [readonly string[], number][] = [\n [SystemErrors, 3],\n [PlatformErrors, 4],\n [ConfigErrors, 5],\n [TemporaryErrors, 6],\n [[EXTERNAL_HOST_ERROR, MANAGER_LOCKFILE_ERROR, MISSING_API_CREDENTIALS], 7],\n [[UNKNOWN_ERROR], 8],\n];\n\nfunction getExitCode(res: RepositoryResult): number {\n return exitCodes.find(([errors]) => errors.includes(res))?.[1] ?? 0;\n}\n\nexport function processResult(\n config: RenovateConfig,\n res: RepositoryResult,\n): ProcessResult {\n const enabledStatuses = [\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n MISSING_API_CREDENTIALS,\n ];\n let status: ProcessStatus;\n let enabled: boolean | undefined;\n let onboarded: boolean | undefined;\n // istanbul ignore next\n if (RepositoryErrors.includes(res as (typeof RepositoryErrors)[number])) {\n status = 'disabled';\n enabled = false;\n } else if (config.repoIsActivated) {\n status = 'activated';\n enabled = true;\n onboarded = true;\n } else if (enabledStatuses.includes(res) || config.repoIsOnboarded) {\n status = 'onboarded';\n enabled = true;\n onboarded = true;\n } else if (config.repoIsOnboarded === false) {\n status = 'onboarding';\n enabled = true;\n onboarded = false;\n } else {\n logger.debug(`Unknown res: ${res}`);\n status = 'unknown';\n }\n logger.debug(\n // TODO: types (#22198)\n `Repository result: ${res}, status: ${status}, enabled: ${enabled!}, onboarded: ${onboarded!}`,\n );\n return { res, status, enabled, onboarded, exitCode: getExitCode(res) };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"result.js","names":[],"sources":["../../../lib/workers/repository/result.ts"],"sourcesContent":["import type { RenovateConfig } from '../../config/types.ts';\n\nimport {\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n ConfigErrors,\n EXTERNAL_HOST_ERROR,\n MANAGER_LOCKFILE_ERROR,\n MISSING_API_CREDENTIALS,\n PlatformErrors,\n RepositoryErrors,\n SystemErrors,\n TemporaryErrors,\n UNKNOWN_ERROR,\n} from '../../constants/error-messages.ts';\n\nimport { addRepositoryStatus } from '../../instrumentation/reporting.ts';\nimport { logger } from '../../logger/index.ts';\n\nexport type ProcessStatus =\n /**\n * The repository has been disabled, and will not be processed.\n *\n * See {@link RepositoryErrors} for information on which statuses lead to this.\n */\n | 'disabled'\n /**\n * The repository has onboarded to Renovate, so will see PRs and/or branches raised by Renovate.\n *\n * The repository has not yet merged any PRs, or the repository performs branch-based automerge and those have not been detected (TODO #40635).\n */\n | 'onboarded'\n /**\n * The repository has onboarded to Renovate, and has merged at least 1 Renovate PR.\n *\n * The repository may also perform branch-based automerge which has not been detected (TODO #40635).\n */\n | 'activated'\n /**\n * The repository has an onboarding PR from Renovate that has not yet been reviewed and merged.\n */\n | 'onboarding'\n | 'unknown';\n\nexport interface ProcessResult {\n res: RepositoryResult;\n status: ProcessStatus;\n enabled: boolean | undefined;\n onboarded: boolean | undefined;\n /** the process exit code this result maps to, used when `exitCodeForErrors` is enabled */\n exitCode: number;\n}\n\n/** a strong type for any repository result status that Renovate may report */\nexport type RepositoryResult =\n /** repository was processed successfully */\n | 'done'\n /** Renovate performed branch-based automerge on one branch during its run */\n | 'automerged'\n /** the repository is not yet onboarded, and its onboarding PR was processed during this run */\n | 'onboarding'\n // common set of errors\n | (typeof SystemErrors)[number]\n | (typeof RepositoryErrors)[number]\n | (typeof TemporaryErrors)[number]\n | (typeof ConfigErrors)[number]\n | (typeof PlatformErrors)[number]\n // other errors\n | typeof EXTERNAL_HOST_ERROR\n | typeof MISSING_API_CREDENTIALS\n | typeof MANAGER_LOCKFILE_ERROR\n | typeof UNKNOWN_ERROR;\n\n/**\n * Exit code per known error group, used when `exitCodeForErrors` is enabled.\n *\n * `RepositoryErrors` are deliberately absent: they mean the repository is disabled, not that the run failed.\n */\nconst exitCodes: [readonly string[], number][] = [\n [SystemErrors, 3],\n [PlatformErrors, 4],\n [ConfigErrors, 5],\n [TemporaryErrors, 6],\n [[EXTERNAL_HOST_ERROR, MANAGER_LOCKFILE_ERROR, MISSING_API_CREDENTIALS], 7],\n [[UNKNOWN_ERROR], 8],\n];\n\nfunction getExitCode(res: RepositoryResult): number {\n return exitCodes.find(([errors]) => errors.includes(res))?.[1] ?? 0;\n}\n\nexport function processResult(\n config: RenovateConfig,\n res: RepositoryResult,\n): ProcessResult {\n const enabledStatuses = [\n CONFIG_SECRETS_EXPOSED,\n CONFIG_VALIDATION,\n MISSING_API_CREDENTIALS,\n ];\n let status: ProcessStatus;\n let enabled: boolean | undefined;\n let onboarded: boolean | undefined;\n // istanbul ignore next\n if (RepositoryErrors.includes(res as (typeof RepositoryErrors)[number])) {\n status = 'disabled';\n enabled = false;\n } else if (config.repoIsActivated) {\n status = 'activated';\n enabled = true;\n onboarded = true;\n } else if (enabledStatuses.includes(res) || config.repoIsOnboarded) {\n status = 'onboarded';\n enabled = true;\n onboarded = true;\n } else if (config.repoIsOnboarded === false) {\n status = 'onboarding';\n enabled = true;\n onboarded = false;\n } else {\n logger.debug(`Unknown res: ${res}`);\n status = 'unknown';\n }\n logger.debug(\n // TODO: types (#22198)\n `Repository result: ${res}, status: ${status}, enabled: ${enabled!}, onboarded: ${onboarded!}`,\n );\n addRepositoryStatus(config, status);\n return { res, status, enabled, onboarded, exitCode: getExitCode(res) };\n}\n"],"mappings":";;;;;;;;;AA8EA,MAAM,YAA2C;CAC/C,CAAC,cAAc,CAAC;CAChB,CAAC,gBAAgB,CAAC;CAClB,CAAC,cAAc,CAAC;CAChB,CAAC,iBAAiB,CAAC;CACnB,CAAC;EAAC;EAAqB;EAAwB;CAAuB,GAAG,CAAC;CAC1E,CAAC,CAAC,aAAa,GAAG,CAAC;AACrB;AAEA,SAAS,YAAY,KAA+B;CAClD,OAAO,UAAU,MAAM,CAAC,YAAY,OAAO,SAAS,GAAG,CAAC,CAAC,GAAG,MAAM;AACpE;AAEA,SAAgB,cACd,QACA,KACe;CACf,MAAM,kBAAkB;EACtB;EACA;EACA;CACF;CACA,IAAI;CACJ,IAAI;CACJ,IAAI;;CAEJ,IAAI,iBAAiB,SAAS,GAAwC,GAAG;EACvE,SAAS;EACT,UAAU;CACZ,OAAO,IAAI,OAAO,iBAAiB;EACjC,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,gBAAgB,SAAS,GAAG,KAAK,OAAO,iBAAiB;EAClE,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO,IAAI,OAAO,oBAAoB,OAAO;EAC3C,SAAS;EACT,UAAU;EACV,YAAY;CACd,OAAO;EACL,OAAO,MAAM,gBAAgB,KAAK;EAClC,SAAS;CACX;CACA,OAAO,MAEL,sBAAsB,IAAI,YAAY,OAAO,aAAa,QAAS,eAAe,WACpF;CACA,oBAAoB,QAAQ,MAAM;CAClC,OAAO;EAAE;EAAK;EAAQ;EAAS;EAAW,UAAU,YAAY,GAAG;CAAE;AACvE"}
|
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": "44.
|
|
4
|
+
"version": "44.197.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"@renovatebot/base-image": "13.147.0",
|
|
122
122
|
"@renovatebot/detect-tools": "4.0.23",
|
|
123
123
|
"@renovatebot/good-enough-parser": "3.0.0",
|
|
124
|
-
"@renovatebot/osv-offline": "4.
|
|
124
|
+
"@renovatebot/osv-offline": "4.4.0",
|
|
125
125
|
"@renovatebot/pep440": "5.0.1",
|
|
126
126
|
"@renovatebot/pgp": "2.0.4",
|
|
127
127
|
"@renovatebot/ruby-semver": "5.0.0",
|
|
@@ -215,14 +215,14 @@
|
|
|
215
215
|
"re2": "1.27.0"
|
|
216
216
|
},
|
|
217
217
|
"devDependencies": {
|
|
218
|
-
"@biomejs/biome": "2.
|
|
218
|
+
"@biomejs/biome": "2.6.2",
|
|
219
219
|
"@commander-js/extra-typings": "15.0.0",
|
|
220
220
|
"@containerbase/istanbul-reports-html": "2.0.23",
|
|
221
221
|
"@containerbase/semantic-release-pnpm": "1.4.3",
|
|
222
222
|
"@hyrious/marshal": "0.3.4",
|
|
223
223
|
"@ls-lint/ls-lint": "2.3.2",
|
|
224
224
|
"@openpgp/web-stream-tools": "0.3.1",
|
|
225
|
-
"@oxlint/plugins": "1.
|
|
225
|
+
"@oxlint/plugins": "1.89.0",
|
|
226
226
|
"@smithy/util-stream": "4.8.2",
|
|
227
227
|
"@types/aws4": "1.11.6",
|
|
228
228
|
"@types/breejs__later": "4.1.5",
|
|
@@ -269,9 +269,9 @@
|
|
|
269
269
|
"markdownlint-cli2-formatter-template": "0.0.4",
|
|
270
270
|
"memfs": "4.80.0",
|
|
271
271
|
"nock": "14.0.17",
|
|
272
|
-
"npm-run-all2": "9.0.
|
|
272
|
+
"npm-run-all2": "9.0.4",
|
|
273
273
|
"nyc": "18.0.0",
|
|
274
|
-
"oxlint": "1.
|
|
274
|
+
"oxlint": "1.89.0",
|
|
275
275
|
"oxlint-tsgolint": "7.0.2004",
|
|
276
276
|
"rimraf": "6.1.3",
|
|
277
277
|
"semantic-release": "25.0.9",
|
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.
|
|
3
|
+
"title": "JSON schema for Renovate 44.197.1 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "44.
|
|
5
|
+
"x-renovate-version": "44.197.1",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|