renovate 44.33.2 → 44.34.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/config/types.d.ts +2 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation-helpers/match-base-branches.js +2 -1
- package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
- package/dist/config/validation-helpers/regex-glob-matchers.js +4 -3
- package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
- package/dist/config/validation-helpers/types.d.ts +17 -0
- package/dist/config/validation-helpers/types.js +16 -0
- package/dist/config/validation-helpers/types.js.map +1 -0
- package/dist/config/validation-helpers/utils.js +12 -11
- package/dist/config/validation-helpers/utils.js.map +1 -1
- package/dist/config/validation.js +80 -79
- package/dist/config/validation.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +1 -1
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/poetry/artifacts.js +15 -8
- package/dist/modules/manager/poetry/artifacts.js.map +1 -1
- package/dist/modules/manager/types.d.ts +1 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket/source.js +4 -0
- package/dist/workers/repository/update/pr/changelog/bitbucket/source.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js +5 -1
- package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/release-notes.js +7 -13
- package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
- package/dist/workers/repository/update/pr/changelog/source.js +17 -3
- package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
- package/package.json +4 -4
- package/renovate-schema.json +2 -2
package/dist/config/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { SkipReason, StageName } from "../types/skip-reason.js";
|
|
|
12
12
|
import { RangeStrategy } from "../types/versioning.js";
|
|
13
13
|
import { AutoMergeType, Nullish } from "../types/index.js";
|
|
14
14
|
import { CustomManager } from "../modules/manager/custom/types.js";
|
|
15
|
+
import { ConfigValidationTopic } from "./validation-helpers/types.js";
|
|
15
16
|
//#region lib/config/types.d.ts
|
|
16
17
|
type RenovateConfigStage = 'global' | 'inherit' | 'repository' | 'package' | 'branch' | 'pr';
|
|
17
18
|
type RenovateSplit = 'init' | 'onboarding' | 'extract' | 'lookup' | 'update';
|
|
@@ -479,7 +480,7 @@ interface PackageRule extends RenovateSharedConfig, RenovateInternalConfig, Upda
|
|
|
479
480
|
vulnerabilityFixVersion?: string;
|
|
480
481
|
}
|
|
481
482
|
interface ValidationMessage {
|
|
482
|
-
topic: string;
|
|
483
|
+
topic: ConfigValidationTopic | (string & {});
|
|
483
484
|
message: string;
|
|
484
485
|
}
|
|
485
486
|
type AllowedParents = '.' | 'bumpVersions' | 'customDatasources' | 'customManagers' | 'hostRules' | 'logLevelRemap' | 'packageRules' | 'postUpgradeTasks' | 'vulnerabilityAlerts' | 'toolSettings' | ManagerName | UpdateTypeOptions;
|
package/dist/config/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../lib/config/types.ts"],"sourcesContent":["import type { Category, PlatformId } from '../constants/index.ts';\nimport type { LogLevelRemap } from '../logger/types.ts';\nimport type { ManagerName } from '../manager-list.generated.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type {\n GitUrlOption,\n RepoSortMethod,\n SortMethod,\n} from '../modules/platform/types.ts';\nimport type {\n AutoMergeType,\n HostRule,\n Nullish,\n RangeStrategy,\n SkipReason,\n} from '../types/index.ts';\nimport type { StageName } from '../types/skip-reason.ts';\nimport type {\n AdditionalConstraintName,\n ConstraintName,\n ToolName,\n} from '../util/exec/types.ts';\nimport type { GitNoVerifyOption } from '../util/git/types.ts';\nimport type { MergeConfidence } from '../util/merge-confidence/types.ts';\nimport type { Timestamp } from '../util/timestamp.ts';\n\nexport type RenovateConfigStage =\n | 'global'\n | 'inherit'\n | 'repository'\n | 'package'\n | 'branch'\n | 'pr';\n\nexport type RenovateSplit =\n | 'init'\n | 'onboarding'\n | 'extract'\n | 'lookup'\n | 'update';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\nexport type RepositoryCacheType = 'local' | (string & {});\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type RequiredConfig = 'required' | 'optional' | 'ignored';\n\nexport interface GroupConfig extends Record<string, unknown> {\n branchName?: string;\n branchTopic?: string;\n}\n\nexport type RecreateWhen = 'auto' | 'never' | 'always';\nexport type StatusCheckWhen = 'always' | 'never' | 'failed';\nexport type PlatformCommitOptions = 'auto' | 'disabled' | 'enabled';\n\nexport type BinarySource = 'docker' | 'global' | 'install' | 'hermit';\n\n// TODO: Proper typings\n/**\n * Any configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration), or:\n *\n * - in a datasource-specific configuration\n * - in a manager-specific configuration\n * - in a Package Rule\n *\n * @see RenovateConfig for the superset of all configuration allowed in a given repository\n *\n */\nexport interface RenovateSharedConfig {\n $schema?: string;\n abandonmentThreshold?: Nullish<string>;\n addLabels?: string[];\n assignAutomerge?: boolean;\n autoApprove?: boolean;\n autoReplaceGlobalMatch?: boolean;\n automerge?: boolean;\n automergeSchedule?: string[];\n automergeStrategy?: MergeStrategy;\n automergeType?: AutoMergeType;\n azureWorkItemId?: number;\n azureWorkItemType?: string;\n branchName?: string;\n branchNameStrict?: boolean;\n branchPrefix?: string;\n branchPrefixOld?: string;\n bumpVersions?: BumpVersionConfig[];\n commitBody?: string;\n commitBodyTable?: boolean;\n commitMessage?: string;\n commitMessageAction?: string;\n commitMessageExtra?: string;\n commitMessageLowerCase?: 'auto' | 'never';\n commitMessagePrefix?: string;\n commitMessageTopic?: string;\n commitTrailers?: string[];\n confidential?: boolean;\n configValidationError?: boolean;\n changelogUrl?: string;\n dependencyDashboardApproval?: boolean;\n draftPR?: boolean;\n enabled?: boolean;\n enabledManagers?: string[];\n encrypted?: Record<string, string>;\n extends?: string[];\n extractVersion?: string;\n managerFilePatterns?: string[];\n followTag?: string;\n force?: RenovateConfig;\n gitIgnoredAuthors?: string[];\n group?: GroupConfig;\n groupName?: string;\n groupSingleUpdates?: boolean;\n groupSlug?: string;\n hashedBranchLength?: number;\n ignoreDeps?: string[];\n ignorePaths?: string[];\n ignoreTests?: boolean;\n ignoreUnstable?: boolean;\n includePaths?: string[];\n internalChecksAsSuccess?: boolean;\n internalChecksFilter?: 'strict' | 'flexible' | 'none';\n keepUpdatedLabel?: string;\n labels?: string[];\n manager?: string;\n milestone?: number;\n minimumReleaseAge?: Nullish<string>;\n npmrc?: string;\n npmrcMerge?: boolean;\n npmToken?: string;\n\n pinDigests?: boolean;\n platformAutomerge?: boolean;\n platformCommit?: PlatformCommitOptions;\n postUpgradeTasks?: PostUpgradeTasks;\n prBodyColumns?: string[];\n prBodyDefinitions?: Record<string, string>;\n prBodyHeadingDefinitions?: Record<string, string>;\n prBodyNotes?: string[];\n prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';\n prFooter?: string;\n prHeader?: string;\n prPriority?: number;\n prTitle?: string;\n prTitleStrict?: boolean;\n pruneBranchAfterAutomerge?: boolean;\n rangeStrategy?: RangeStrategy;\n rebaseLabel?: string;\n rebaseWhen?: string;\n recreateClosed?: boolean;\n recreateWhen?: RecreateWhen;\n repository?: string;\n repositoryCache?: RepositoryCacheConfig;\n repositoryCacheType?: RepositoryCacheType;\n respectLatest?: boolean;\n rollbackPrs?: boolean;\n schedule?: string[];\n semanticCommitScope?: string | null;\n semanticCommitType?: string;\n semanticCommits?: 'auto' | 'enabled' | 'disabled';\n separateMajorMinor?: boolean;\n separateMinorPatch?: boolean;\n separateMultipleMajor?: boolean;\n separateMultipleMinor?: boolean;\n skipArtifactsUpdate?: boolean;\n stopUpdatingLabel?: string;\n suppressNotifications?: string[];\n timezone?: string;\n unicodeEmoji?: boolean;\n updateNotScheduled?: boolean;\n versioning?: string;\n versionCompatibility?: string;\n}\n\n/**\n * Contains all options with globalOnly=true && inheritConfigSupport=true\n */\nexport interface GlobalInheritableConfig {\n bbUseDevelopmentBranch?: boolean;\n configFileNames?: string[];\n onboarding?: boolean;\n onboardingAutoCloseAge?: number;\n onboardingBranch?: string;\n onboardingCommitMessage?: string;\n onboardingConfig?: RenovateConfig;\n onboardingConfigFileName?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingPrTitle?: string;\n requireConfig?: RequiredConfig;\n}\n\n// Config options used only within the global worker\n// The below should contain config options where stage=global\n/** @deprecated use `RepoGlobalConfig` instead **/\nexport interface GlobalOnlyConfigLegacy {\n autodiscover?: boolean;\n autodiscoverFilter?: string[] | string;\n autodiscoverNamespaces?: string[];\n autodiscoverProjects?: string[];\n autodiscoverTopics?: string[];\n baseDir?: string;\n cacheDir?: string;\n containerbaseDir?: string;\n detectHostRulesFromEnv?: boolean;\n dockerCliOptions?: string;\n endpoint?: string;\n forceCli?: boolean;\n gitNoVerify?: GitNoVerifyOption[];\n gitPrivateKey?: string;\n gitPrivateKeyPassphrase?: string;\n globalExtends?: string[];\n mergeConfidenceDatasources?: string[];\n mergeConfidenceEndpoint?: string;\n platform?: PlatformId;\n processEnv?: Record<string, string>;\n prCommitsPerRunLimit?: number;\n privateKey?: string;\n privateKeyOld?: string;\n privateKeyPath?: string;\n privateKeyPathOld?: string;\n redisPrefix?: string;\n redisUrl?: string;\n repositories?: RenovateRepository[];\n useCloudMetadataServices?: boolean;\n deleteConfigFile?: boolean;\n deleteAdditionalConfigFile?: boolean;\n}\n\n/**\n * Any global-only configuration set by self-hosted administrators.\n *\n * Used within the repository worker.\n *\n * Should only contain config options where globalOnly=true.\n */\nexport interface RepoGlobalConfig extends GlobalInheritableConfig {\n allowedCommands?: string[];\n allowCustomCrateRegistries?: boolean;\n allowPlugins?: boolean;\n allowScripts?: boolean;\n allowShellExecutorForPostUpgradeCommands?: boolean;\n allowedEnv?: string[];\n allowedHeaders?: string[];\n binarySource?: BinarySource;\n cacheDir?: string;\n cacheHardTtlMinutes?: number;\n cacheTtlOverride?: Record<string, number>;\n checkedBranches?: string[];\n containerbaseDir?: string;\n customEnvVariables?: Record<string, string>;\n dockerChildPrefix?: string;\n dockerCliOptions?: string;\n dockerSidecarImage?: string;\n dockerUser?: string;\n dryRun?: DryRunConfig;\n encryptedWarning?: string;\n endpoint?: string;\n executionTimeout?: number;\n exposeAllEnv?: boolean;\n gitTimeout?: number;\n githubTokenWarn?: boolean;\n includeMirrors?: boolean;\n migratePresets?: Record<string, string>;\n platform?: PlatformId;\n prCacheSyncMaxPages?: number;\n presetCachePersistence?: boolean;\n httpCacheTtlDays?: number;\n autodiscoverRepoSort?: RepoSortMethod;\n autodiscoverRepoOrder?: SortMethod;\n userAgent?: string;\n dockerMaxPages?: number;\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n cachePrivatePackages?: boolean;\n repositoryCacheForceLocal?: boolean;\n configFileNames?: string[];\n ignorePrAuthor?: boolean;\n allowedUnsafeExecutions?: AllowedUnsafeExecution[];\n onboardingAutoCloseAge?: number;\n productLinks?: Record<string, string>;\n rebaseAllOpenBranches?: boolean;\n toolSettings?: GlobalToolSettingsOptions;\n}\n\n/**\n * Internal variables which are referenced from `GlobalConfig`, but are *not* user-configurable options.\n */\nexport interface InternalGlobalConfigOptions {\n localDir?: string;\n}\n\n/**\n * Those options are global only but still passed into the repository worker config.\n *\n * @deprecated https://github.com/renovatebot/renovate/issues/39693\n */\nexport interface LegacyAdminConfig {\n baseDir?: string;\n localDir?: string;\n\n logContext?: string;\n\n onboarding?: boolean;\n onboardingBranch?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingRebaseCheckbox?: boolean;\n onboardingConfig?: RenovateConfig;\n onboardingConfigFileName?: string;\n\n optimizeForDisabled?: boolean;\n\n persistRepoData?: boolean;\n\n prCommitsPerRunLimit?: number;\n\n requireConfig?: RequiredConfig;\n\n useCloudMetadataServices?: boolean;\n\n writeDiscoveredRepos?: string;\n}\n\nexport type ExecutionMode = 'branch' | 'update';\n\nexport interface PostUpgradeTasks {\n commands?: string[];\n workingDirTemplate?: string;\n dataFileTemplate?: string;\n fileFilters?: string[];\n executionMode: ExecutionMode;\n installTools?: Partial<Record<ToolName, Record<never, never>>>;\n}\n\nexport type UpdateConfig<\n T extends RenovateSharedConfig = RenovateSharedConfig,\n> = Partial<Record<UpdateType, T | null>>;\n\nexport type RenovateRepositoryEntry = AllConfig & {\n repository: string;\n};\n\nexport type RenovateRepository = string | RenovateRepositoryEntry;\n\nexport type UseBaseBranchConfigType = 'merge' | 'none';\nexport type ConstraintsFilter = 'strict' | 'none';\nexport type MinimumReleaseAgeBehaviour =\n | 'timestamp-required'\n | 'timestamp-optional';\n\nexport const allowedStatusCheckStrings = [\n 'minimumReleaseAge',\n 'mergeConfidence',\n 'configValidation',\n 'artifactError',\n] as const;\nexport type StatusCheckKey = (typeof allowedStatusCheckStrings)[number];\ntype UserEnv = Record<string, string>;\n\n/**\n * Computed properties, for internal use only\n */\nexport interface RenovateInternalConfig {\n /** computed base branch from patterns - for internal use only */\n baseBranches?: string[];\n currentCompatibility?: string;\n datasource?: string;\n hasBaseBranches?: boolean;\n isFork?: boolean;\n isVulnerabilityAlert?: boolean;\n\n /** What is this used for? */\n remediations?: unknown;\n /** What is this used for? */\n vulnerabilityAlertsOnly?: boolean;\n}\n\n// TODO: Proper typings\n/**\n * Configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration).\n *\n * This is a superset of any configuration that a Renovate user (not self-hosted administrator) can set.\n */\nexport interface RenovateConfig\n extends\n LegacyAdminConfig,\n RenovateSharedConfig,\n UpdateConfig<PackageRule>,\n AssigneesAndReviewersConfig,\n ConfigMigration,\n RenovateInternalConfig {\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n reportFormatting?: boolean;\n reportPath?: string;\n reportType?: 'logging' | 'file' | 's3' | null;\n depName?: string;\n /** user configurable base branch patterns*/\n baseBranchPatterns?: string[];\n useBaseBranchConfig?: UseBaseBranchConfigType;\n baseBranch?: string;\n defaultBranch?: string;\n branchList?: string[];\n cloneSubmodules?: boolean;\n cloneSubmodulesFilter?: string[];\n description?: string | string[];\n detectGlobalManagerConfig?: boolean;\n errors?: ValidationMessage[];\n forkModeDisallowMaintainerEdits?: boolean;\n forkProcessing?: 'auto' | 'enabled' | 'disabled';\n forkToken?: string;\n\n gitAuthor?: string;\n\n hostRules?: HostRule[];\n\n inheritConfig?: boolean;\n inheritConfigFileName?: string;\n inheritConfigRepoName?: string;\n inheritConfigStrict?: boolean;\n\n ignorePresets?: string[];\n\n fileList?: string[];\n configWarningReuseIssue?: boolean;\n dependencyDashboard?: boolean;\n dependencyDashboardAutoclose?: boolean;\n dependencyDashboardChecks?: Record<string, string>;\n dependencyDashboardIssue?: number;\n dependencyDashboardTitle?: string;\n dependencyDashboardHeader?: string;\n dependencyDashboardFooter?: string;\n dependencyDashboardLabels?: string[];\n dependencyDashboardOSVVulnerabilitySummary?: 'none' | 'all' | 'unresolved';\n dependencyDashboardReportAbandonment?: boolean;\n mode?: 'silent' | 'full';\n packageFile?: string;\n packageRules?: PackageRule[];\n postUpdateOptions?: string[];\n branchConcurrentLimit?: number | null;\n parentOrg?: string;\n prConcurrentLimit?: number;\n commitHourlyLimit?: number;\n prHourlyLimit?: number;\n\n printConfig?: boolean;\n\n pruneStaleBranches?: boolean;\n\n defaultRegistryUrls?: string[];\n registryUrls?: string[] | null;\n registryAliases?: Record<string, string>;\n\n /**\n * What is this used for?\n * @deprecated\n */\n renovateJsonPresent?: boolean;\n\n repoIsOnboarded?: boolean;\n repoIsActivated?: boolean;\n\n topLevelOrg?: string;\n updateInternalDeps?: boolean;\n updateType?: UpdateType;\n\n warnings?: ValidationMessage[];\n vulnerabilityAlerts?: RenovateSharedConfig;\n osvVulnerabilityAlerts?: boolean;\n vulnerabilitySeverity?: string;\n customManagers?: CustomManager[];\n customDatasources?: Record<string, CustomDatasourceConfig>;\n\n fetchChangeLogs?: FetchChangeLogsOptions;\n secrets?: Record<string, string>;\n variables?: Record<string, string>;\n\n constraints?: Partial<Record<ConstraintName, string>>;\n /**\n * Any specific overrides for the versioning for the `AdditionalConstraintName`s.\n */\n constraintsVersioning?: Partial<Record<AdditionalConstraintName, string>>;\n skipInstalls?: boolean | null;\n\n constraintsFiltering?: ConstraintsFilter;\n\n customizeDashboard?: Record<string, string>;\n\n statusCheckNames?: Record<StatusCheckKey, string | null>;\n statusCheckWhen?: Partial<Record<StatusCheckKey, StatusCheckWhen>>;\n /**\n * User configured environment variables that Renovate uses when executing package manager commands\n */\n env?: UserEnv;\n logLevelRemap?: LogLevelRemap[];\n\n branchTopic?: string;\n additionalBranchPrefix?: string;\n sharedVariableName?: string;\n minimumGroupSize?: number;\n configFileNames?: string[];\n minimumReleaseAgeBehaviour?: MinimumReleaseAgeBehaviour;\n toolSettings?: RepoToolSettingsOptions;\n}\n\nconst CustomDatasourceFormats = [\n 'html',\n 'json',\n 'plain',\n 'toml',\n 'yaml',\n] as const;\nexport type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];\n\nexport interface CustomDatasourceConfig {\n defaultRegistryUrlTemplate?: string;\n format?: CustomDatasourceFormats;\n transformTemplates?: string[];\n}\n\n/**\n * The superset of all configuration that a self-hosted administrator can set, alongside all repository-level configuration.\n *\n */\nexport interface AllConfig\n extends RenovateConfig, GlobalOnlyConfigLegacy, RepoGlobalConfig {\n gitUrl?: GitUrlOption;\n password?: string;\n token?: string;\n username?: string;\n}\n\nexport interface AssigneesAndReviewersConfig {\n assigneesFromCodeOwners?: boolean;\n expandCodeOwnersGroups?: boolean;\n assignees?: string[];\n assigneesSampleSize?: number;\n ignoreReviewers?: string[];\n reviewersFromCodeOwners?: boolean;\n reviewers?: string[];\n reviewersSampleSize?: number;\n additionalReviewers?: string[];\n filterUnavailableUsers?: boolean;\n}\n\nexport type UpdateType =\n | 'major'\n | 'minor'\n | 'patch'\n | 'pin'\n | 'digest'\n | 'pinDigest'\n | 'lockFileMaintenance'\n | 'lockfileUpdate'\n | 'rollback'\n | 'bump'\n | 'replacement';\n\n// These are the update types which can have configuration\nexport const UpdateTypesOptions = [\n 'major',\n 'minor',\n 'patch',\n 'pin',\n 'digest',\n 'pinDigest',\n 'lockFileMaintenance',\n 'rollback',\n 'replacement',\n] as const;\n\nexport type UpdateTypeOptions = (typeof UpdateTypesOptions)[number];\n\nexport type FetchChangeLogsOptions = 'off' | 'branch' | 'pr';\n\nexport type MatchStringsStrategy = 'any' | 'recursive' | 'combination';\n\nexport type MergeStrategy =\n | 'auto'\n | 'fast-forward'\n | 'merge-commit'\n | 'rebase'\n | 'rebase-merge'\n | 'squash';\n\n// This list should be added to as any new unsafe execution commands should be permitted\nexport type AllowedUnsafeExecution =\n | 'bazelModDeps'\n | 'goGenerate'\n | 'gradleWrapper'\n | 'mise'\n | 'pixi';\n\n// TODO: Proper typings\nexport interface PackageRule\n extends RenovateSharedConfig, RenovateInternalConfig, UpdateConfig {\n allowedVersions?: string;\n description?: string | string[];\n matchBaseBranches?: string[];\n matchCategories?: string[];\n matchConfidence?: MergeConfidence[];\n matchCurrentAge?: string;\n matchCurrentValue?: string;\n matchCurrentVersion?: string;\n matchDatasources?: string[];\n matchDepNames?: string[];\n matchDepTypes?: string[];\n matchFileNames?: string[];\n matchManagers?: string[];\n matchNewValue?: string;\n matchPackageNames?: string[];\n matchRepositories?: string[];\n matchSourceUrls?: string[];\n matchRegistryUrls?: string[];\n matchUpdateTypes?: UpdateType[];\n matchJsonata?: string[];\n overrideDatasource?: string;\n overrideDepName?: string;\n overridePackageName?: string;\n registryUrls?: string[] | null;\n replacementName?: string;\n replacementVersion?: string;\n sourceUrl?: string;\n sourceDirectory?: string;\n vulnerabilitySeverity?: string;\n vulnerabilityFixVersion?: string;\n}\n\nexport interface ValidationMessage {\n topic: string;\n message: string;\n}\n\nexport type AllowedParents =\n | '.'\n | 'bumpVersions'\n | 'customDatasources'\n | 'customManagers'\n | 'hostRules'\n | 'logLevelRemap'\n | 'packageRules'\n | 'postUpgradeTasks'\n | 'vulnerabilityAlerts'\n | 'toolSettings'\n | ManagerName\n | UpdateTypeOptions;\nexport interface RenovateOptionBase {\n /**\n * If true, the option can only be configured by people with access to the Renovate instance.\n * Furthermore, the option should be documented in docs/usage/self-hosted-configuration.md.\n */\n globalOnly?: boolean;\n\n inheritConfigSupport?: boolean;\n\n allowedValues?: string[];\n\n allowString?: boolean;\n\n cli?: boolean;\n\n description: string;\n\n env?: false | string;\n\n /**\n * Do not validate object children\n */\n freeChoice?: boolean;\n\n mergeable?: boolean;\n\n autogenerated?: boolean;\n\n name: string;\n\n parents?: AllowedParents[];\n\n stage?: RenovateConfigStage;\n\n experimental?: boolean;\n\n experimentalDescription?: string;\n\n experimentalIssues?: number[];\n\n advancedUse?: boolean;\n\n /**\n * This is used to add a deprecation message in the docs\n */\n deprecationMsg?: string;\n\n /**\n * For internal use only: add it to any config option that supports regex or glob matching\n */\n patternMatch?: boolean;\n\n /**\n * For internal use only: add it to any config option of type integer that supports negative integers\n */\n allowNegative?: boolean;\n\n /**\n * Managers which support this option, leave undefined if all managers support it.\n */\n supportedManagers?: string[];\n\n /**\n * Platforms which support this option, leave undefined if all platforms support it.\n */\n supportedPlatforms?: PlatformId[];\n\n /**\n * Conditions that must be met for this option to be required.\n */\n requiredIf?: RenovateRequiredOption[];\n\n /**\n * If true, the option's value supports Renovate templating.\n * @see https://docs.renovatebot.com/templates/\n */\n supportsTemplating?: boolean;\n}\n\nexport interface RenovateRequiredOption {\n siblingProperties: { property: string; value: string }[];\n}\n\nexport interface RenovateArrayOption<\n T extends string | number | Record<string, unknown> = Record<string, unknown>,\n> extends RenovateOptionBase {\n default?: T[] | null;\n mergeable?: boolean;\n type: 'array';\n subType?: 'string' | 'object' | 'number';\n}\n\nexport interface RenovateStringArrayOption extends RenovateArrayOption<string> {\n format?: 'regex';\n subType: 'string';\n}\n\nexport interface RenovateNumberArrayOption extends RenovateArrayOption<number> {\n subType: 'number';\n}\n\nexport interface RenovateBooleanOption extends RenovateOptionBase {\n default?: boolean | null;\n type: 'boolean';\n}\n\nexport interface RenovateIntegerOption extends RenovateOptionBase {\n default?: number | null;\n type: 'integer';\n}\n\nexport interface RenovateStringOption extends RenovateOptionBase {\n default?: string | null;\n format?: 'regex';\n\n // Not used\n replaceLineReturns?: boolean;\n type: 'string';\n}\n\nexport interface RenovateObjectOption extends RenovateOptionBase {\n default?: any;\n additionalProperties?: Record<string, unknown> | boolean;\n mergeable?: boolean;\n type: 'object';\n}\n\nexport type RenovateOptions =\n | RenovateStringOption\n | RenovateNumberArrayOption\n | RenovateStringArrayOption\n | RenovateIntegerOption\n | RenovateBooleanOption\n | RenovateArrayOption\n | RenovateObjectOption;\n\nexport interface PackageRuleInputConfig extends RenovateConfig {\n versioning?: string;\n packageFile?: string;\n lockFiles?: string[];\n depType?: string;\n depTypes?: string[];\n depName?: string;\n packageName?: string | null;\n newValue?: string | null;\n currentValue?: string | null;\n currentVersion?: string;\n lockedVersion?: string;\n updateType?: UpdateType;\n mergeConfidenceLevel?: MergeConfidence | undefined;\n isBump?: boolean;\n sourceUrl?: string | null;\n categories?: string[];\n baseBranch?: string;\n manager?: string;\n datasource?: string;\n packageRules?: (PackageRule & PackageRuleInputConfig)[];\n releaseTimestamp?: Timestamp | null;\n repository?: string;\n currentVersionAgeInDays?: number;\n currentVersionTimestamp?: string;\n enabled?: boolean;\n skipReason?: SkipReason;\n skipStage?: StageName;\n}\n\nexport interface ConfigMigration {\n configMigration?: boolean;\n}\n\nexport interface MigratedConfig {\n /**\n * Indicates whether there was a migration applied to the configuration.\n *\n * @returns\n * `false` if the configuration does not need migrating, and `migratedConfig` can be ignored\n * `true` if the configuration was migrated, and if so, `migratedConfig` should be used instead of the provided config\n */\n isMigrated: boolean;\n migratedConfig: RenovateConfig;\n}\n\nexport interface MigratedRenovateConfig extends RenovateConfig {\n endpoints?: HostRule[];\n pathRules: PackageRule[];\n packages: PackageRule[];\n\n node?: RenovateConfig;\n travis?: RenovateConfig;\n gradle?: RenovateConfig;\n}\n\nexport interface ManagerConfig extends RenovateConfig {\n manager: string;\n categories?: Category[];\n}\n\nexport interface ValidationResult {\n errors: ValidationMessage[];\n warnings: ValidationMessage[];\n}\n\nexport interface BumpVersionConfig {\n bumpType?: string;\n filePatterns: string[];\n matchStrings: string[];\n name?: string;\n}\n\n/**\n * Global Config for specified `toolSettings` options.\n *\n */\nexport interface GlobalToolSettingsOptions {\n /** An upper limit on what the Java Virtual Machine's maximum memory can be set to. Repositories can specify <= this value */\n jvmMaxMemory?: number;\n /** An upper limit on what the Java Virtual Machine's starting memory can be set to. Repositories can specify <= this value */\n jvmMemory?: number;\n /** An upper limit on what the Node.JS process' maximum memory can be set to. Repositories can specify <= this value */\n nodeMaxMemory?: number;\n}\n\n/**\n * Repository config options for `toolSettings` options.\n */\nexport interface RepoToolSettingsOptions {\n /** The maximum memory the Java Virtual Machine can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n jvmMaxMemory?: number;\n /** The starting memory the Java Virtual Machine can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n jvmMemory?: number;\n /** The maximum memory child Node.JS processes can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n nodeMaxMemory?: number;\n}\n"],"mappings":";AA4VA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;AACF;AA4MA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../lib/config/types.ts"],"sourcesContent":["import type { Category, PlatformId } from '../constants/index.ts';\nimport type { LogLevelRemap } from '../logger/types.ts';\nimport type { ManagerName } from '../manager-list.generated.ts';\nimport type { CustomManager } from '../modules/manager/custom/types.ts';\nimport type {\n GitUrlOption,\n RepoSortMethod,\n SortMethod,\n} from '../modules/platform/types.ts';\nimport type {\n AutoMergeType,\n HostRule,\n Nullish,\n RangeStrategy,\n SkipReason,\n} from '../types/index.ts';\nimport type { StageName } from '../types/skip-reason.ts';\nimport type {\n AdditionalConstraintName,\n ConstraintName,\n ToolName,\n} from '../util/exec/types.ts';\nimport type { GitNoVerifyOption } from '../util/git/types.ts';\nimport type { MergeConfidence } from '../util/merge-confidence/types.ts';\nimport type { Timestamp } from '../util/timestamp.ts';\nimport type { ConfigValidationTopic } from './validation-helpers/types.ts';\n\nexport type RenovateConfigStage =\n | 'global'\n | 'inherit'\n | 'repository'\n | 'package'\n | 'branch'\n | 'pr';\n\nexport type RenovateSplit =\n | 'init'\n | 'onboarding'\n | 'extract'\n | 'lookup'\n | 'update';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\nexport type RepositoryCacheType = 'local' | (string & {});\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type RequiredConfig = 'required' | 'optional' | 'ignored';\n\nexport interface GroupConfig extends Record<string, unknown> {\n branchName?: string;\n branchTopic?: string;\n}\n\nexport type RecreateWhen = 'auto' | 'never' | 'always';\nexport type StatusCheckWhen = 'always' | 'never' | 'failed';\nexport type PlatformCommitOptions = 'auto' | 'disabled' | 'enabled';\n\nexport type BinarySource = 'docker' | 'global' | 'install' | 'hermit';\n\n// TODO: Proper typings\n/**\n * Any configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration), or:\n *\n * - in a datasource-specific configuration\n * - in a manager-specific configuration\n * - in a Package Rule\n *\n * @see RenovateConfig for the superset of all configuration allowed in a given repository\n *\n */\nexport interface RenovateSharedConfig {\n $schema?: string;\n abandonmentThreshold?: Nullish<string>;\n addLabels?: string[];\n assignAutomerge?: boolean;\n autoApprove?: boolean;\n autoReplaceGlobalMatch?: boolean;\n automerge?: boolean;\n automergeSchedule?: string[];\n automergeStrategy?: MergeStrategy;\n automergeType?: AutoMergeType;\n azureWorkItemId?: number;\n azureWorkItemType?: string;\n branchName?: string;\n branchNameStrict?: boolean;\n branchPrefix?: string;\n branchPrefixOld?: string;\n bumpVersions?: BumpVersionConfig[];\n commitBody?: string;\n commitBodyTable?: boolean;\n commitMessage?: string;\n commitMessageAction?: string;\n commitMessageExtra?: string;\n commitMessageLowerCase?: 'auto' | 'never';\n commitMessagePrefix?: string;\n commitMessageTopic?: string;\n commitTrailers?: string[];\n confidential?: boolean;\n configValidationError?: boolean;\n changelogUrl?: string;\n dependencyDashboardApproval?: boolean;\n draftPR?: boolean;\n enabled?: boolean;\n enabledManagers?: string[];\n encrypted?: Record<string, string>;\n extends?: string[];\n extractVersion?: string;\n managerFilePatterns?: string[];\n followTag?: string;\n force?: RenovateConfig;\n gitIgnoredAuthors?: string[];\n group?: GroupConfig;\n groupName?: string;\n groupSingleUpdates?: boolean;\n groupSlug?: string;\n hashedBranchLength?: number;\n ignoreDeps?: string[];\n ignorePaths?: string[];\n ignoreTests?: boolean;\n ignoreUnstable?: boolean;\n includePaths?: string[];\n internalChecksAsSuccess?: boolean;\n internalChecksFilter?: 'strict' | 'flexible' | 'none';\n keepUpdatedLabel?: string;\n labels?: string[];\n manager?: string;\n milestone?: number;\n minimumReleaseAge?: Nullish<string>;\n npmrc?: string;\n npmrcMerge?: boolean;\n npmToken?: string;\n\n pinDigests?: boolean;\n platformAutomerge?: boolean;\n platformCommit?: PlatformCommitOptions;\n postUpgradeTasks?: PostUpgradeTasks;\n prBodyColumns?: string[];\n prBodyDefinitions?: Record<string, string>;\n prBodyHeadingDefinitions?: Record<string, string>;\n prBodyNotes?: string[];\n prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';\n prFooter?: string;\n prHeader?: string;\n prPriority?: number;\n prTitle?: string;\n prTitleStrict?: boolean;\n pruneBranchAfterAutomerge?: boolean;\n rangeStrategy?: RangeStrategy;\n rebaseLabel?: string;\n rebaseWhen?: string;\n recreateClosed?: boolean;\n recreateWhen?: RecreateWhen;\n repository?: string;\n repositoryCache?: RepositoryCacheConfig;\n repositoryCacheType?: RepositoryCacheType;\n respectLatest?: boolean;\n rollbackPrs?: boolean;\n schedule?: string[];\n semanticCommitScope?: string | null;\n semanticCommitType?: string;\n semanticCommits?: 'auto' | 'enabled' | 'disabled';\n separateMajorMinor?: boolean;\n separateMinorPatch?: boolean;\n separateMultipleMajor?: boolean;\n separateMultipleMinor?: boolean;\n skipArtifactsUpdate?: boolean;\n stopUpdatingLabel?: string;\n suppressNotifications?: string[];\n timezone?: string;\n unicodeEmoji?: boolean;\n updateNotScheduled?: boolean;\n versioning?: string;\n versionCompatibility?: string;\n}\n\n/**\n * Contains all options with globalOnly=true && inheritConfigSupport=true\n */\nexport interface GlobalInheritableConfig {\n bbUseDevelopmentBranch?: boolean;\n configFileNames?: string[];\n onboarding?: boolean;\n onboardingAutoCloseAge?: number;\n onboardingBranch?: string;\n onboardingCommitMessage?: string;\n onboardingConfig?: RenovateConfig;\n onboardingConfigFileName?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingPrTitle?: string;\n requireConfig?: RequiredConfig;\n}\n\n// Config options used only within the global worker\n// The below should contain config options where stage=global\n/** @deprecated use `RepoGlobalConfig` instead **/\nexport interface GlobalOnlyConfigLegacy {\n autodiscover?: boolean;\n autodiscoverFilter?: string[] | string;\n autodiscoverNamespaces?: string[];\n autodiscoverProjects?: string[];\n autodiscoverTopics?: string[];\n baseDir?: string;\n cacheDir?: string;\n containerbaseDir?: string;\n detectHostRulesFromEnv?: boolean;\n dockerCliOptions?: string;\n endpoint?: string;\n forceCli?: boolean;\n gitNoVerify?: GitNoVerifyOption[];\n gitPrivateKey?: string;\n gitPrivateKeyPassphrase?: string;\n globalExtends?: string[];\n mergeConfidenceDatasources?: string[];\n mergeConfidenceEndpoint?: string;\n platform?: PlatformId;\n processEnv?: Record<string, string>;\n prCommitsPerRunLimit?: number;\n privateKey?: string;\n privateKeyOld?: string;\n privateKeyPath?: string;\n privateKeyPathOld?: string;\n redisPrefix?: string;\n redisUrl?: string;\n repositories?: RenovateRepository[];\n useCloudMetadataServices?: boolean;\n deleteConfigFile?: boolean;\n deleteAdditionalConfigFile?: boolean;\n}\n\n/**\n * Any global-only configuration set by self-hosted administrators.\n *\n * Used within the repository worker.\n *\n * Should only contain config options where globalOnly=true.\n */\nexport interface RepoGlobalConfig extends GlobalInheritableConfig {\n allowedCommands?: string[];\n allowCustomCrateRegistries?: boolean;\n allowPlugins?: boolean;\n allowScripts?: boolean;\n allowShellExecutorForPostUpgradeCommands?: boolean;\n allowedEnv?: string[];\n allowedHeaders?: string[];\n binarySource?: BinarySource;\n cacheDir?: string;\n cacheHardTtlMinutes?: number;\n cacheTtlOverride?: Record<string, number>;\n checkedBranches?: string[];\n containerbaseDir?: string;\n customEnvVariables?: Record<string, string>;\n dockerChildPrefix?: string;\n dockerCliOptions?: string;\n dockerSidecarImage?: string;\n dockerUser?: string;\n dryRun?: DryRunConfig;\n encryptedWarning?: string;\n endpoint?: string;\n executionTimeout?: number;\n exposeAllEnv?: boolean;\n gitTimeout?: number;\n githubTokenWarn?: boolean;\n includeMirrors?: boolean;\n migratePresets?: Record<string, string>;\n platform?: PlatformId;\n prCacheSyncMaxPages?: number;\n presetCachePersistence?: boolean;\n httpCacheTtlDays?: number;\n autodiscoverRepoSort?: RepoSortMethod;\n autodiscoverRepoOrder?: SortMethod;\n userAgent?: string;\n dockerMaxPages?: number;\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n cachePrivatePackages?: boolean;\n repositoryCacheForceLocal?: boolean;\n configFileNames?: string[];\n ignorePrAuthor?: boolean;\n allowedUnsafeExecutions?: AllowedUnsafeExecution[];\n onboardingAutoCloseAge?: number;\n productLinks?: Record<string, string>;\n rebaseAllOpenBranches?: boolean;\n toolSettings?: GlobalToolSettingsOptions;\n}\n\n/**\n * Internal variables which are referenced from `GlobalConfig`, but are *not* user-configurable options.\n */\nexport interface InternalGlobalConfigOptions {\n localDir?: string;\n}\n\n/**\n * Those options are global only but still passed into the repository worker config.\n *\n * @deprecated https://github.com/renovatebot/renovate/issues/39693\n */\nexport interface LegacyAdminConfig {\n baseDir?: string;\n localDir?: string;\n\n logContext?: string;\n\n onboarding?: boolean;\n onboardingBranch?: string;\n onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';\n onboardingRebaseCheckbox?: boolean;\n onboardingConfig?: RenovateConfig;\n onboardingConfigFileName?: string;\n\n optimizeForDisabled?: boolean;\n\n persistRepoData?: boolean;\n\n prCommitsPerRunLimit?: number;\n\n requireConfig?: RequiredConfig;\n\n useCloudMetadataServices?: boolean;\n\n writeDiscoveredRepos?: string;\n}\n\nexport type ExecutionMode = 'branch' | 'update';\n\nexport interface PostUpgradeTasks {\n commands?: string[];\n workingDirTemplate?: string;\n dataFileTemplate?: string;\n fileFilters?: string[];\n executionMode: ExecutionMode;\n installTools?: Partial<Record<ToolName, Record<never, never>>>;\n}\n\nexport type UpdateConfig<\n T extends RenovateSharedConfig = RenovateSharedConfig,\n> = Partial<Record<UpdateType, T | null>>;\n\nexport type RenovateRepositoryEntry = AllConfig & {\n repository: string;\n};\n\nexport type RenovateRepository = string | RenovateRepositoryEntry;\n\nexport type UseBaseBranchConfigType = 'merge' | 'none';\nexport type ConstraintsFilter = 'strict' | 'none';\nexport type MinimumReleaseAgeBehaviour =\n | 'timestamp-required'\n | 'timestamp-optional';\n\nexport const allowedStatusCheckStrings = [\n 'minimumReleaseAge',\n 'mergeConfidence',\n 'configValidation',\n 'artifactError',\n] as const;\nexport type StatusCheckKey = (typeof allowedStatusCheckStrings)[number];\ntype UserEnv = Record<string, string>;\n\n/**\n * Computed properties, for internal use only\n */\nexport interface RenovateInternalConfig {\n /** computed base branch from patterns - for internal use only */\n baseBranches?: string[];\n currentCompatibility?: string;\n datasource?: string;\n hasBaseBranches?: boolean;\n isFork?: boolean;\n isVulnerabilityAlert?: boolean;\n\n /** What is this used for? */\n remediations?: unknown;\n /** What is this used for? */\n vulnerabilityAlertsOnly?: boolean;\n}\n\n// TODO: Proper typings\n/**\n * Configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration).\n *\n * This is a superset of any configuration that a Renovate user (not self-hosted administrator) can set.\n */\nexport interface RenovateConfig\n extends\n LegacyAdminConfig,\n RenovateSharedConfig,\n UpdateConfig<PackageRule>,\n AssigneesAndReviewersConfig,\n ConfigMigration,\n RenovateInternalConfig {\n s3Endpoint?: string;\n s3PathStyle?: boolean;\n reportFormatting?: boolean;\n reportPath?: string;\n reportType?: 'logging' | 'file' | 's3' | null;\n depName?: string;\n /** user configurable base branch patterns*/\n baseBranchPatterns?: string[];\n useBaseBranchConfig?: UseBaseBranchConfigType;\n baseBranch?: string;\n defaultBranch?: string;\n branchList?: string[];\n cloneSubmodules?: boolean;\n cloneSubmodulesFilter?: string[];\n description?: string | string[];\n detectGlobalManagerConfig?: boolean;\n errors?: ValidationMessage[];\n forkModeDisallowMaintainerEdits?: boolean;\n forkProcessing?: 'auto' | 'enabled' | 'disabled';\n forkToken?: string;\n\n gitAuthor?: string;\n\n hostRules?: HostRule[];\n\n inheritConfig?: boolean;\n inheritConfigFileName?: string;\n inheritConfigRepoName?: string;\n inheritConfigStrict?: boolean;\n\n ignorePresets?: string[];\n\n fileList?: string[];\n configWarningReuseIssue?: boolean;\n dependencyDashboard?: boolean;\n dependencyDashboardAutoclose?: boolean;\n dependencyDashboardChecks?: Record<string, string>;\n dependencyDashboardIssue?: number;\n dependencyDashboardTitle?: string;\n dependencyDashboardHeader?: string;\n dependencyDashboardFooter?: string;\n dependencyDashboardLabels?: string[];\n dependencyDashboardOSVVulnerabilitySummary?: 'none' | 'all' | 'unresolved';\n dependencyDashboardReportAbandonment?: boolean;\n mode?: 'silent' | 'full';\n packageFile?: string;\n packageRules?: PackageRule[];\n postUpdateOptions?: string[];\n branchConcurrentLimit?: number | null;\n parentOrg?: string;\n prConcurrentLimit?: number;\n commitHourlyLimit?: number;\n prHourlyLimit?: number;\n\n printConfig?: boolean;\n\n pruneStaleBranches?: boolean;\n\n defaultRegistryUrls?: string[];\n registryUrls?: string[] | null;\n registryAliases?: Record<string, string>;\n\n /**\n * What is this used for?\n * @deprecated\n */\n renovateJsonPresent?: boolean;\n\n repoIsOnboarded?: boolean;\n repoIsActivated?: boolean;\n\n topLevelOrg?: string;\n updateInternalDeps?: boolean;\n updateType?: UpdateType;\n\n warnings?: ValidationMessage[];\n vulnerabilityAlerts?: RenovateSharedConfig;\n osvVulnerabilityAlerts?: boolean;\n vulnerabilitySeverity?: string;\n customManagers?: CustomManager[];\n customDatasources?: Record<string, CustomDatasourceConfig>;\n\n fetchChangeLogs?: FetchChangeLogsOptions;\n secrets?: Record<string, string>;\n variables?: Record<string, string>;\n\n constraints?: Partial<Record<ConstraintName, string>>;\n /**\n * Any specific overrides for the versioning for the `AdditionalConstraintName`s.\n */\n constraintsVersioning?: Partial<Record<AdditionalConstraintName, string>>;\n skipInstalls?: boolean | null;\n\n constraintsFiltering?: ConstraintsFilter;\n\n customizeDashboard?: Record<string, string>;\n\n statusCheckNames?: Record<StatusCheckKey, string | null>;\n statusCheckWhen?: Partial<Record<StatusCheckKey, StatusCheckWhen>>;\n /**\n * User configured environment variables that Renovate uses when executing package manager commands\n */\n env?: UserEnv;\n logLevelRemap?: LogLevelRemap[];\n\n branchTopic?: string;\n additionalBranchPrefix?: string;\n sharedVariableName?: string;\n minimumGroupSize?: number;\n configFileNames?: string[];\n minimumReleaseAgeBehaviour?: MinimumReleaseAgeBehaviour;\n toolSettings?: RepoToolSettingsOptions;\n}\n\nconst CustomDatasourceFormats = [\n 'html',\n 'json',\n 'plain',\n 'toml',\n 'yaml',\n] as const;\nexport type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];\n\nexport interface CustomDatasourceConfig {\n defaultRegistryUrlTemplate?: string;\n format?: CustomDatasourceFormats;\n transformTemplates?: string[];\n}\n\n/**\n * The superset of all configuration that a self-hosted administrator can set, alongside all repository-level configuration.\n *\n */\nexport interface AllConfig\n extends RenovateConfig, GlobalOnlyConfigLegacy, RepoGlobalConfig {\n gitUrl?: GitUrlOption;\n password?: string;\n token?: string;\n username?: string;\n}\n\nexport interface AssigneesAndReviewersConfig {\n assigneesFromCodeOwners?: boolean;\n expandCodeOwnersGroups?: boolean;\n assignees?: string[];\n assigneesSampleSize?: number;\n ignoreReviewers?: string[];\n reviewersFromCodeOwners?: boolean;\n reviewers?: string[];\n reviewersSampleSize?: number;\n additionalReviewers?: string[];\n filterUnavailableUsers?: boolean;\n}\n\nexport type UpdateType =\n | 'major'\n | 'minor'\n | 'patch'\n | 'pin'\n | 'digest'\n | 'pinDigest'\n | 'lockFileMaintenance'\n | 'lockfileUpdate'\n | 'rollback'\n | 'bump'\n | 'replacement';\n\n// These are the update types which can have configuration\nexport const UpdateTypesOptions = [\n 'major',\n 'minor',\n 'patch',\n 'pin',\n 'digest',\n 'pinDigest',\n 'lockFileMaintenance',\n 'rollback',\n 'replacement',\n] as const;\n\nexport type UpdateTypeOptions = (typeof UpdateTypesOptions)[number];\n\nexport type FetchChangeLogsOptions = 'off' | 'branch' | 'pr';\n\nexport type MatchStringsStrategy = 'any' | 'recursive' | 'combination';\n\nexport type MergeStrategy =\n | 'auto'\n | 'fast-forward'\n | 'merge-commit'\n | 'rebase'\n | 'rebase-merge'\n | 'squash';\n\n// This list should be added to as any new unsafe execution commands should be permitted\nexport type AllowedUnsafeExecution =\n | 'bazelModDeps'\n | 'goGenerate'\n | 'gradleWrapper'\n | 'mise'\n | 'pixi';\n\n// TODO: Proper typings\nexport interface PackageRule\n extends RenovateSharedConfig, RenovateInternalConfig, UpdateConfig {\n allowedVersions?: string;\n description?: string | string[];\n matchBaseBranches?: string[];\n matchCategories?: string[];\n matchConfidence?: MergeConfidence[];\n matchCurrentAge?: string;\n matchCurrentValue?: string;\n matchCurrentVersion?: string;\n matchDatasources?: string[];\n matchDepNames?: string[];\n matchDepTypes?: string[];\n matchFileNames?: string[];\n matchManagers?: string[];\n matchNewValue?: string;\n matchPackageNames?: string[];\n matchRepositories?: string[];\n matchSourceUrls?: string[];\n matchRegistryUrls?: string[];\n matchUpdateTypes?: UpdateType[];\n matchJsonata?: string[];\n overrideDatasource?: string;\n overrideDepName?: string;\n overridePackageName?: string;\n registryUrls?: string[] | null;\n replacementName?: string;\n replacementVersion?: string;\n sourceUrl?: string;\n sourceDirectory?: string;\n vulnerabilitySeverity?: string;\n vulnerabilityFixVersion?: string;\n}\n\nexport interface ValidationMessage {\n // Topic is either the known list of topics, or a dynamically generated one\n topic: ConfigValidationTopic | (string & {});\n message: string;\n}\n\nexport type AllowedParents =\n | '.'\n | 'bumpVersions'\n | 'customDatasources'\n | 'customManagers'\n | 'hostRules'\n | 'logLevelRemap'\n | 'packageRules'\n | 'postUpgradeTasks'\n | 'vulnerabilityAlerts'\n | 'toolSettings'\n | ManagerName\n | UpdateTypeOptions;\nexport interface RenovateOptionBase {\n /**\n * If true, the option can only be configured by people with access to the Renovate instance.\n * Furthermore, the option should be documented in docs/usage/self-hosted-configuration.md.\n */\n globalOnly?: boolean;\n\n inheritConfigSupport?: boolean;\n\n allowedValues?: string[];\n\n allowString?: boolean;\n\n cli?: boolean;\n\n description: string;\n\n env?: false | string;\n\n /**\n * Do not validate object children\n */\n freeChoice?: boolean;\n\n mergeable?: boolean;\n\n autogenerated?: boolean;\n\n name: string;\n\n parents?: AllowedParents[];\n\n stage?: RenovateConfigStage;\n\n experimental?: boolean;\n\n experimentalDescription?: string;\n\n experimentalIssues?: number[];\n\n advancedUse?: boolean;\n\n /**\n * This is used to add a deprecation message in the docs\n */\n deprecationMsg?: string;\n\n /**\n * For internal use only: add it to any config option that supports regex or glob matching\n */\n patternMatch?: boolean;\n\n /**\n * For internal use only: add it to any config option of type integer that supports negative integers\n */\n allowNegative?: boolean;\n\n /**\n * Managers which support this option, leave undefined if all managers support it.\n */\n supportedManagers?: string[];\n\n /**\n * Platforms which support this option, leave undefined if all platforms support it.\n */\n supportedPlatforms?: PlatformId[];\n\n /**\n * Conditions that must be met for this option to be required.\n */\n requiredIf?: RenovateRequiredOption[];\n\n /**\n * If true, the option's value supports Renovate templating.\n * @see https://docs.renovatebot.com/templates/\n */\n supportsTemplating?: boolean;\n}\n\nexport interface RenovateRequiredOption {\n siblingProperties: { property: string; value: string }[];\n}\n\nexport interface RenovateArrayOption<\n T extends string | number | Record<string, unknown> = Record<string, unknown>,\n> extends RenovateOptionBase {\n default?: T[] | null;\n mergeable?: boolean;\n type: 'array';\n subType?: 'string' | 'object' | 'number';\n}\n\nexport interface RenovateStringArrayOption extends RenovateArrayOption<string> {\n format?: 'regex';\n subType: 'string';\n}\n\nexport interface RenovateNumberArrayOption extends RenovateArrayOption<number> {\n subType: 'number';\n}\n\nexport interface RenovateBooleanOption extends RenovateOptionBase {\n default?: boolean | null;\n type: 'boolean';\n}\n\nexport interface RenovateIntegerOption extends RenovateOptionBase {\n default?: number | null;\n type: 'integer';\n}\n\nexport interface RenovateStringOption extends RenovateOptionBase {\n default?: string | null;\n format?: 'regex';\n\n // Not used\n replaceLineReturns?: boolean;\n type: 'string';\n}\n\nexport interface RenovateObjectOption extends RenovateOptionBase {\n default?: any;\n additionalProperties?: Record<string, unknown> | boolean;\n mergeable?: boolean;\n type: 'object';\n}\n\nexport type RenovateOptions =\n | RenovateStringOption\n | RenovateNumberArrayOption\n | RenovateStringArrayOption\n | RenovateIntegerOption\n | RenovateBooleanOption\n | RenovateArrayOption\n | RenovateObjectOption;\n\nexport interface PackageRuleInputConfig extends RenovateConfig {\n versioning?: string;\n packageFile?: string;\n lockFiles?: string[];\n depType?: string;\n depTypes?: string[];\n depName?: string;\n packageName?: string | null;\n newValue?: string | null;\n currentValue?: string | null;\n currentVersion?: string;\n lockedVersion?: string;\n updateType?: UpdateType;\n mergeConfidenceLevel?: MergeConfidence | undefined;\n isBump?: boolean;\n sourceUrl?: string | null;\n categories?: string[];\n baseBranch?: string;\n manager?: string;\n datasource?: string;\n packageRules?: (PackageRule & PackageRuleInputConfig)[];\n releaseTimestamp?: Timestamp | null;\n repository?: string;\n currentVersionAgeInDays?: number;\n currentVersionTimestamp?: string;\n enabled?: boolean;\n skipReason?: SkipReason;\n skipStage?: StageName;\n}\n\nexport interface ConfigMigration {\n configMigration?: boolean;\n}\n\nexport interface MigratedConfig {\n /**\n * Indicates whether there was a migration applied to the configuration.\n *\n * @returns\n * `false` if the configuration does not need migrating, and `migratedConfig` can be ignored\n * `true` if the configuration was migrated, and if so, `migratedConfig` should be used instead of the provided config\n */\n isMigrated: boolean;\n migratedConfig: RenovateConfig;\n}\n\nexport interface MigratedRenovateConfig extends RenovateConfig {\n endpoints?: HostRule[];\n pathRules: PackageRule[];\n packages: PackageRule[];\n\n node?: RenovateConfig;\n travis?: RenovateConfig;\n gradle?: RenovateConfig;\n}\n\nexport interface ManagerConfig extends RenovateConfig {\n manager: string;\n categories?: Category[];\n}\n\nexport interface ValidationResult {\n errors: ValidationMessage[];\n warnings: ValidationMessage[];\n}\n\nexport interface BumpVersionConfig {\n bumpType?: string;\n filePatterns: string[];\n matchStrings: string[];\n name?: string;\n}\n\n/**\n * Global Config for specified `toolSettings` options.\n *\n */\nexport interface GlobalToolSettingsOptions {\n /** An upper limit on what the Java Virtual Machine's maximum memory can be set to. Repositories can specify <= this value */\n jvmMaxMemory?: number;\n /** An upper limit on what the Java Virtual Machine's starting memory can be set to. Repositories can specify <= this value */\n jvmMemory?: number;\n /** An upper limit on what the Node.JS process' maximum memory can be set to. Repositories can specify <= this value */\n nodeMaxMemory?: number;\n}\n\n/**\n * Repository config options for `toolSettings` options.\n */\nexport interface RepoToolSettingsOptions {\n /** The maximum memory the Java Virtual Machine can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n jvmMaxMemory?: number;\n /** The starting memory the Java Virtual Machine can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n jvmMemory?: number;\n /** The maximum memory child Node.JS processes can use. If greater than the Global Self-Hosted configuration setting, it will be set to that limit **/\n nodeMaxMemory?: number;\n}\n"],"mappings":";AA6VA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;AACF;AA4MA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConfigValidationTopic } from "./types.js";
|
|
1
2
|
import { isNonEmptyArray } from "@sindresorhus/is";
|
|
2
3
|
//#region lib/config/validation-helpers/match-base-branches.ts
|
|
3
4
|
/**
|
|
@@ -6,7 +7,7 @@ import { isNonEmptyArray } from "@sindresorhus/is";
|
|
|
6
7
|
function check({ resolvedRule, currentPath, baseBranchPatterns }) {
|
|
7
8
|
const warnings = [];
|
|
8
9
|
if (Array.isArray(resolvedRule.matchBaseBranches) && !isNonEmptyArray(baseBranchPatterns)) warnings.push({
|
|
9
|
-
topic:
|
|
10
|
+
topic: ConfigValidationTopic.Error,
|
|
10
11
|
message: `${currentPath}: You must configure baseBranchPatterns in order to use them inside matchBaseBranches.`
|
|
11
12
|
});
|
|
12
13
|
return warnings;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"match-base-branches.js","names":[],"sources":["../../../lib/config/validation-helpers/match-base-branches.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport type { ValidationMessage } from '../types.ts';\nimport type
|
|
1
|
+
{"version":3,"file":"match-base-branches.js","names":[],"sources":["../../../lib/config/validation-helpers/match-base-branches.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport type { ValidationMessage } from '../types.ts';\nimport { type CheckBaseBranchesArgs, ConfigValidationTopic } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n resolvedRule,\n currentPath,\n baseBranchPatterns,\n}: CheckBaseBranchesArgs): ValidationMessage[] {\n const warnings: ValidationMessage[] = [];\n if (\n Array.isArray(resolvedRule.matchBaseBranches) &&\n !isNonEmptyArray(baseBranchPatterns)\n ) {\n warnings.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: You must configure baseBranchPatterns in order to use them inside matchBaseBranches.`,\n });\n }\n\n return warnings;\n}\n"],"mappings":";;;;;;AAOA,SAAgB,MAAM,EACpB,cACA,aACA,sBAC6C;CAC7C,MAAM,WAAgC,CAAC;CACvC,IACE,MAAM,QAAQ,aAAa,iBAAiB,KAC5C,CAAC,gBAAgB,kBAAkB,GAEnC,SAAS,KAAK;EACZ,OAAO,sBAAsB;EAC7B,SAAS,GAAG,YAAY;CAC1B,CAAC;CAGH,OAAO;AACT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getRegexPredicate, isRegexMatch } from "../../util/string-match.js";
|
|
2
|
+
import { ConfigValidationTopic } from "./types.js";
|
|
2
3
|
import { isArray, isString } from "@sindresorhus/is";
|
|
3
4
|
//#region lib/config/validation-helpers/regex-glob-matchers.ts
|
|
4
5
|
/**
|
|
@@ -8,15 +9,15 @@ function check({ val: matchers, currentPath }) {
|
|
|
8
9
|
const res = [];
|
|
9
10
|
if (isArray(matchers, isString)) {
|
|
10
11
|
if ((matchers.includes("*") || matchers.includes("**")) && matchers.length > 1) res.push({
|
|
11
|
-
topic:
|
|
12
|
+
topic: ConfigValidationTopic.Error,
|
|
12
13
|
message: `${currentPath}: Your input contains * or ** along with other patterns. Please remove them, as * or ** matches all patterns.`
|
|
13
14
|
});
|
|
14
15
|
for (const matcher of matchers) if (isRegexMatch(matcher) && !getRegexPredicate(matcher)) res.push({
|
|
15
|
-
topic:
|
|
16
|
+
topic: ConfigValidationTopic.Error,
|
|
16
17
|
message: `Failed to parse regex pattern for ${currentPath}: ${matcher}`
|
|
17
18
|
});
|
|
18
19
|
} else res.push({
|
|
19
|
-
topic:
|
|
20
|
+
topic: ConfigValidationTopic.Error,
|
|
20
21
|
message: `${currentPath}: should be an array of strings. You have included ${typeof matchers}.`
|
|
21
22
|
});
|
|
22
23
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-glob-matchers.js","names":[],"sources":["../../../lib/config/validation-helpers/regex-glob-matchers.ts"],"sourcesContent":["import { isArray, isString } from '@sindresorhus/is';\nimport { getRegexPredicate, isRegexMatch } from '../../util/string-match.ts';\nimport type { ValidationMessage } from '../types.ts';\nimport type
|
|
1
|
+
{"version":3,"file":"regex-glob-matchers.js","names":[],"sources":["../../../lib/config/validation-helpers/regex-glob-matchers.ts"],"sourcesContent":["import { isArray, isString } from '@sindresorhus/is';\nimport { getRegexPredicate, isRegexMatch } from '../../util/string-match.ts';\nimport type { ValidationMessage } from '../types.ts';\nimport { type CheckMatcherArgs, ConfigValidationTopic } from './types.ts';\n\n/**\n * Only if type condition or context condition violated then errors array will be mutated to store metadata\n */\nexport function check({\n val: matchers,\n currentPath,\n}: CheckMatcherArgs): ValidationMessage[] {\n const res: ValidationMessage[] = [];\n\n if (isArray(matchers, isString)) {\n if (\n (matchers.includes('*') || matchers.includes('**')) &&\n matchers.length > 1\n ) {\n res.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: Your input contains * or ** along with other patterns. Please remove them, as * or ** matches all patterns.`,\n });\n }\n for (const matcher of matchers) {\n // Validate regex pattern\n // No need to validate if the string is a glob\n // minimatch allows any string as glob\n if (isRegexMatch(matcher) && !getRegexPredicate(matcher)) {\n res.push({\n topic: ConfigValidationTopic.Error,\n message: `Failed to parse regex pattern for ${currentPath}: ${matcher}`,\n });\n }\n }\n } else {\n res.push({\n topic: ConfigValidationTopic.Error,\n message: `${currentPath}: should be an array of strings. You have included ${typeof matchers}.`,\n });\n }\n\n return res;\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,MAAM,EACpB,KAAK,UACL,eACwC;CACxC,MAAM,MAA2B,CAAC;CAElC,IAAI,QAAQ,UAAU,QAAQ,GAAG;EAC/B,KACG,SAAS,SAAS,GAAG,KAAK,SAAS,SAAS,IAAI,MACjD,SAAS,SAAS,GAElB,IAAI,KAAK;GACP,OAAO,sBAAsB;GAC7B,SAAS,GAAG,YAAY;EAC1B,CAAC;EAEH,KAAK,MAAM,WAAW,UAIpB,IAAI,aAAa,OAAO,KAAK,CAAC,kBAAkB,OAAO,GACrD,IAAI,KAAK;GACP,OAAO,sBAAsB;GAC7B,SAAS,qCAAqC,YAAY,IAAI;EAChE,CAAC;CAGP,OACE,IAAI,KAAK;EACP,OAAO,sBAAsB;EAC7B,SAAS,GAAG,YAAY,qDAAqD,OAAO,SAAS;CAC/F,CAAC;CAGH,OAAO;AACT"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../types.js";
|
|
2
|
+
//#region lib/config/validation-helpers/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Known `topic`s for Config Validation errors.
|
|
5
|
+
*
|
|
6
|
+
* This is particularly important for `Security`, which callers use to decide that a violation must always fail validation.
|
|
7
|
+
*/
|
|
8
|
+
declare const ConfigValidationTopic: {
|
|
9
|
+
readonly Error: 'Configuration Error';
|
|
10
|
+
readonly Warning: 'Configuration Warning';
|
|
11
|
+
readonly Deprecation: 'Deprecation Warning';
|
|
12
|
+
readonly Security: 'Config security error';
|
|
13
|
+
};
|
|
14
|
+
type ConfigValidationTopic = (typeof ConfigValidationTopic)[keyof typeof ConfigValidationTopic];
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ConfigValidationTopic };
|
|
17
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region lib/config/validation-helpers/types.ts
|
|
2
|
+
/**
|
|
3
|
+
* Known `topic`s for Config Validation errors.
|
|
4
|
+
*
|
|
5
|
+
* This is particularly important for `Security`, which callers use to decide that a violation must always fail validation.
|
|
6
|
+
*/
|
|
7
|
+
const ConfigValidationTopic = {
|
|
8
|
+
Error: "Configuration Error",
|
|
9
|
+
Warning: "Configuration Warning",
|
|
10
|
+
Deprecation: "Deprecation Warning",
|
|
11
|
+
Security: "Config security error"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ConfigValidationTopic };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../lib/config/validation-helpers/types.ts"],"sourcesContent":["import type { PackageRule } from '../types.ts';\n\n/**\n * Known `topic`s for Config Validation errors.\n *\n * This is particularly important for `Security`, which callers use to decide that a violation must always fail validation.\n */\nexport const ConfigValidationTopic = {\n Error: 'Configuration Error',\n Warning: 'Configuration Warning',\n Deprecation: 'Deprecation Warning',\n Security: 'Config security error',\n} as const;\n\nexport type ConfigValidationTopic =\n (typeof ConfigValidationTopic)[keyof typeof ConfigValidationTopic];\n\nexport interface CheckManagerArgs {\n resolvedRule: PackageRule;\n currentPath: string;\n}\n\nexport interface CheckMatcherArgs {\n val: unknown;\n currentPath: string;\n}\n\nexport interface CheckBaseBranchesArgs {\n resolvedRule: PackageRule;\n currentPath: string;\n /** user configurable base branch patterns*/\n baseBranchPatterns?: string[];\n}\n"],"mappings":";;;;;;AAOA,MAAa,wBAAwB;CACnC,OAAO;CACP,SAAS;CACT,aAAa;CACb,UAAU;AACZ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { regEx } from "../../util/regex.js";
|
|
2
2
|
import { logger } from "../../logger/index.js";
|
|
3
|
+
import { ConfigValidationTopic } from "./types.js";
|
|
3
4
|
import { isNonEmptyArray, isNonEmptyString, isNumber, isString } from "@sindresorhus/is";
|
|
4
5
|
import jsonata from "jsonata";
|
|
5
6
|
//#region lib/config/validation-helpers/utils.ts
|
|
@@ -15,11 +16,11 @@ function validateNumber(key, val, allowsNegative, currentPath, subKey) {
|
|
|
15
16
|
const path = `${currentPath}${subKey ? `.${subKey}` : ""}`;
|
|
16
17
|
if (isNumber(val)) {
|
|
17
18
|
if (val < 0 && !allowsNegative) errors.push({
|
|
18
|
-
topic:
|
|
19
|
+
topic: ConfigValidationTopic.Error,
|
|
19
20
|
message: `Configuration option \`${path}\` should be a positive integer. Found negative value instead.`
|
|
20
21
|
});
|
|
21
22
|
} else errors.push({
|
|
22
|
-
topic:
|
|
23
|
+
topic: ConfigValidationTopic.Error,
|
|
23
24
|
message: `Configuration option \`${path}\` should be an integer. Found: ${JSON.stringify(val)} (${typeof val}).`
|
|
24
25
|
});
|
|
25
26
|
return errors;
|
|
@@ -45,26 +46,26 @@ function validateRegexManagerFields(customManager, currentPath, errors) {
|
|
|
45
46
|
} catch (err) {
|
|
46
47
|
logger.debug({ err }, "customManager.matchStrings regEx validation error");
|
|
47
48
|
errors.push({
|
|
48
|
-
topic:
|
|
49
|
+
topic: ConfigValidationTopic.Error,
|
|
49
50
|
message: `Invalid regExp for ${currentPath}: \`${matchString}\``
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
else errors.push({
|
|
53
|
-
topic:
|
|
54
|
+
topic: ConfigValidationTopic.Error,
|
|
54
55
|
message: "Each Custom Manager `matchStrings` array must have at least one item."
|
|
55
56
|
});
|
|
56
57
|
for (const field of ["currentValue", "datasource"]) if (!hasField(customManager, field)) errors.push({
|
|
57
|
-
topic:
|
|
58
|
+
topic: ConfigValidationTopic.Error,
|
|
58
59
|
message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`
|
|
59
60
|
});
|
|
60
61
|
if (!["depName", "packageName"].some((field) => hasField(customManager, field))) errors.push({
|
|
61
|
-
topic:
|
|
62
|
+
topic: ConfigValidationTopic.Error,
|
|
62
63
|
message: `Regex Managers must contain depName or packageName regex groups or templates`
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
function validateJSONataManagerFields(customManager, currentPath, errors) {
|
|
66
67
|
if (!isNonEmptyString(customManager.fileFormat)) errors.push({
|
|
67
|
-
topic:
|
|
68
|
+
topic: ConfigValidationTopic.Error,
|
|
68
69
|
message: "Each JSONata manager must contain a fileFormat field."
|
|
69
70
|
});
|
|
70
71
|
if (isNonEmptyArray(customManager.matchStrings)) for (const matchString of customManager.matchStrings) try {
|
|
@@ -72,20 +73,20 @@ function validateJSONataManagerFields(customManager, currentPath, errors) {
|
|
|
72
73
|
} catch (err) {
|
|
73
74
|
logger.debug({ err }, "customManager.matchStrings JSONata query validation error");
|
|
74
75
|
errors.push({
|
|
75
|
-
topic:
|
|
76
|
+
topic: ConfigValidationTopic.Error,
|
|
76
77
|
message: `Invalid JSONata query for ${currentPath}: \`${matchString}\``
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
else errors.push({
|
|
80
|
-
topic:
|
|
81
|
+
topic: ConfigValidationTopic.Error,
|
|
81
82
|
message: `Each Custom Manager must contain a non-empty matchStrings array`
|
|
82
83
|
});
|
|
83
84
|
for (const field of ["currentValue", "datasource"]) if (!hasField(customManager, field)) errors.push({
|
|
84
|
-
topic:
|
|
85
|
+
topic: ConfigValidationTopic.Error,
|
|
85
86
|
message: `JSONata Managers must contain ${field}Template configuration or ${field} in the query `
|
|
86
87
|
});
|
|
87
88
|
if (!["depName", "packageName"].some((field) => hasField(customManager, field))) errors.push({
|
|
88
|
-
topic:
|
|
89
|
+
topic: ConfigValidationTopic.Error,
|
|
89
90
|
message: `JSONata Managers must contain depName or packageName in the query or their templates`
|
|
90
91
|
});
|
|
91
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../lib/config/validation-helpers/utils.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyString,\n isNumber,\n isString,\n} from '@sindresorhus/is';\nimport jsonata from 'jsonata';\nimport { logger } from '../../logger/index.ts';\nimport type { RegexManagerTemplates } from '../../modules/manager/custom/regex/types.ts';\nimport type { CustomManager } from '../../modules/manager/custom/types.ts';\nimport { regEx } from '../../util/regex.ts';\nimport type { ValidationMessage } from '../types.ts';\n\nexport function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport function validatePlainObject(\n val: Record<string, unknown>,\n): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!isString(value)) {\n return key;\n }\n }\n return true;\n}\n\nexport function validateNumber(\n key: string,\n val: unknown,\n allowsNegative: boolean,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? `.${subKey}` : ''}`;\n if (isNumber(val)) {\n if (val < 0 && !allowsNegative) {\n errors.push({\n topic:
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../lib/config/validation-helpers/utils.ts"],"sourcesContent":["import {\n isNonEmptyArray,\n isNonEmptyString,\n isNumber,\n isString,\n} from '@sindresorhus/is';\nimport jsonata from 'jsonata';\nimport { logger } from '../../logger/index.ts';\nimport type { RegexManagerTemplates } from '../../modules/manager/custom/regex/types.ts';\nimport type { CustomManager } from '../../modules/manager/custom/types.ts';\nimport { regEx } from '../../util/regex.ts';\nimport type { ValidationMessage } from '../types.ts';\nimport { ConfigValidationTopic } from './types.ts';\n\nexport function getParentName(parentPath: string | undefined): string {\n return parentPath\n ? parentPath\n .replace(regEx(/\\.?encrypted$/), '')\n .replace(regEx(/\\[\\d+\\]$/), '')\n .split('.')\n .pop()!\n : '.';\n}\n\nexport function validatePlainObject(\n val: Record<string, unknown>,\n): true | string {\n for (const [key, value] of Object.entries(val)) {\n if (!isString(value)) {\n return key;\n }\n }\n return true;\n}\n\nexport function validateNumber(\n key: string,\n val: unknown,\n allowsNegative: boolean,\n currentPath?: string,\n subKey?: string,\n): ValidationMessage[] {\n const errors: ValidationMessage[] = [];\n const path = `${currentPath}${subKey ? `.${subKey}` : ''}`;\n if (isNumber(val)) {\n if (val < 0 && !allowsNegative) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${path}\\` should be a positive integer. Found negative value instead.`,\n });\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Configuration option \\`${path}\\` should be an integer. Found: ${JSON.stringify(\n val,\n )} (${typeof val}).`,\n });\n }\n\n return errors;\n}\n\n/** An option is a false global if it has the same name as a global only option\n * but is actually just the field of a non global option or field an children of the non global option\n * eg. token: it's global option used as the bot's token as well and\n * also it can be the token used for a platform inside the hostRules configuration\n */\nexport function isFalseGlobal(\n optionName: string,\n parentPath?: string,\n): boolean {\n // v8 ignore else -- TODO: add test #40625\n if (\n parentPath?.includes('hostRules') &&\n (optionName === 'token' ||\n optionName === 'username' ||\n optionName === 'password')\n ) {\n return true;\n }\n\n return false;\n}\n\nfunction hasField(customManager: CustomManager, field: string): boolean {\n const templateField = `${field}Template` as keyof RegexManagerTemplates;\n const fieldStr =\n customManager.customType === 'regex' ? `(?<${field}>` : field;\n return !!(\n customManager[templateField] ??\n customManager.matchStrings?.some((matchString) =>\n matchString.includes(fieldStr),\n )\n );\n}\n\nexport function validateRegexManagerFields(\n customManager: CustomManager,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (isNonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n regEx(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings regEx validation error',\n );\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid regExp for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message:\n 'Each Custom Manager `matchStrings` array must have at least one item.',\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Regex Managers must contain ${field}Template configuration or regex group named ${field}`,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Regex Managers must contain depName or packageName regex groups or templates`,\n });\n }\n}\n\nexport function validateJSONataManagerFields(\n customManager: CustomManager,\n currentPath: string,\n errors: ValidationMessage[],\n): void {\n if (!isNonEmptyString(customManager.fileFormat)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: 'Each JSONata manager must contain a fileFormat field.',\n });\n }\n\n if (isNonEmptyArray(customManager.matchStrings)) {\n for (const matchString of customManager.matchStrings) {\n try {\n jsonata(matchString);\n } catch (err) {\n logger.debug(\n { err },\n 'customManager.matchStrings JSONata query validation error',\n );\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Invalid JSONata query for ${currentPath}: \\`${matchString}\\``,\n });\n }\n }\n } else {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `Each Custom Manager must contain a non-empty matchStrings array`,\n });\n }\n\n const mandatoryFields = ['currentValue', 'datasource'];\n for (const field of mandatoryFields) {\n if (!hasField(customManager, field)) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `JSONata Managers must contain ${field}Template configuration or ${field} in the query `,\n });\n }\n }\n\n const nameFields = ['depName', 'packageName'];\n if (!nameFields.some((field) => hasField(customManager, field))) {\n errors.push({\n topic: ConfigValidationTopic.Error,\n message: `JSONata Managers must contain depName or packageName in the query or their templates`,\n });\n }\n}\n"],"mappings":";;;;;;AAcA,SAAgB,cAAc,YAAwC;CACpE,OAAO,aACH,WACG,QAAQ,MAAM,eAAe,GAAG,EAAE,CAAC,CACnC,QAAQ,MAAM,UAAU,GAAG,EAAE,CAAC,CAC9B,MAAM,GAAG,CAAC,CACV,IAAI,IACP;AACN;AAEA,SAAgB,oBACd,KACe;CACf,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,GAAG,GAC3C,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO;CAGX,OAAO;AACT;AAEA,SAAgB,eACd,KACA,KACA,gBACA,aACA,QACqB;CACrB,MAAM,SAA8B,CAAC;CACrC,MAAM,OAAO,GAAG,cAAc,SAAS,IAAI,WAAW;CACtD,IAAI,SAAS,GAAG,GACV;MAAA,MAAM,KAAK,CAAC,gBACd,OAAO,KAAK;GACV,OAAO,sBAAsB;GAC7B,SAAS,0BAA0B,KAAK;EAC1C,CAAC;CAAA,OAGH,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS,0BAA0B,KAAK,kCAAkC,KAAK,UAC7E,GACF,EAAE,IAAI,OAAO,IAAI;CACnB,CAAC;CAGH,OAAO;AACT;;;;;;AAOA,SAAgB,cACd,YACA,YACS;;CAET,IACE,YAAY,SAAS,WAAW,MAC/B,eAAe,WACd,eAAe,cACf,eAAe,aAEjB,OAAO;CAGT,OAAO;AACT;AAEA,SAAS,SAAS,eAA8B,OAAwB;CACtE,MAAM,gBAAgB,GAAG,MAAM;CAC/B,MAAM,WACJ,cAAc,eAAe,UAAU,MAAM,MAAM,KAAK;CAC1D,OAAO,CAAC,EACN,cAAc,kBACd,cAAc,cAAc,MAAM,gBAChC,YAAY,SAAS,QAAQ,CAC/B;AAEJ;AAEA,SAAgB,2BACd,eACA,aACA,QACM;CACN,IAAI,gBAAgB,cAAc,YAAY,GAC5C,KAAK,MAAM,eAAe,cAAc,cACtC,IAAI;EACF,MAAM,WAAW;CACnB,SAAS,KAAK;EACZ,OAAO,MACL,EAAE,IAAI,GACN,mDACF;EACA,OAAO,KAAK;GACV,OAAO,sBAAsB;GAC7B,SAAS,sBAAsB,YAAY,MAAM,YAAY;EAC/D,CAAC;CACH;MAGF,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SACE;CACJ,CAAC;CAIH,KAAK,MAAM,SAAS,CADK,gBAAgB,YACP,GAChC,IAAI,CAAC,SAAS,eAAe,KAAK,GAChC,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS,+BAA+B,MAAM,8CAA8C;CAC9F,CAAC;CAKL,IAAI,CAAC,CADe,WAAW,aACjB,CAAC,CAAC,MAAM,UAAU,SAAS,eAAe,KAAK,CAAC,GAC5D,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS;CACX,CAAC;AAEL;AAEA,SAAgB,6BACd,eACA,aACA,QACM;CACN,IAAI,CAAC,iBAAiB,cAAc,UAAU,GAC5C,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS;CACX,CAAC;CAGH,IAAI,gBAAgB,cAAc,YAAY,GAC5C,KAAK,MAAM,eAAe,cAAc,cACtC,IAAI;EACF,QAAQ,WAAW;CACrB,SAAS,KAAK;EACZ,OAAO,MACL,EAAE,IAAI,GACN,2DACF;EACA,OAAO,KAAK;GACV,OAAO,sBAAsB;GAC7B,SAAS,6BAA6B,YAAY,MAAM,YAAY;EACtE,CAAC;CACH;MAGF,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS;CACX,CAAC;CAIH,KAAK,MAAM,SAAS,CADK,gBAAgB,YACP,GAChC,IAAI,CAAC,SAAS,eAAe,KAAK,GAChC,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS,iCAAiC,MAAM,4BAA4B,MAAM;CACpF,CAAC;CAKL,IAAI,CAAC,CADe,WAAW,aACjB,CAAC,CAAC,MAAM,UAAU,SAAS,eAAe,KAAK,CAAC,GAC5D,OAAO,KAAK;EACV,OAAO,sBAAsB;EAC7B,SAAS;CACX,CAAC;AAEL"}
|