renovate 44.143.0 → 44.144.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 +1 -0
- package/dist/config/types.js.map +1 -1
- package/dist/datasource-list.generated.d.ts +5 -0
- package/dist/modules/datasource/go/releases-direct.js +2 -1
- package/dist/modules/datasource/go/releases-direct.js.map +1 -1
- package/dist/modules/datasource/types.d.ts +6 -0
- package/dist/util/exec/containerbase.js +3 -3
- package/dist/util/exec/containerbase.js.map +1 -1
- package/dist/util/template/index.js +1 -0
- package/dist/util/template/index.js.map +1 -1
- package/dist/workers/repository/process/lookup/index.js +3 -1
- package/dist/workers/repository/process/lookup/index.js.map +1 -1
- package/package.json +2 -2
- package/renovate-schema.json +8 -8
package/dist/config/types.d.ts
CHANGED
|
@@ -617,6 +617,7 @@ export interface PackageRuleInputConfig extends RenovateConfig {
|
|
|
617
617
|
baseBranch?: string;
|
|
618
618
|
manager?: string;
|
|
619
619
|
datasource?: string;
|
|
620
|
+
effectiveDatasource?: string;
|
|
620
621
|
packageRules?: (PackageRule & PackageRuleInputConfig)[];
|
|
621
622
|
releaseTimestamp?: Timestamp | null;
|
|
622
623
|
repository?: string;
|
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';\nimport type { ConfigValidationTopic } from './validation-helpers/types.ts';\n\nexport type RenovateConfigStage =\n 'global' | 'inherit' | 'repository' | 'package' | 'branch' | 'pr';\n\nexport type RenovateSplit =\n 'init' | 'onboarding' | 'extract' | 'lookup' | 'update';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\nexport type RepositoryCacheType = 'local' | (string & {});\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type InternalHostAccess = 'allow' | 'warn' | 'block';\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 minimumReleaseAgeBuffer?: 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 exitCodeForErrors?: boolean;\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 allowCustomCrateGitRegistries?: 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 inheritConfigTrusted?: boolean;\n internalHostAccess?: InternalHostAccess;\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' | '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 overrideDescription?: 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' | 'goGenerate' | 'gradleWrapper' | 'mise' | '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 matchIsBreaking?: boolean;\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 /**\n * If true, this option **MUST** be checked at the trust boundary: after resolving the full config that sets it, but **before** the value is applied.\n *\n * This is in addition to any existing config validation, and ensures that these options are re-validated due to their sensitive nature.\n *\n * A failure of that check **must** lead to a {@link ConfigValidationTopic.Security} error (which is then a full config validation error), stopping the Renovate run.\n *\n * After this check has been performed, additional filtering (for defence in depth) could be performed, but may not have an indication of what is repo- or preset-config vs global self-hosted config.\n */\n requiresCheckAtTrustBoundary?: 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 isBreaking?: 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":";AAwVA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;AACF;AA6MA,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' | 'inherit' | 'repository' | 'package' | 'branch' | 'pr';\n\nexport type RenovateSplit =\n 'init' | 'onboarding' | 'extract' | 'lookup' | 'update';\n\nexport type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';\nexport type RepositoryCacheType = 'local' | (string & {});\nexport type DryRunConfig = 'extract' | 'lookup' | 'full';\nexport type InternalHostAccess = 'allow' | 'warn' | 'block';\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 minimumReleaseAgeBuffer?: 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 exitCodeForErrors?: boolean;\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 allowCustomCrateGitRegistries?: 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 inheritConfigTrusted?: boolean;\n internalHostAccess?: InternalHostAccess;\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' | '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 overrideDescription?: 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' | 'goGenerate' | 'gradleWrapper' | 'mise' | '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 matchIsBreaking?: boolean;\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 /**\n * If true, this option **MUST** be checked at the trust boundary: after resolving the full config that sets it, but **before** the value is applied.\n *\n * This is in addition to any existing config validation, and ensures that these options are re-validated due to their sensitive nature.\n *\n * A failure of that check **must** lead to a {@link ConfigValidationTopic.Security} error (which is then a full config validation error), stopping the Renovate run.\n *\n * After this check has been performed, additional filtering (for defence in depth) could be performed, but may not have an indication of what is repo- or preset-config vs global self-hosted config.\n */\n requiresCheckAtTrustBoundary?: 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 isBreaking?: boolean;\n sourceUrl?: string | null;\n categories?: string[];\n baseBranch?: string;\n manager?: string;\n datasource?: string;\n effectiveDatasource?: 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":";AAwVA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;AACF;AA6MA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region lib/datasource-list.generated.d.ts
|
|
2
|
+
export declare const AllDatasourcesListLiteral: readonly ["apk", "artifactory", "aws-eks-addon", "aws-machine-image", "aws-rds", "azure-bicep-resource", "azure-pipelines-tasks", "azure-tags", "bazel", "bitbucket-server-tags", "bitbucket-tags", "bitrise", "buildpacks-registry", "cdnjs", "clojure", "conan", "conda", "cpan", "crate", "custom", "dart", "dart-version", "deb", "deno", "devbox", "docker", "dotnet-version", "elm-package", "endoflife-date", "flutter-version", "forgejo-releases", "forgejo-tags", "galaxy", "galaxy-collection", "git-refs", "git-tags", "gitea-releases", "gitea-tags", "github-digest", "github-release-attachments", "github-releases", "github-runners", "github-tags", "gitlab-packages", "gitlab-releases", "gitlab-tags", "glasskube-packages", "go", "golang-version", "gradle-version", "hackage", "helm", "hermit", "hex", "hexpm-bob", "java-version", "jenkins-plugins", "jsr", "kubernetes-api", "maven", "nextcloud", "node-version", "npm", "nuget", "orb", "packagist", "pod", "puppet-forge", "pypi", "python-version", "repology", "rpm", "ruby-version", "rubygems", "rust-version", "sbt-package", "sbt-plugin", "terraform-module", "terraform-provider", "typst", "unity3d", "unity3d-packages"];
|
|
3
|
+
export type DatasourceName = typeof AllDatasourcesListLiteral[number];
|
|
4
|
+
//#endregion
|
|
5
|
+
//# sourceMappingURL=datasource-list.generated.d.ts.map
|
|
@@ -102,7 +102,8 @@ var GoDirectDatasource = class GoDirectDatasource extends Datasource {
|
|
|
102
102
|
return {
|
|
103
103
|
...res,
|
|
104
104
|
releases: filterByPrefix(packageName, res.releases),
|
|
105
|
-
sourceUrl
|
|
105
|
+
sourceUrl,
|
|
106
|
+
effectiveDatasource: source.datasource
|
|
106
107
|
};
|
|
107
108
|
}
|
|
108
109
|
getReleases(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releases-direct.js","names":[],"sources":["../../../../lib/modules/datasource/go/releases-direct.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { BitbucketTagsDatasource } from '../bitbucket-tags/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport { ForgejoTagsDatasource } from '../forgejo-tags/index.ts';\nimport { GitTagsDatasource } from '../git-tags/index.ts';\nimport { GiteaTagsDatasource } from '../gitea-tags/index.ts';\nimport { GithubTagsDatasource } from '../github-tags/index.ts';\nimport { GitlabTagsDatasource } from '../gitlab-tags/index.ts';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types.ts';\nimport { BaseGoDatasource } from './base.ts';\nimport { getSourceUrl, isPublicGoPackage } from './common.ts';\n\n/**\n * This function tries to select tags with longest prefix could be constructed from `packageName`.\n *\n * For package named `example.com/foo/bar/baz/qux`, it will try to detect tags with following prefixes:\n *\n * - `foo/bar/baz/qux/vX.Y.Z`\n * - `bar/baz/qux/vX.Y.Z`\n * - `baz/qux/vX.Y.Z`\n * - `qux/vX.Y.Z`\n *\n * If none of the following is found, it falls back to simply returning all tags like `vX.Y.Z`.\n */\nfunction filterByPrefix(packageName: string, releases: Release[]): Release[] {\n const nameParts = packageName\n .replace(regEx(/\\/v\\d+$/), '')\n .split('/')\n .slice(1);\n\n const submoduleReleases: Release[] = [];\n while (nameParts.length) {\n const prefix = `${nameParts.join('/')}/`;\n\n for (const release of releases) {\n if (!release.version.startsWith(prefix)) {\n continue;\n }\n\n const normalizedVersion = release.version.replace(prefix, '');\n if (!normalizedVersion.match(regEx(/^v\\d[^/]*/))) {\n continue;\n }\n\n release.version = release.version.replace(prefix, '');\n submoduleReleases.push(release);\n }\n\n if (submoduleReleases.length) {\n return submoduleReleases;\n }\n\n nameParts.shift();\n }\n\n return releases.filter((release) => release.version.startsWith('v'));\n}\n\nexport class GoDirectDatasource extends Datasource {\n static readonly id = 'go-direct';\n\n readonly forgejo = new ForgejoTagsDatasource();\n git: GitTagsDatasource;\n readonly gitea = new GiteaTagsDatasource();\n github: GithubTagsDatasource;\n gitlab: GitlabTagsDatasource;\n bitbucket: BitbucketTagsDatasource;\n\n constructor() {\n super(GoDirectDatasource.id);\n this.git = new GitTagsDatasource();\n this.github = new GithubTagsDatasource();\n this.gitlab = new GitlabTagsDatasource();\n this.bitbucket = new BitbucketTagsDatasource();\n }\n\n /**\n * go.getReleases\n *\n * This datasource resolves a go module URL into its source repository\n * and then fetch it if it is on GitHub.\n *\n * This function will:\n * - Determine the source URL for the module\n * - Call the respective getReleases in github/gitlab to retrieve the tags\n * - Filter module tags according to the module path\n */\n private async _getReleases(\n config: GetReleasesConfig,\n ): Promise<ReleaseResult | null> {\n const { packageName } = config;\n\n let res: ReleaseResult | null = null;\n\n logger.trace(`go.getReleases(${packageName})`);\n const source = await BaseGoDatasource.getDatasource(packageName);\n\n if (!source) {\n logger.info(\n { packageName },\n 'Unsupported go host - cannot look up versions',\n );\n return null;\n }\n\n switch (source.datasource) {\n case ForgejoTagsDatasource.id: {\n res = await this.forgejo.getReleases(source);\n break;\n }\n case GitTagsDatasource.id: {\n res = await this.git.getReleases(source);\n break;\n }\n case GiteaTagsDatasource.id: {\n res = await this.gitea.getReleases(source);\n break;\n }\n case GithubTagsDatasource.id: {\n res = await this.github.getReleases(source);\n break;\n }\n case GitlabTagsDatasource.id: {\n res = await this.gitlab.getReleases(source);\n break;\n }\n case BitbucketTagsDatasource.id: {\n res = await this.bitbucket.getReleases(source);\n break;\n }\n /* v8 ignore next -- should never happen */\n default: {\n return null;\n }\n }\n\n /* v8 ignore next -- TODO: add test */\n if (!res) {\n return null;\n }\n\n const sourceUrl = res.sourceUrl ?? getSourceUrl(source) ?? null;\n\n return {\n ...res,\n releases: filterByPrefix(packageName, res.releases),\n sourceUrl,\n };\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${GoDirectDatasource.id}`,\n key: config.packageName,\n cacheable: isPublicGoPackage(config.packageName),\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,eAAe,aAAqB,UAAgC;CAC3E,MAAM,YAAY,YACf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GAEF,KAAK,kBAAkB;IACrB,MAAM,MAAM,KAAK,IAAI,YAAY,MAAM;IACvC;GAEF,KAAK,oBAAoB;IACvB,MAAM,MAAM,KAAK,MAAM,YAAY,MAAM;IACzC;GAEF,KAAK,qBAAqB;IACxB,MAAM,MAAM,KAAK,OAAO,YAAY,MAAM;IAC1C;GAEF,KAAK,qBAAqB;IACxB,MAAM,MAAM,KAAK,OAAO,YAAY,MAAM;IAC1C;GAEF,KAAK,wBAAwB;IAC3B,MAAM,MAAM,KAAK,UAAU,YAAY,MAAM;IAC7C;;GAGF,SACE,OAAO;EAEX;;EAGA,IAAI,CAAC,KACH,OAAO;EAGT,MAAM,YAAY,IAAI,aAAa,aAAa,MAAM,KAAK;EAE3D,OAAO;GACL,GAAG;GACH,UAAU,eAAe,aAAa,IAAI,QAAQ;GAClD;
|
|
1
|
+
{"version":3,"file":"releases-direct.js","names":[],"sources":["../../../../lib/modules/datasource/go/releases-direct.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport { withCache } from '../../../util/cache/package/with-cache.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { BitbucketTagsDatasource } from '../bitbucket-tags/index.ts';\nimport { Datasource } from '../datasource.ts';\nimport { ForgejoTagsDatasource } from '../forgejo-tags/index.ts';\nimport { GitTagsDatasource } from '../git-tags/index.ts';\nimport { GiteaTagsDatasource } from '../gitea-tags/index.ts';\nimport { GithubTagsDatasource } from '../github-tags/index.ts';\nimport { GitlabTagsDatasource } from '../gitlab-tags/index.ts';\nimport type { GetReleasesConfig, Release, ReleaseResult } from '../types.ts';\nimport { BaseGoDatasource } from './base.ts';\nimport { getSourceUrl, isPublicGoPackage } from './common.ts';\n\n/**\n * This function tries to select tags with longest prefix could be constructed from `packageName`.\n *\n * For package named `example.com/foo/bar/baz/qux`, it will try to detect tags with following prefixes:\n *\n * - `foo/bar/baz/qux/vX.Y.Z`\n * - `bar/baz/qux/vX.Y.Z`\n * - `baz/qux/vX.Y.Z`\n * - `qux/vX.Y.Z`\n *\n * If none of the following is found, it falls back to simply returning all tags like `vX.Y.Z`.\n */\nfunction filterByPrefix(packageName: string, releases: Release[]): Release[] {\n const nameParts = packageName\n .replace(regEx(/\\/v\\d+$/), '')\n .split('/')\n .slice(1);\n\n const submoduleReleases: Release[] = [];\n while (nameParts.length) {\n const prefix = `${nameParts.join('/')}/`;\n\n for (const release of releases) {\n if (!release.version.startsWith(prefix)) {\n continue;\n }\n\n const normalizedVersion = release.version.replace(prefix, '');\n if (!normalizedVersion.match(regEx(/^v\\d[^/]*/))) {\n continue;\n }\n\n release.version = release.version.replace(prefix, '');\n submoduleReleases.push(release);\n }\n\n if (submoduleReleases.length) {\n return submoduleReleases;\n }\n\n nameParts.shift();\n }\n\n return releases.filter((release) => release.version.startsWith('v'));\n}\n\nexport class GoDirectDatasource extends Datasource {\n static readonly id = 'go-direct';\n\n readonly forgejo = new ForgejoTagsDatasource();\n git: GitTagsDatasource;\n readonly gitea = new GiteaTagsDatasource();\n github: GithubTagsDatasource;\n gitlab: GitlabTagsDatasource;\n bitbucket: BitbucketTagsDatasource;\n\n constructor() {\n super(GoDirectDatasource.id);\n this.git = new GitTagsDatasource();\n this.github = new GithubTagsDatasource();\n this.gitlab = new GitlabTagsDatasource();\n this.bitbucket = new BitbucketTagsDatasource();\n }\n\n /**\n * go.getReleases\n *\n * This datasource resolves a go module URL into its source repository\n * and then fetch it if it is on GitHub.\n *\n * This function will:\n * - Determine the source URL for the module\n * - Call the respective getReleases in github/gitlab to retrieve the tags\n * - Filter module tags according to the module path\n */\n private async _getReleases(\n config: GetReleasesConfig,\n ): Promise<ReleaseResult | null> {\n const { packageName } = config;\n\n let res: ReleaseResult | null = null;\n\n logger.trace(`go.getReleases(${packageName})`);\n const source = await BaseGoDatasource.getDatasource(packageName);\n\n if (!source) {\n logger.info(\n { packageName },\n 'Unsupported go host - cannot look up versions',\n );\n return null;\n }\n\n switch (source.datasource) {\n case ForgejoTagsDatasource.id: {\n res = await this.forgejo.getReleases(source);\n break;\n }\n case GitTagsDatasource.id: {\n res = await this.git.getReleases(source);\n break;\n }\n case GiteaTagsDatasource.id: {\n res = await this.gitea.getReleases(source);\n break;\n }\n case GithubTagsDatasource.id: {\n res = await this.github.getReleases(source);\n break;\n }\n case GitlabTagsDatasource.id: {\n res = await this.gitlab.getReleases(source);\n break;\n }\n case BitbucketTagsDatasource.id: {\n res = await this.bitbucket.getReleases(source);\n break;\n }\n /* v8 ignore next -- should never happen */\n default: {\n return null;\n }\n }\n\n /* v8 ignore next -- TODO: add test */\n if (!res) {\n return null;\n }\n\n const sourceUrl = res.sourceUrl ?? getSourceUrl(source) ?? null;\n\n return {\n ...res,\n releases: filterByPrefix(packageName, res.releases),\n sourceUrl,\n effectiveDatasource: source.datasource,\n };\n }\n\n getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {\n return withCache(\n {\n namespace: `datasource-${GoDirectDatasource.id}`,\n key: config.packageName,\n cacheable: isPublicGoPackage(config.packageName),\n fallback: true,\n },\n () => this._getReleases(config),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,eAAe,aAAqB,UAAgC;CAC3E,MAAM,YAAY,YACf,QAAQ,MAAM,SAAS,GAAG,EAAE,CAAC,CAC7B,MAAM,GAAG,CAAC,CACV,MAAM,CAAC;CAEV,MAAM,oBAA+B,CAAC;CACtC,OAAO,UAAU,QAAQ;EACvB,MAAM,SAAS,GAAG,UAAU,KAAK,GAAG,EAAE;EAEtC,KAAK,MAAM,WAAW,UAAU;GAC9B,IAAI,CAAC,QAAQ,QAAQ,WAAW,MAAM,GACpC;GAIF,IAAI,CADsB,QAAQ,QAAQ,QAAQ,QAAQ,EACrC,CAAC,CAAC,MAAM,MAAM,WAAW,CAAC,GAC7C;GAGF,QAAQ,UAAU,QAAQ,QAAQ,QAAQ,QAAQ,EAAE;GACpD,kBAAkB,KAAK,OAAO;EAChC;EAEA,IAAI,kBAAkB,QACpB,OAAO;EAGT,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eAAe,aAAa,IAAI,QAAQ;GAClD;GACA,qBAAqB,OAAO;EAC9B;CACF;CAEA,YAAY,QAA0D;EACpE,OAAO,UACL;GACE,WAAW,cAAc,mBAAmB;GAC5C,KAAK,OAAO;GACZ,WAAW,kBAAkB,OAAO,WAAW;GAC/C,UAAU;EACZ,SACM,KAAK,aAAa,MAAM,CAChC;CACF;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DatasourceName } from "../../datasource-list.generated.js";
|
|
1
2
|
import { AdditionalConstraintName, ConstraintName } from "../../util/exec/types.js";
|
|
2
3
|
import { Timestamp } from "../../util/timestamp.js";
|
|
3
4
|
import { ModuleApi } from "../../types/base.js";
|
|
@@ -104,6 +105,11 @@ export interface ReleaseResult {
|
|
|
104
105
|
sourceUrl?: string | null;
|
|
105
106
|
sourceDirectory?: string;
|
|
106
107
|
registryUrl?: string;
|
|
108
|
+
/**
|
|
109
|
+
* The datasource which served the lookup when another one was configured,
|
|
110
|
+
* e.g. `github-tags` for a `go` module hosted on GitHub.
|
|
111
|
+
*/
|
|
112
|
+
effectiveDatasource?: DatasourceName;
|
|
107
113
|
replacementName?: string;
|
|
108
114
|
replacementVersion?: string;
|
|
109
115
|
lookupName?: string;
|
|
@@ -335,9 +335,9 @@ async function generateInstallCommands(toolConstraints, memoize = false) {
|
|
|
335
335
|
const toolVersion = await resolveConstraint(toolConstraint);
|
|
336
336
|
const { toolName } = toolConstraint;
|
|
337
337
|
if (memoize) {
|
|
338
|
-
const cacheKey = `containerbase-
|
|
339
|
-
if (get(cacheKey)) continue;
|
|
340
|
-
set(cacheKey,
|
|
338
|
+
const cacheKey = `containerbase-active:${toolName}`;
|
|
339
|
+
if (get(cacheKey) === toolVersion) continue;
|
|
340
|
+
set(cacheKey, toolVersion);
|
|
341
341
|
}
|
|
342
342
|
const installCommand = `install-tool ${toolName} ${quote(toolVersion)}`;
|
|
343
343
|
installCommands.push(installCommand);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containerbase.js","names":["memCache.get"],"sources":["../../../lib/util/exec/containerbase.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { ReleaseResult } from '../../modules/datasource/index.ts';\nimport type { VersioningApi } from '../../modules/versioning/types.ts';\nimport { coerceArray } from '../array.ts';\nimport * as memCache from '../cache/memory/index.ts';\nimport { getEnv } from '../env.ts';\nimport { regEx } from '../regex.ts';\nimport type { Opt, ToolConfig, ToolConstraint, ToolName } from './types.ts';\n\nexport const allToolConfig: Record<ToolName, ToolConfig> = {\n apm: {\n datasource: 'github-releases',\n packageName: 'microsoft/apm',\n versioning: 'semver',\n extractVersion: '^v(?<version>.*)$',\n },\n bazelisk: {\n datasource: 'github-releases',\n packageName: 'bazelbuild/bazelisk',\n versioning: 'semver',\n },\n bun: {\n datasource: 'github-releases',\n packageName: 'oven-sh/bun',\n extractVersion: '^bun-v(?<version>.*)$',\n versioning: 'npm',\n },\n bundler: {\n datasource: 'rubygems',\n packageName: 'bundler',\n versioning: 'ruby',\n },\n cocoapods: {\n datasource: 'rubygems',\n packageName: 'cocoapods',\n versioning: 'ruby',\n },\n composer: {\n datasource: 'github-releases',\n packageName: 'containerbase/composer-prebuild',\n versioning: 'composer',\n },\n conan: {\n datasource: 'pypi',\n packageName: 'conan',\n versioning: 'pep440',\n },\n copier: {\n datasource: 'pypi',\n packageName: 'copier',\n versioning: 'pep440',\n },\n corepack: {\n datasource: 'npm',\n packageName: 'corepack',\n versioning: 'npm',\n },\n deno: {\n datasource: 'github-releases',\n packageName: 'denoland/deno',\n versioning: 'deno',\n },\n devbox: {\n datasource: 'github-releases',\n packageName: 'jetify-com/devbox',\n versioning: 'semver',\n },\n dotnet: {\n datasource: 'dotnet-version',\n packageName: 'dotnet-sdk',\n versioning: 'semver',\n },\n erlang: {\n datasource: 'github-releases',\n packageName: 'containerbase/erlang-prebuild',\n versioning: 'semver-coerced',\n },\n elixir: {\n datasource: 'github-releases',\n packageName: 'elixir-lang/elixir',\n versioning: 'semver',\n },\n flux: {\n datasource: 'github-releases',\n packageName: 'fluxcd/flux2',\n versioning: 'semver',\n },\n gh: {\n datasource: 'github-releases',\n packageName: 'cli/cli',\n versioning: 'semver',\n },\n gleam: {\n datasource: 'github-releases',\n packageName: 'gleam-lang/gleam',\n versioning: 'semver',\n },\n golang: {\n datasource: 'github-releases',\n packageName: 'containerbase/golang-prebuild',\n versioning: 'npm',\n },\n gradle: {\n datasource: 'gradle-version',\n packageName: 'gradle',\n versioning: 'gradle',\n },\n hashin: {\n datasource: 'pypi',\n packageName: 'hashin',\n versioning: 'pep440',\n },\n helm: {\n datasource: 'github-releases',\n packageName: 'helm/helm',\n versioning: 'semver',\n },\n helmfile: {\n datasource: 'github-releases',\n packageName: 'helmfile/helmfile',\n versioning: 'semver',\n },\n java: {\n datasource: 'java-version',\n packageName: 'java?system=true',\n versioning: 'npm',\n },\n jb: {\n datasource: 'github-releases',\n packageName: 'jsonnet-bundler/jsonnet-bundler',\n versioning: 'semver',\n },\n kustomize: {\n datasource: 'github-releases',\n packageName: 'kubernetes-sigs/kustomize',\n extractVersion: '^kustomize/v(?<version>.*)$',\n versioning: 'semver',\n },\n maven: {\n datasource: 'github-releases',\n packageName: 'containerbase/maven-prebuild',\n versioning: 'maven',\n },\n mise: {\n datasource: 'github-releases',\n packageName: 'jdx/mise',\n versioning: 'npm',\n },\n nix: {\n datasource: 'github-releases',\n packageName: 'containerbase/nix-prebuild',\n versioning: 'semver',\n },\n node: {\n datasource: 'github-releases',\n packageName: 'containerbase/node-prebuild',\n versioning: 'node',\n },\n npm: {\n datasource: 'npm',\n packageName: 'npm',\n versioning: 'npm',\n },\n pdm: {\n datasource: 'github-releases',\n packageName: 'pdm-project/pdm',\n versioning: 'semver',\n },\n php: {\n datasource: 'github-releases',\n packageName: 'containerbase/php-prebuild',\n versioning: 'composer',\n },\n 'pip-tools': {\n datasource: 'pypi',\n packageName: 'pip-tools',\n versioning: 'pep440',\n },\n pipenv: {\n datasource: 'pypi',\n packageName: 'pipenv',\n versioning: 'pep440',\n },\n pnpm: {\n datasource: 'npm',\n packageName: 'pnpm',\n versioning: 'npm',\n },\n pixi: {\n datasource: 'github-releases',\n packageName: 'prefix-dev/pixi',\n versioning: 'conda',\n extractVersion: '^v(?<version>.*)$',\n },\n poetry: {\n datasource: 'pypi',\n packageName: 'poetry',\n versioning: 'pep440',\n },\n python: {\n datasource: 'github-releases',\n packageName: 'containerbase/python-prebuild',\n versioning: 'python',\n },\n ruby: {\n datasource: 'github-releases',\n packageName: 'containerbase/ruby-prebuild',\n versioning: 'ruby',\n },\n rust: {\n datasource: 'rust-version',\n packageName: 'rust',\n versioning: 'rust-release-channel',\n },\n uv: {\n datasource: 'pypi',\n packageName: 'uv',\n versioning: 'pep440',\n },\n yarn: {\n datasource: 'npm',\n packageName: 'yarn',\n versioning: 'npm',\n },\n 'yarn-slim': {\n datasource: 'npm',\n packageName: 'yarn',\n versioning: 'npm',\n },\n dart: {\n datasource: 'dart-version',\n packageName: 'dart',\n versioning: 'npm',\n },\n flutter: {\n datasource: 'github-releases',\n packageName: 'containerbase/flutter-prebuild',\n versioning: 'npm',\n },\n vendir: {\n datasource: 'github-releases',\n packageName: 'carvel-dev/vendir',\n versioning: 'semver',\n },\n} as const;\n\nlet _getPkgReleases: Promise<\n typeof import('../../modules/datasource/index.ts')\n> | null = null;\n\nasync function getPkgReleases(\n toolConfig: ToolConfig,\n): Promise<ReleaseResult | null> {\n _getPkgReleases ??= import('../../modules/datasource/index.ts');\n const { getPkgReleases } = await _getPkgReleases;\n return getPkgReleases(toolConfig);\n}\n\nexport function getToolConfig(toolName: ToolName): ToolConfig {\n return allToolConfig[toolName];\n}\n\nexport function supportsDynamicInstall(toolName: ToolName): boolean {\n return !!allToolConfig[toolName];\n}\n\nexport function isContainerbase(): boolean {\n return !!getEnv().CONTAINERBASE;\n}\n\nexport function isDynamicInstall(\n toolConstraints?: Opt<ToolConstraint[]>,\n): boolean {\n if (GlobalConfig.get('binarySource') !== 'install') {\n return false;\n }\n if (!isContainerbase()) {\n logger.debug('Falling back to binarySource=global');\n return false;\n }\n return (\n !toolConstraints ||\n toolConstraints.every((toolConstraint) =>\n supportsDynamicInstall(toolConstraint.toolName),\n )\n );\n}\n\nfunction isStable(\n version: string,\n versioningApi: VersioningApi,\n latest?: string,\n): boolean {\n if (!versioningApi.isStable(version)) {\n return false;\n }\n if (isString(latest) && versioningApi.isGreaterThan(version, latest)) {\n return false;\n }\n return true;\n}\n\nexport async function resolveConstraint(\n toolConstraint: ToolConstraint,\n): Promise<string> {\n const { toolName } = toolConstraint;\n const toolConfig = allToolConfig[toolName];\n if (!toolConfig) {\n throw new Error(`Invalid tool to install: ${toolName}`);\n }\n\n const { get: getVersioning } =\n await import('../../modules/versioning/index.ts');\n const versioning = getVersioning(toolConfig.versioning);\n let constraint = toolConstraint.constraint;\n if (constraint) {\n if (versioning.isValid(constraint)) {\n if (versioning.isSingleVersion(constraint)) {\n return constraint.replace(regEx(/^=+/), '').trim();\n }\n } else {\n logger.warn(\n { toolName, constraint, versioning: toolConfig.versioning },\n 'Invalid tool constraint',\n );\n constraint = undefined;\n }\n }\n\n const pkgReleases = await getPkgReleases(toolConfig);\n const releases = coerceArray(pkgReleases?.releases);\n\n if (!releases?.length) {\n logger.warn({ toolConfig }, 'No tool releases found.');\n throw new Error('No tool releases found.');\n }\n\n const matchingReleases = releases.filter(\n (r) => !constraint || versioning.matches(r.version, constraint),\n );\n\n const stableMatchingVersion = matchingReleases\n .filter((r) => isStable(r.version, versioning, pkgReleases?.tags?.latest))\n .pop()?.version;\n if (stableMatchingVersion) {\n logger.debug(\n { toolName, constraint, resolvedVersion: stableMatchingVersion },\n 'Resolved stable matching version',\n );\n return stableMatchingVersion;\n }\n\n const unstableMatchingVersion = matchingReleases.pop()?.version;\n if (unstableMatchingVersion) {\n logger.debug(\n { toolName, constraint, resolvedVersion: unstableMatchingVersion },\n 'Resolved unstable matching version',\n );\n return unstableMatchingVersion;\n }\n\n const stableVersion = releases\n .filter((r) => isStable(r.version, versioning, pkgReleases?.tags?.latest))\n .pop()?.version;\n if (stableVersion) {\n logger.warn(\n { toolName, constraint, stableVersion },\n 'No matching tool versions found for constraint - using latest stable version',\n );\n }\n\n const highestVersion = releases.pop()!.version;\n logger.warn(\n { toolName, constraint, highestVersion },\n 'No matching or stable tool versions found - using an unstable version',\n );\n return highestVersion;\n}\n\n// Docker execs run in a fresh `--rm` container each time, so `memoize` must\n// stay false there - only the persistent-host (binarySource=install) path\n// can safely skip a tool it has already installed this run.\nexport async function generateInstallCommands(\n toolConstraints: Opt<ToolConstraint[]>,\n memoize = false,\n): Promise<string[]> {\n const installCommands: string[] = [];\n if (toolConstraints?.length) {\n for (const toolConstraint of toolConstraints) {\n const toolVersion = await resolveConstraint(toolConstraint);\n const { toolName } = toolConstraint;\n if (memoize) {\n const cacheKey = `containerbase-installed:${toolName}:${toolVersion}`;\n if (memCache.get<boolean | undefined>(cacheKey)) {\n continue;\n }\n memCache.set(cacheKey, true);\n }\n const installCommand = `install-tool ${toolName} ${quote(toolVersion)}`;\n installCommands.push(installCommand);\n }\n }\n return installCommands;\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,gBAA8C;CACzD,KAAK;EACH,YAAY;EACZ,aAAa;EACb,YAAY;EACZ,gBAAgB;CAClB;CACA,UAAU;EACR,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,KAAK;EACH,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,YAAY;CACd;CACA,SAAS;EACP,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,WAAW;EACT,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,UAAU;EACR,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,OAAO;EACL,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,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B;EAC3B,OAAO,MACL;GAAE;GAAU;GAAY,iBAAiB;EAAwB,GACjE,oCACF;EACA,OAAO;CACT;CAEA,MAAM,gBAAgB,SACnB,QAAQ,MAAM,SAAS,EAAE,SAAS,YAAY,aAAa,MAAM,MAAM,CAAC,CAAC,CACzE,IAAI,CAAC,EAAE;CACV,IAAI,eACF,OAAO,KACL;EAAE;EAAU;EAAY;CAAc,GACtC,8EACF;CAGF,MAAM,iBAAiB,SAAS,IAAI,CAAC,CAAE;CACvC,OAAO,KACL;EAAE;EAAU;EAAY;CAAe,GACvC,uEACF;CACA,OAAO;AACT;AAKA,eAAsB,wBACpB,iBACA,UAAU,OACS;CACnB,MAAM,kBAA4B,CAAC;CACnC,IAAI,iBAAiB,QACnB,KAAK,MAAM,kBAAkB,iBAAiB;EAC5C,MAAM,cAAc,MAAM,kBAAkB,cAAc;EAC1D,MAAM,EAAE,aAAa;EACrB,IAAI,SAAS;GACX,MAAM,WAAW,2BAA2B,SAAS,GAAG;GACxD,IAAIA,IAAkC,QAAQ,GAC5C;GAEF,IAAa,UAAU,IAAI;EAC7B;EACA,MAAM,iBAAiB,gBAAgB,SAAS,GAAG,MAAM,WAAW;EACpE,gBAAgB,KAAK,cAAc;CACrC;CAEF,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"containerbase.js","names":["memCache.get"],"sources":["../../../lib/util/exec/containerbase.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { logger } from '../../logger/index.ts';\nimport type { ReleaseResult } from '../../modules/datasource/index.ts';\nimport type { VersioningApi } from '../../modules/versioning/types.ts';\nimport { coerceArray } from '../array.ts';\nimport * as memCache from '../cache/memory/index.ts';\nimport { getEnv } from '../env.ts';\nimport { regEx } from '../regex.ts';\nimport type { Opt, ToolConfig, ToolConstraint, ToolName } from './types.ts';\n\nexport const allToolConfig: Record<ToolName, ToolConfig> = {\n apm: {\n datasource: 'github-releases',\n packageName: 'microsoft/apm',\n versioning: 'semver',\n extractVersion: '^v(?<version>.*)$',\n },\n bazelisk: {\n datasource: 'github-releases',\n packageName: 'bazelbuild/bazelisk',\n versioning: 'semver',\n },\n bun: {\n datasource: 'github-releases',\n packageName: 'oven-sh/bun',\n extractVersion: '^bun-v(?<version>.*)$',\n versioning: 'npm',\n },\n bundler: {\n datasource: 'rubygems',\n packageName: 'bundler',\n versioning: 'ruby',\n },\n cocoapods: {\n datasource: 'rubygems',\n packageName: 'cocoapods',\n versioning: 'ruby',\n },\n composer: {\n datasource: 'github-releases',\n packageName: 'containerbase/composer-prebuild',\n versioning: 'composer',\n },\n conan: {\n datasource: 'pypi',\n packageName: 'conan',\n versioning: 'pep440',\n },\n copier: {\n datasource: 'pypi',\n packageName: 'copier',\n versioning: 'pep440',\n },\n corepack: {\n datasource: 'npm',\n packageName: 'corepack',\n versioning: 'npm',\n },\n deno: {\n datasource: 'github-releases',\n packageName: 'denoland/deno',\n versioning: 'deno',\n },\n devbox: {\n datasource: 'github-releases',\n packageName: 'jetify-com/devbox',\n versioning: 'semver',\n },\n dotnet: {\n datasource: 'dotnet-version',\n packageName: 'dotnet-sdk',\n versioning: 'semver',\n },\n erlang: {\n datasource: 'github-releases',\n packageName: 'containerbase/erlang-prebuild',\n versioning: 'semver-coerced',\n },\n elixir: {\n datasource: 'github-releases',\n packageName: 'elixir-lang/elixir',\n versioning: 'semver',\n },\n flux: {\n datasource: 'github-releases',\n packageName: 'fluxcd/flux2',\n versioning: 'semver',\n },\n gh: {\n datasource: 'github-releases',\n packageName: 'cli/cli',\n versioning: 'semver',\n },\n gleam: {\n datasource: 'github-releases',\n packageName: 'gleam-lang/gleam',\n versioning: 'semver',\n },\n golang: {\n datasource: 'github-releases',\n packageName: 'containerbase/golang-prebuild',\n versioning: 'npm',\n },\n gradle: {\n datasource: 'gradle-version',\n packageName: 'gradle',\n versioning: 'gradle',\n },\n hashin: {\n datasource: 'pypi',\n packageName: 'hashin',\n versioning: 'pep440',\n },\n helm: {\n datasource: 'github-releases',\n packageName: 'helm/helm',\n versioning: 'semver',\n },\n helmfile: {\n datasource: 'github-releases',\n packageName: 'helmfile/helmfile',\n versioning: 'semver',\n },\n java: {\n datasource: 'java-version',\n packageName: 'java?system=true',\n versioning: 'npm',\n },\n jb: {\n datasource: 'github-releases',\n packageName: 'jsonnet-bundler/jsonnet-bundler',\n versioning: 'semver',\n },\n kustomize: {\n datasource: 'github-releases',\n packageName: 'kubernetes-sigs/kustomize',\n extractVersion: '^kustomize/v(?<version>.*)$',\n versioning: 'semver',\n },\n maven: {\n datasource: 'github-releases',\n packageName: 'containerbase/maven-prebuild',\n versioning: 'maven',\n },\n mise: {\n datasource: 'github-releases',\n packageName: 'jdx/mise',\n versioning: 'npm',\n },\n nix: {\n datasource: 'github-releases',\n packageName: 'containerbase/nix-prebuild',\n versioning: 'semver',\n },\n node: {\n datasource: 'github-releases',\n packageName: 'containerbase/node-prebuild',\n versioning: 'node',\n },\n npm: {\n datasource: 'npm',\n packageName: 'npm',\n versioning: 'npm',\n },\n pdm: {\n datasource: 'github-releases',\n packageName: 'pdm-project/pdm',\n versioning: 'semver',\n },\n php: {\n datasource: 'github-releases',\n packageName: 'containerbase/php-prebuild',\n versioning: 'composer',\n },\n 'pip-tools': {\n datasource: 'pypi',\n packageName: 'pip-tools',\n versioning: 'pep440',\n },\n pipenv: {\n datasource: 'pypi',\n packageName: 'pipenv',\n versioning: 'pep440',\n },\n pnpm: {\n datasource: 'npm',\n packageName: 'pnpm',\n versioning: 'npm',\n },\n pixi: {\n datasource: 'github-releases',\n packageName: 'prefix-dev/pixi',\n versioning: 'conda',\n extractVersion: '^v(?<version>.*)$',\n },\n poetry: {\n datasource: 'pypi',\n packageName: 'poetry',\n versioning: 'pep440',\n },\n python: {\n datasource: 'github-releases',\n packageName: 'containerbase/python-prebuild',\n versioning: 'python',\n },\n ruby: {\n datasource: 'github-releases',\n packageName: 'containerbase/ruby-prebuild',\n versioning: 'ruby',\n },\n rust: {\n datasource: 'rust-version',\n packageName: 'rust',\n versioning: 'rust-release-channel',\n },\n uv: {\n datasource: 'pypi',\n packageName: 'uv',\n versioning: 'pep440',\n },\n yarn: {\n datasource: 'npm',\n packageName: 'yarn',\n versioning: 'npm',\n },\n 'yarn-slim': {\n datasource: 'npm',\n packageName: 'yarn',\n versioning: 'npm',\n },\n dart: {\n datasource: 'dart-version',\n packageName: 'dart',\n versioning: 'npm',\n },\n flutter: {\n datasource: 'github-releases',\n packageName: 'containerbase/flutter-prebuild',\n versioning: 'npm',\n },\n vendir: {\n datasource: 'github-releases',\n packageName: 'carvel-dev/vendir',\n versioning: 'semver',\n },\n} as const;\n\nlet _getPkgReleases: Promise<\n typeof import('../../modules/datasource/index.ts')\n> | null = null;\n\nasync function getPkgReleases(\n toolConfig: ToolConfig,\n): Promise<ReleaseResult | null> {\n _getPkgReleases ??= import('../../modules/datasource/index.ts');\n const { getPkgReleases } = await _getPkgReleases;\n return getPkgReleases(toolConfig);\n}\n\nexport function getToolConfig(toolName: ToolName): ToolConfig {\n return allToolConfig[toolName];\n}\n\nexport function supportsDynamicInstall(toolName: ToolName): boolean {\n return !!allToolConfig[toolName];\n}\n\nexport function isContainerbase(): boolean {\n return !!getEnv().CONTAINERBASE;\n}\n\nexport function isDynamicInstall(\n toolConstraints?: Opt<ToolConstraint[]>,\n): boolean {\n if (GlobalConfig.get('binarySource') !== 'install') {\n return false;\n }\n if (!isContainerbase()) {\n logger.debug('Falling back to binarySource=global');\n return false;\n }\n return (\n !toolConstraints ||\n toolConstraints.every((toolConstraint) =>\n supportsDynamicInstall(toolConstraint.toolName),\n )\n );\n}\n\nfunction isStable(\n version: string,\n versioningApi: VersioningApi,\n latest?: string,\n): boolean {\n if (!versioningApi.isStable(version)) {\n return false;\n }\n if (isString(latest) && versioningApi.isGreaterThan(version, latest)) {\n return false;\n }\n return true;\n}\n\nexport async function resolveConstraint(\n toolConstraint: ToolConstraint,\n): Promise<string> {\n const { toolName } = toolConstraint;\n const toolConfig = allToolConfig[toolName];\n if (!toolConfig) {\n throw new Error(`Invalid tool to install: ${toolName}`);\n }\n\n const { get: getVersioning } =\n await import('../../modules/versioning/index.ts');\n const versioning = getVersioning(toolConfig.versioning);\n let constraint = toolConstraint.constraint;\n if (constraint) {\n if (versioning.isValid(constraint)) {\n if (versioning.isSingleVersion(constraint)) {\n return constraint.replace(regEx(/^=+/), '').trim();\n }\n } else {\n logger.warn(\n { toolName, constraint, versioning: toolConfig.versioning },\n 'Invalid tool constraint',\n );\n constraint = undefined;\n }\n }\n\n const pkgReleases = await getPkgReleases(toolConfig);\n const releases = coerceArray(pkgReleases?.releases);\n\n if (!releases?.length) {\n logger.warn({ toolConfig }, 'No tool releases found.');\n throw new Error('No tool releases found.');\n }\n\n const matchingReleases = releases.filter(\n (r) => !constraint || versioning.matches(r.version, constraint),\n );\n\n const stableMatchingVersion = matchingReleases\n .filter((r) => isStable(r.version, versioning, pkgReleases?.tags?.latest))\n .pop()?.version;\n if (stableMatchingVersion) {\n logger.debug(\n { toolName, constraint, resolvedVersion: stableMatchingVersion },\n 'Resolved stable matching version',\n );\n return stableMatchingVersion;\n }\n\n const unstableMatchingVersion = matchingReleases.pop()?.version;\n if (unstableMatchingVersion) {\n logger.debug(\n { toolName, constraint, resolvedVersion: unstableMatchingVersion },\n 'Resolved unstable matching version',\n );\n return unstableMatchingVersion;\n }\n\n const stableVersion = releases\n .filter((r) => isStable(r.version, versioning, pkgReleases?.tags?.latest))\n .pop()?.version;\n if (stableVersion) {\n logger.warn(\n { toolName, constraint, stableVersion },\n 'No matching tool versions found for constraint - using latest stable version',\n );\n }\n\n const highestVersion = releases.pop()!.version;\n logger.warn(\n { toolName, constraint, highestVersion },\n 'No matching or stable tool versions found - using an unstable version',\n );\n return highestVersion;\n}\n\n// Docker execs run in a fresh `--rm` container each time, so `memoize` must\n// stay false there - only the persistent-host (binarySource=install) path\n// can safely skip a tool whose requested version is already active.\n// `install-tool` also activates the version it installs, so the memo tracks\n// the active version per tool, not every installed version.\nexport async function generateInstallCommands(\n toolConstraints: Opt<ToolConstraint[]>,\n memoize = false,\n): Promise<string[]> {\n const installCommands: string[] = [];\n if (toolConstraints?.length) {\n for (const toolConstraint of toolConstraints) {\n const toolVersion = await resolveConstraint(toolConstraint);\n const { toolName } = toolConstraint;\n if (memoize) {\n const cacheKey = `containerbase-active:${toolName}`;\n if (memCache.get<string | undefined>(cacheKey) === toolVersion) {\n continue;\n }\n memCache.set(cacheKey, toolVersion);\n }\n const installCommand = `install-tool ${toolName} ${quote(toolVersion)}`;\n installCommands.push(installCommand);\n }\n }\n return installCommands;\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,gBAA8C;CACzD,KAAK;EACH,YAAY;EACZ,aAAa;EACb,YAAY;EACZ,gBAAgB;CAClB;CACA,UAAU;EACR,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,KAAK;EACH,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,YAAY;CACd;CACA,SAAS;EACP,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,WAAW;EACT,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,UAAU;EACR,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,OAAO;EACL,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,UAAU;EACR,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,MAAM;EACJ,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,QAAQ;EACN,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,MAAM;EACJ,YAAY;EACZ,aAAa;EACb,YAAY;CACd;CACA,IAAI;EACF,YAAY;E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B,wBACpB,iBACA,UAAU,OACS;CACnB,MAAM,kBAA4B,CAAC;CACnC,IAAI,iBAAiB,QACnB,KAAK,MAAM,kBAAkB,iBAAiB;EAC5C,MAAM,cAAc,MAAM,kBAAkB,cAAc;EAC1D,MAAM,EAAE,aAAa;EACrB,IAAI,SAAS;GACX,MAAM,WAAW,wBAAwB;GACzC,IAAIA,IAAiC,QAAQ,MAAM,aACjD;GAEF,IAAa,UAAU,WAAW;EACpC;EACA,MAAM,iBAAiB,gBAAgB,SAAS,GAAG,MAAM,WAAW;EACpE,gBAAgB,KAAK,cAAc;CACrC;CAEF,OAAO;AACT"}
|
|
@@ -125,6 +125,7 @@ const allowedFields = {
|
|
|
125
125
|
displayFrom: "The current value, formatted for display",
|
|
126
126
|
displayPending: "Latest pending update, if internalChecksFilter is in use",
|
|
127
127
|
displayTo: "The to value, formatted for display",
|
|
128
|
+
effectiveDatasource: "The datasources used to fetch releases after delegation",
|
|
128
129
|
hasReleaseNotes: "true if the upgrade has release notes",
|
|
129
130
|
indentation: "The indentation of the dependency being updated",
|
|
130
131
|
isGroup: "true if the upgrade is part of a group",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/template/index.ts"],"sourcesContent":["import {\n isArray,\n isNumber,\n isPlainObject,\n isPrimitive,\n isString,\n} from '@sindresorhus/is';\nimport handlebars, { type HelperOptions } from 'handlebars';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { pkg } from '../../expose.ts';\nimport { logger } from '../../logger/index.ts';\nimport { toArray } from '../array.ts';\nimport { getChildEnv } from '../exec/utils.ts';\nimport { regEx } from '../regex.ts';\n\n// Missing in handlebars\ntype Options = HelperOptions & {\n lookupProperty: (element: unknown, key: unknown) => unknown;\n};\n\nconst helpers: Record<string, handlebars.HelperDelegate> = {\n encodeURIComponent,\n decodeURIComponent,\n encodeBase64: (str: string) => Buffer.from(str ?? '').toString('base64'),\n decodeBase64: (str: string) => Buffer.from(str ?? '', 'base64').toString(),\n stringToPrettyJSON: (input: string): string =>\n JSON.stringify(JSON.parse(input), null, 2),\n toJSON: (input: unknown): string => JSON.stringify(input),\n toArray: (...args: unknown[]): unknown[] => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args;\n },\n toObject: (...args: unknown[]): unknown => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n\n if (args.length % 2 !== 0) {\n throw new Error(`Must contain an even number of elements`);\n }\n\n const keys = args.filter((_, index) => index % 2 === 0);\n const values = args.filter((_, index) => index % 2 === 1);\n\n return Object.fromEntries(keys.map((key, index) => [key, values[index]]));\n },\n replace: (find, replace, context) =>\n (context ?? '').replace(regEx(find, 'g'), replace),\n lowercase: (str: string) => str?.toLowerCase(),\n uppercase: (str: string) => str?.toUpperCase(),\n containsString: (str, subStr) => str?.includes(subStr),\n equals: (arg1, arg2) => arg1 === arg2,\n includes: (arg1: string[], arg2: string) => {\n if (isArray(arg1, isString) && isString(arg2)) {\n return arg1.includes(arg2);\n }\n return false;\n },\n split: (str: unknown, separator: unknown): string[] => {\n if (isString(str) && isString(separator)) {\n return str.split(separator);\n }\n return [];\n },\n and: (...args: unknown[]) => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args.every(Boolean);\n },\n or: (...args: unknown[]) => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args.some(Boolean);\n },\n lookupArray: (obj: unknown, key: unknown, options: Options): unknown[] => {\n return (\n toArray(obj)\n // skip elements like #with does\n .filter((element) => !handlebars.Utils.isEmpty(element))\n .map((element) => options.lookupProperty(element, key))\n .filter((value) => value !== undefined)\n );\n },\n distinct: (obj: unknown): unknown[] => {\n const seen = new Set<string>();\n\n return toArray(obj).filter((value) => {\n const str = JSON.stringify(value);\n\n if (seen.has(str)) {\n return false;\n }\n\n seen.add(str);\n return true;\n });\n },\n add: (a, b) => {\n if (isNumber(a) && isNumber(b)) {\n return a + b;\n }\n\n throw new Error('add: inputs are not valid');\n },\n};\n\n// Register all helpers from the single source of truth\nfor (const [name, fn] of Object.entries(helpers)) {\n handlebars.registerHelper(name, fn);\n}\n\n// Export helper names derived from the same source used to register them\nexport const templateHelperNames = Object.keys(helpers) as readonly string[];\n\n/**\n * Config options whose **values** are exposed as template variables.\n * e.g. `groupName` is in this list because you can write `{{groupName}}` inside a template.\n * This is distinct from `supportsTemplating`, which marks options whose values\n * are themselves *compiled* as Handlebars templates via `template.compile()`.\n */\nexport const exposedConfigOptions = [\n 'additionalBranchPrefix',\n 'addLabels',\n 'allowedVersions',\n 'branchName',\n 'branchPrefix',\n 'branchTopic',\n 'commitBody',\n 'commitMessage',\n 'commitMessageAction',\n 'commitMessageExtra',\n 'commitMessagePrefix',\n 'commitMessageSuffix',\n 'commitMessageTopic',\n 'gitAuthor',\n 'group',\n 'groupName',\n 'groupSlug',\n 'labels',\n 'prBodyColumns',\n 'prBodyDefinitions',\n 'prBodyNotes',\n 'prTitle',\n 'semanticCommitScope',\n 'semanticCommitType',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMinor',\n 'sourceDirectory',\n];\n\n/**\n * Runtime-generated fields available as template variables.\n * These are not config options — they are computed during Renovate's run\n * (e.g. `depName`, `newVersion`, `isMajor`) and made available in templates.\n */\nexport const allowedFields = {\n baseBranch: 'The baseBranch for this branch/PR',\n body: 'The body of the release notes',\n categories: 'The categories of the manager of the dependency being updated',\n currentValue: 'The extracted current value of the dependency being updated',\n currentVersion:\n 'The version that would be currently installed. For example, if currentValue is ^3.0.0 then currentVersion might be 3.1.0.',\n currentVersionAgeInDays: 'The age of the current version in days',\n currentVersionTimestamp: 'The timestamp of the current version',\n currentDigest: 'The extracted current digest of the dependency being updated',\n currentDigestShort:\n 'The extracted current short digest of the dependency being updated',\n datasource: 'The datasource used to look up the upgrade',\n depName: 'The name of the dependency being updated',\n depNameLinked:\n 'The dependency name already linked to its home page using markdown',\n depNameSanitized:\n 'The depName field sanitized for use in branches after removing spaces and special characters',\n depType: 'The dependency type (if extracted - manager-dependent)',\n depTypes:\n 'A deduplicated array of dependency types (if extracted - manager-dependent) in a branch',\n displayFrom: 'The current value, formatted for display',\n displayPending: 'Latest pending update, if internalChecksFilter is in use',\n displayTo: 'The to value, formatted for display',\n hasReleaseNotes: 'true if the upgrade has release notes',\n indentation: 'The indentation of the dependency being updated',\n isGroup: 'true if the upgrade is part of a group',\n isLockfileUpdate: 'true if the branch is a lock file update',\n isMajor: 'true if the upgrade is major',\n isMinor: 'true if the upgrade is minor',\n isPatch: 'true if the upgrade is a patch upgrade',\n isPin: 'true if the upgrade is pinning dependencies',\n isPinDigest: 'true if the upgrade is pinning digests',\n isRollback: 'true if the upgrade is a rollback PR',\n isReplacement: 'true if the upgrade is a replacement',\n isRange: 'true if the new value is a range',\n isSingleVersion:\n 'true if the upgrade is to a single version rather than a range',\n isVulnerabilityAlert: 'true if the upgrade is a vulnerability alert',\n logJSON: 'ChangeLogResult object for the upgrade',\n manager: 'The (package) manager which detected the dependency',\n newDigest: 'The new digest value',\n newDigestShort:\n 'A shortened version of newDigest, for use when the full digest is too long to be conveniently displayed',\n newMajor:\n 'The major version of the new version. e.g. \"3\" if the new version is \"3.1.0\"',\n newMinor:\n 'The minor version of the new version. e.g. \"1\" if the new version is \"3.1.0\"',\n newPatch:\n 'The patch version of the new version. e.g. \"0\" if the new version is \"3.1.0\"',\n newName:\n 'The name of the new dependency that replaces the current deprecated dependency',\n newNameLinked:\n 'The new dependency name already linked to its home page using markdown',\n newValue:\n 'The new value in the upgrade. Can be a range or version e.g. \"^3.0.0\" or \"3.1.0\"',\n newVersion: 'The new version in the upgrade, e.g. \"3.1.0\"',\n newVersionAgeInDays: 'The age of the new version in days',\n major:\n 'The major version of the current version. e.g. \"3\" if the current version is \"3.1.0\"',\n minor:\n 'The minor version of the current version. e.g. \"1\" if the current version is \"3.1.0\"',\n patch:\n 'The patch version of the current version. e.g. \"0\" if the current version is \"3.1.0\"',\n packageFile: 'The filename that the dependency was found in',\n packageFileDir:\n 'The directory with full path where the packageFile was found',\n packageName: 'The full name that was used to look up the dependency',\n packageScope: 'The scope of the package name. Supports Maven group ID only',\n parentDir:\n 'The name of the directory that the dependency was found in, without full path',\n parentOrg: 'The name of the parent organization for the current repository',\n platform: 'VCS platform in use, e.g. \"github\", \"gitlab\", etc.',\n prettyDepType: 'Massaged depType',\n prettyNewMajor: 'The new major value with v prepended to it.',\n prettyNewVersion: 'The new version value with v prepended to it.',\n project: 'ChangeLogProject object',\n recreateClosed: 'If true, this PR will be recreated if closed',\n references: 'A list of references for the upgrade',\n releases: 'An array of releases for an upgrade',\n releaseNotes: 'A ChangeLogNotes object for the release',\n releaseTimestamp: 'The timestamp of the release',\n renovateVersion: 'The currently running Renovate version.',\n repository: 'The current repository',\n semanticPrefix: 'The fully generated semantic prefix for commit messages',\n sourceRepo: 'The repository in the sourceUrl, if present',\n sourceRepoName: 'The repository name in the sourceUrl, if present',\n sourceRepoOrg: 'The repository organization in the sourceUrl, if present',\n sourceRepoSlug: 'The slugified pathname of the sourceUrl, if present',\n sourceUrl: 'The source URL for the package',\n topLevelOrg:\n 'The name of the top-level organization for the current repository',\n updateType:\n 'One of digest, pin, rollback, patch, minor, major, replacement, pinDigest',\n upgrades: 'An array of upgrade objects in the branch',\n url: 'The url of the release notes',\n version: 'The version number of the changelog',\n versioning: 'The versioning scheme in use',\n versions: 'An array of ChangeLogRelease objects in the upgrade',\n vulnerabilitySeverity:\n 'The severity for a vulnerability alert upgrade (LOW, MEDIUM, MODERATE, HIGH, CRITICAL, UNKNOWN)',\n};\n\ntype CompileInput<T = Record<string, unknown>> = T;\n\n/**\n * The complete set of field names that may be referenced inside a Handlebars template.\n * Union of runtime fields (`allowedFields`) and config options (`exposedConfigOptions`).\n * Used by the compile proxy to warn on unknown variable references.\n */\nconst allowedTemplateFields = new Set([\n ...Object.keys(allowedFields),\n ...exposedConfigOptions,\n]);\n\nclass CompileInputProxyHandler implements ProxyHandler<CompileInput> {\n private warnVariables: Set<string>;\n\n constructor(warnVariables: Set<string>) {\n this.warnVariables = warnVariables;\n }\n\n get(target: CompileInput, prop: keyof CompileInput): unknown {\n if (prop === 'env') {\n return target[prop];\n }\n\n if (!allowedTemplateFields.has(prop)) {\n this.warnVariables.add(prop);\n return undefined;\n }\n\n const value = target[prop];\n\n if (prop === 'prBodyDefinitions') {\n // Expose all prBodyDefinitions.*\n return value;\n }\n\n if (isArray(value)) {\n return value.map((element) =>\n isPrimitive(element)\n ? element\n : proxyCompileInput(element as CompileInput, this.warnVariables),\n );\n }\n\n if (isPlainObject(value)) {\n return proxyCompileInput(value, this.warnVariables);\n }\n\n return value;\n }\n}\n\nexport function proxyCompileInput(\n input: CompileInput,\n warnVariables: Set<string>,\n): CompileInput {\n return new Proxy<CompileInput>(\n input,\n new CompileInputProxyHandler(warnVariables),\n );\n}\n\nexport function compile<T>(\n template: string,\n input: CompileInput<T>,\n filterFields = true,\n): string {\n const env = getChildEnv({});\n const data = {\n ...GlobalConfig.get(),\n renovateVersion: pkg.version,\n ...input,\n env,\n };\n const warnVariables = new Set<string>();\n const filteredInput = filterFields\n ? proxyCompileInput(data, warnVariables)\n : data;\n\n logger.trace({ template, filteredInput }, 'Compiling template');\n const result = handlebars.compile(template, { noEscape: true })(\n filteredInput,\n );\n\n if (warnVariables.size > 0) {\n logger.info(\n { varNames: Array.from(warnVariables), template },\n 'Disallowed variable names in template',\n );\n }\n\n return result;\n}\n\nexport function safeCompile<T>(\n template: string,\n input: CompileInput<T>,\n filterFields = true,\n): string {\n try {\n return compile(template, input, filterFields);\n } catch (err) {\n logger.warn({ err, template }, 'Error compiling template');\n return '';\n }\n}\n\n/**\n * Validate that the template is a valid Handlebars template string.\n *\n * NOTE: Does not validate that fields are set to valid field names.\n */\nexport function validate(template: string): void {\n handlebars.parse(template);\n}\n"],"mappings":";;;;;;;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AO,IAAI,MACT,OACA,IAAI,yBAAyB,aAAa,CAC5C;AACF;AAEA,SAAgB,QACd,UACA,OACA,eAAe,MACP;CACR,MAAM,MAAM,YAAY,CAAC,CAAC;CAC1B,MAAM,OAAO;EACX,GAAG,aAAa,IAAI;EACpB,iBAAiB,IAAI;EACrB,GAAG;EACH;CACF;CACA,MAAM,gCAAgB,IAAI,IAAY;CACtC,MAAM,gBAAgB,eAClB,kBAAkB,MAAM,aAAa,IACrC;CAEJ,OAAO,MAAM;EAAE;EAAU;CAAc,GAAG,oBAAoB;CAC9D,MAAM,SAAS,WAAW,QAAQ,UAAU,EAAE,UAAU,KAAK,CAAC,CAAC,CAC7D,aACF;CAEA,IAAI,cAAc,OAAO,GACvB,OAAO,KACL;EAAE,UAAU,MAAM,KAAK,aAAa;EAAG;CAAS,GAChD,uCACF;CAGF,OAAO;AACT;AAEA,SAAgB,YACd,UACA,OACA,eAAe,MACP;CACR,IAAI;EACF,OAAO,QAAQ,UAAU,OAAO,YAAY;CAC9C,SAAS,KAAK;EACZ,OAAO,KAAK;GAAE;GAAK;EAAS,GAAG,0BAA0B;EACzD,OAAO;CACT;AACF;;;;;;AAOA,SAAgB,SAAS,UAAwB;CAC/C,WAAW,MAAM,QAAQ;AAC3B"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../lib/util/template/index.ts"],"sourcesContent":["import {\n isArray,\n isNumber,\n isPlainObject,\n isPrimitive,\n isString,\n} from '@sindresorhus/is';\nimport handlebars, { type HelperOptions } from 'handlebars';\nimport { GlobalConfig } from '../../config/global.ts';\nimport { pkg } from '../../expose.ts';\nimport { logger } from '../../logger/index.ts';\nimport { toArray } from '../array.ts';\nimport { getChildEnv } from '../exec/utils.ts';\nimport { regEx } from '../regex.ts';\n\n// Missing in handlebars\ntype Options = HelperOptions & {\n lookupProperty: (element: unknown, key: unknown) => unknown;\n};\n\nconst helpers: Record<string, handlebars.HelperDelegate> = {\n encodeURIComponent,\n decodeURIComponent,\n encodeBase64: (str: string) => Buffer.from(str ?? '').toString('base64'),\n decodeBase64: (str: string) => Buffer.from(str ?? '', 'base64').toString(),\n stringToPrettyJSON: (input: string): string =>\n JSON.stringify(JSON.parse(input), null, 2),\n toJSON: (input: unknown): string => JSON.stringify(input),\n toArray: (...args: unknown[]): unknown[] => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args;\n },\n toObject: (...args: unknown[]): unknown => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n\n if (args.length % 2 !== 0) {\n throw new Error(`Must contain an even number of elements`);\n }\n\n const keys = args.filter((_, index) => index % 2 === 0);\n const values = args.filter((_, index) => index % 2 === 1);\n\n return Object.fromEntries(keys.map((key, index) => [key, values[index]]));\n },\n replace: (find, replace, context) =>\n (context ?? '').replace(regEx(find, 'g'), replace),\n lowercase: (str: string) => str?.toLowerCase(),\n uppercase: (str: string) => str?.toUpperCase(),\n containsString: (str, subStr) => str?.includes(subStr),\n equals: (arg1, arg2) => arg1 === arg2,\n includes: (arg1: string[], arg2: string) => {\n if (isArray(arg1, isString) && isString(arg2)) {\n return arg1.includes(arg2);\n }\n return false;\n },\n split: (str: unknown, separator: unknown): string[] => {\n if (isString(str) && isString(separator)) {\n return str.split(separator);\n }\n return [];\n },\n and: (...args: unknown[]) => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args.every(Boolean);\n },\n or: (...args: unknown[]) => {\n // Need to remove the 'options', as the last parameter\n // https://handlebarsjs.com/api-reference/helpers.html\n args.pop();\n return args.some(Boolean);\n },\n lookupArray: (obj: unknown, key: unknown, options: Options): unknown[] => {\n return (\n toArray(obj)\n // skip elements like #with does\n .filter((element) => !handlebars.Utils.isEmpty(element))\n .map((element) => options.lookupProperty(element, key))\n .filter((value) => value !== undefined)\n );\n },\n distinct: (obj: unknown): unknown[] => {\n const seen = new Set<string>();\n\n return toArray(obj).filter((value) => {\n const str = JSON.stringify(value);\n\n if (seen.has(str)) {\n return false;\n }\n\n seen.add(str);\n return true;\n });\n },\n add: (a, b) => {\n if (isNumber(a) && isNumber(b)) {\n return a + b;\n }\n\n throw new Error('add: inputs are not valid');\n },\n};\n\n// Register all helpers from the single source of truth\nfor (const [name, fn] of Object.entries(helpers)) {\n handlebars.registerHelper(name, fn);\n}\n\n// Export helper names derived from the same source used to register them\nexport const templateHelperNames = Object.keys(helpers) as readonly string[];\n\n/**\n * Config options whose **values** are exposed as template variables.\n * e.g. `groupName` is in this list because you can write `{{groupName}}` inside a template.\n * This is distinct from `supportsTemplating`, which marks options whose values\n * are themselves *compiled* as Handlebars templates via `template.compile()`.\n */\nexport const exposedConfigOptions = [\n 'additionalBranchPrefix',\n 'addLabels',\n 'allowedVersions',\n 'branchName',\n 'branchPrefix',\n 'branchTopic',\n 'commitBody',\n 'commitMessage',\n 'commitMessageAction',\n 'commitMessageExtra',\n 'commitMessagePrefix',\n 'commitMessageSuffix',\n 'commitMessageTopic',\n 'gitAuthor',\n 'group',\n 'groupName',\n 'groupSlug',\n 'labels',\n 'prBodyColumns',\n 'prBodyDefinitions',\n 'prBodyNotes',\n 'prTitle',\n 'semanticCommitScope',\n 'semanticCommitType',\n 'separateMajorMinor',\n 'separateMinorPatch',\n 'separateMultipleMinor',\n 'sourceDirectory',\n];\n\n/**\n * Runtime-generated fields available as template variables.\n * These are not config options — they are computed during Renovate's run\n * (e.g. `depName`, `newVersion`, `isMajor`) and made available in templates.\n */\nexport const allowedFields = {\n baseBranch: 'The baseBranch for this branch/PR',\n body: 'The body of the release notes',\n categories: 'The categories of the manager of the dependency being updated',\n currentValue: 'The extracted current value of the dependency being updated',\n currentVersion:\n 'The version that would be currently installed. For example, if currentValue is ^3.0.0 then currentVersion might be 3.1.0.',\n currentVersionAgeInDays: 'The age of the current version in days',\n currentVersionTimestamp: 'The timestamp of the current version',\n currentDigest: 'The extracted current digest of the dependency being updated',\n currentDigestShort:\n 'The extracted current short digest of the dependency being updated',\n datasource: 'The datasource used to look up the upgrade',\n depName: 'The name of the dependency being updated',\n depNameLinked:\n 'The dependency name already linked to its home page using markdown',\n depNameSanitized:\n 'The depName field sanitized for use in branches after removing spaces and special characters',\n depType: 'The dependency type (if extracted - manager-dependent)',\n depTypes:\n 'A deduplicated array of dependency types (if extracted - manager-dependent) in a branch',\n displayFrom: 'The current value, formatted for display',\n displayPending: 'Latest pending update, if internalChecksFilter is in use',\n displayTo: 'The to value, formatted for display',\n effectiveDatasource:\n 'The datasources used to fetch releases after delegation',\n hasReleaseNotes: 'true if the upgrade has release notes',\n indentation: 'The indentation of the dependency being updated',\n isGroup: 'true if the upgrade is part of a group',\n isLockfileUpdate: 'true if the branch is a lock file update',\n isMajor: 'true if the upgrade is major',\n isMinor: 'true if the upgrade is minor',\n isPatch: 'true if the upgrade is a patch upgrade',\n isPin: 'true if the upgrade is pinning dependencies',\n isPinDigest: 'true if the upgrade is pinning digests',\n isRollback: 'true if the upgrade is a rollback PR',\n isReplacement: 'true if the upgrade is a replacement',\n isRange: 'true if the new value is a range',\n isSingleVersion:\n 'true if the upgrade is to a single version rather than a range',\n isVulnerabilityAlert: 'true if the upgrade is a vulnerability alert',\n logJSON: 'ChangeLogResult object for the upgrade',\n manager: 'The (package) manager which detected the dependency',\n newDigest: 'The new digest value',\n newDigestShort:\n 'A shortened version of newDigest, for use when the full digest is too long to be conveniently displayed',\n newMajor:\n 'The major version of the new version. e.g. \"3\" if the new version is \"3.1.0\"',\n newMinor:\n 'The minor version of the new version. e.g. \"1\" if the new version is \"3.1.0\"',\n newPatch:\n 'The patch version of the new version. e.g. \"0\" if the new version is \"3.1.0\"',\n newName:\n 'The name of the new dependency that replaces the current deprecated dependency',\n newNameLinked:\n 'The new dependency name already linked to its home page using markdown',\n newValue:\n 'The new value in the upgrade. Can be a range or version e.g. \"^3.0.0\" or \"3.1.0\"',\n newVersion: 'The new version in the upgrade, e.g. \"3.1.0\"',\n newVersionAgeInDays: 'The age of the new version in days',\n major:\n 'The major version of the current version. e.g. \"3\" if the current version is \"3.1.0\"',\n minor:\n 'The minor version of the current version. e.g. \"1\" if the current version is \"3.1.0\"',\n patch:\n 'The patch version of the current version. e.g. \"0\" if the current version is \"3.1.0\"',\n packageFile: 'The filename that the dependency was found in',\n packageFileDir:\n 'The directory with full path where the packageFile was found',\n packageName: 'The full name that was used to look up the dependency',\n packageScope: 'The scope of the package name. Supports Maven group ID only',\n parentDir:\n 'The name of the directory that the dependency was found in, without full path',\n parentOrg: 'The name of the parent organization for the current repository',\n platform: 'VCS platform in use, e.g. \"github\", \"gitlab\", etc.',\n prettyDepType: 'Massaged depType',\n prettyNewMajor: 'The new major value with v prepended to it.',\n prettyNewVersion: 'The new version value with v prepended to it.',\n project: 'ChangeLogProject object',\n recreateClosed: 'If true, this PR will be recreated if closed',\n references: 'A list of references for the upgrade',\n releases: 'An array of releases for an upgrade',\n releaseNotes: 'A ChangeLogNotes object for the release',\n releaseTimestamp: 'The timestamp of the release',\n renovateVersion: 'The currently running Renovate version.',\n repository: 'The current repository',\n semanticPrefix: 'The fully generated semantic prefix for commit messages',\n sourceRepo: 'The repository in the sourceUrl, if present',\n sourceRepoName: 'The repository name in the sourceUrl, if present',\n sourceRepoOrg: 'The repository organization in the sourceUrl, if present',\n sourceRepoSlug: 'The slugified pathname of the sourceUrl, if present',\n sourceUrl: 'The source URL for the package',\n topLevelOrg:\n 'The name of the top-level organization for the current repository',\n updateType:\n 'One of digest, pin, rollback, patch, minor, major, replacement, pinDigest',\n upgrades: 'An array of upgrade objects in the branch',\n url: 'The url of the release notes',\n version: 'The version number of the changelog',\n versioning: 'The versioning scheme in use',\n versions: 'An array of ChangeLogRelease objects in the upgrade',\n vulnerabilitySeverity:\n 'The severity for a vulnerability alert upgrade (LOW, MEDIUM, MODERATE, HIGH, CRITICAL, UNKNOWN)',\n};\n\ntype CompileInput<T = Record<string, unknown>> = T;\n\n/**\n * The complete set of field names that may be referenced inside a Handlebars template.\n * Union of runtime fields (`allowedFields`) and config options (`exposedConfigOptions`).\n * Used by the compile proxy to warn on unknown variable references.\n */\nconst allowedTemplateFields = new Set([\n ...Object.keys(allowedFields),\n ...exposedConfigOptions,\n]);\n\nclass CompileInputProxyHandler implements ProxyHandler<CompileInput> {\n private warnVariables: Set<string>;\n\n constructor(warnVariables: Set<string>) {\n this.warnVariables = warnVariables;\n }\n\n get(target: CompileInput, prop: keyof CompileInput): unknown {\n if (prop === 'env') {\n return target[prop];\n }\n\n if (!allowedTemplateFields.has(prop)) {\n this.warnVariables.add(prop);\n return undefined;\n }\n\n const value = target[prop];\n\n if (prop === 'prBodyDefinitions') {\n // Expose all prBodyDefinitions.*\n return value;\n }\n\n if (isArray(value)) {\n return value.map((element) =>\n isPrimitive(element)\n ? element\n : proxyCompileInput(element as CompileInput, this.warnVariables),\n );\n }\n\n if (isPlainObject(value)) {\n return proxyCompileInput(value, this.warnVariables);\n }\n\n return value;\n }\n}\n\nexport function proxyCompileInput(\n input: CompileInput,\n warnVariables: Set<string>,\n): CompileInput {\n return new Proxy<CompileInput>(\n input,\n new CompileInputProxyHandler(warnVariables),\n );\n}\n\nexport function compile<T>(\n template: string,\n input: CompileInput<T>,\n filterFields = true,\n): string {\n const env = getChildEnv({});\n const data = {\n ...GlobalConfig.get(),\n renovateVersion: pkg.version,\n ...input,\n env,\n };\n const warnVariables = new Set<string>();\n const filteredInput = filterFields\n ? proxyCompileInput(data, warnVariables)\n : data;\n\n logger.trace({ template, filteredInput }, 'Compiling template');\n const result = handlebars.compile(template, { noEscape: true })(\n filteredInput,\n );\n\n if (warnVariables.size > 0) {\n logger.info(\n { varNames: Array.from(warnVariables), template },\n 'Disallowed variable names in template',\n );\n }\n\n return result;\n}\n\nexport function safeCompile<T>(\n template: string,\n input: CompileInput<T>,\n filterFields = true,\n): string {\n try {\n return compile(template, input, filterFields);\n } catch (err) {\n logger.warn({ err, template }, 'Error compiling template');\n return '';\n }\n}\n\n/**\n * Validate that the template is a valid Handlebars template string.\n *\n * NOTE: Does not validate that fields are set to valid field names.\n */\nexport function validate(template: string): void {\n handlebars.parse(template);\n}\n"],"mappings":";;;;;;;;;AAoBA,MAAM,UAAqD;CACzD;CACA;CACA,eAAe,QAAgB,OAAO,KAAK,OAAO,EAAE,CAAC,CAAC,SAAS,QAAQ;CACvE,eAAe,QAAgB,OAAO,KAAK,OAAO,IAAI,QAAQ,CAAC,CAAC,SAAS;CACzE,qBAAqB,UACnB,KAAK,UAAU,KAAK,MAAM,KAAK,GAAG,MAAM,CAAC;CAC3C,SAAS,UAA2B,KAAK,UAAU,KAAK;CACxD,UAAU,GAAG,SAA+B;EAG1C,KAAK,IAAI;EACT,OAAO;CACT;CACA,WAAW,GAAG,SAA6B;EAGzC,KAAK,IAAI;EAET,IAAI,KAAK,SAAS,MAAM,GACtB,MAAM,IAAI,MAAM,yCAAyC;EAG3D,MAAM,OAAO,KAAK,QAAQ,GAAG,UAAU,QAAQ,MAAM,CAAC;EACtD,MAAM,SAAS,KAAK,QAAQ,GAAG,UAAU,QAAQ,MAAM,CAAC;EAExD,OAAO,OAAO,YAAY,KAAK,KAAK,KAAK,UAAU,CAAC,KAAK,OAAO,MAAM,CAAC,CAAC;CAC1E;CACA,UAAU,MAAM,SAAS,aACtB,WAAW,GAAA,CAAI,QAAQ,MAAM,MAAM,GAAG,GAAG,OAAO;CACnD,YAAY,QAAgB,KAAK,YAAY;CAC7C,YAAY,QAAgB,KAAK,YAAY;CAC7C,iBAAiB,KAAK,WAAW,KAAK,SAAS,MAAM;CACrD,SAAS,MAAM,SAAS,SAAS;CACjC,WAAW,MAAgB,SAAiB;EAC1C,IAAI,QAAQ,MAAM,QAAQ,KAAK,SAAS,IAAI,GAC1C,OAAO,KAAK,SAAS,IAAI;EAE3B,OAAO;CACT;CACA,QAAQ,KAAc,cAAiC;EACrD,IAAI,SAAS,GAAG,KAAK,SAAS,SAAS,GACrC,OAAO,IAAI,MAAM,SAAS;EAE5B,OAAO,CAAC;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IAAI,cAAc,KAAK,GACrB,OAAO,kBAAkB,OAAO,KAAK,aAAa;EAGpD,OAAO;CACT;AACF;AAEA,SAAgB,kBACd,OACA,eACc;CACd,OAAO,IAAI,MACT,OACA,IAAI,yBAAyB,aAAa,CAC5C;AACF;AAEA,SAAgB,QACd,UACA,OACA,eAAe,MACP;CACR,MAAM,MAAM,YAAY,CAAC,CAAC;CAC1B,MAAM,OAAO;EACX,GAAG,aAAa,IAAI;EACpB,iBAAiB,IAAI;EACrB,GAAG;EACH;CACF;CACA,MAAM,gCAAgB,IAAI,IAAY;CACtC,MAAM,gBAAgB,eAClB,kBAAkB,MAAM,aAAa,IACrC;CAEJ,OAAO,MAAM;EAAE;EAAU;CAAc,GAAG,oBAAoB;CAC9D,MAAM,SAAS,WAAW,QAAQ,UAAU,EAAE,UAAU,KAAK,CAAC,CAAC,CAC7D,aACF;CAEA,IAAI,cAAc,OAAO,GACvB,OAAO,KACL;EAAE,UAAU,MAAM,KAAK,aAAa;EAAG;CAAS,GAChD,uCACF;CAGF,OAAO;AACT;AAEA,SAAgB,YACd,UACA,OACA,eAAe,MACP;CACR,IAAI;EACF,OAAO,QAAQ,UAAU,OAAO,YAAY;CAC9C,SAAS,KAAK;EACZ,OAAO,KAAK;GAAE;GAAK;EAAS,GAAG,0BAA0B;EACzD,OAAO;CACT;AACF;;;;;;AAOA,SAAgB,SAAS,UAAwB;CAC/C,WAAW,MAAM,QAAQ;AAC3B"}
|
|
@@ -103,6 +103,7 @@ async function lookupUpdates(inconfig) {
|
|
|
103
103
|
"deprecationMessage",
|
|
104
104
|
"sourceUrl",
|
|
105
105
|
"registryUrl",
|
|
106
|
+
"effectiveDatasource",
|
|
106
107
|
"sourceDirectory",
|
|
107
108
|
"homepage",
|
|
108
109
|
"changelogUrl",
|
|
@@ -126,7 +127,8 @@ async function lookupUpdates(inconfig) {
|
|
|
126
127
|
}
|
|
127
128
|
config = await applyPackageRules({
|
|
128
129
|
...config,
|
|
129
|
-
sourceUrl: res.sourceUrl
|
|
130
|
+
sourceUrl: res.sourceUrl,
|
|
131
|
+
effectiveDatasource: res.effectiveDatasource
|
|
130
132
|
}, "source-url");
|
|
131
133
|
if (config.followTag) {
|
|
132
134
|
const taggedVersion = dependency.tags?.[config.followTag];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["allVersioning.get"],"sources":["../../../../../lib/workers/repository/process/lookup/index.ts"],"sourcesContent":["import { isNonEmptyString, isString, isUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport type { ValidationMessage } from '../../../../config/types.ts';\nimport { CONFIG_VALIDATION } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n getDatasourceFor,\n getDefaultVersioning,\n} from '../../../../modules/datasource/common.ts';\nimport type {\n Release,\n ReleaseResult,\n} from '../../../../modules/datasource/index.ts';\nimport {\n applyDatasourceFilters,\n getRawPkgReleases,\n isGetPkgReleasesConfig,\n supportsDigests,\n} from '../../../../modules/datasource/index.ts';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release.ts';\nimport { isPseudoVersion } from '../../../../modules/versioning/gomod/index.ts';\nimport * as allVersioning from '../../../../modules/versioning/index.ts';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error.ts';\nimport { assignKeys } from '../../../../util/assign-keys.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { applyPackageRules } from '../../../../util/package-rules/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { Result } from '../../../../util/result.ts';\nimport { safeStringify } from '../../../../util/stringify.ts';\nimport type { Timestamp } from '../../../../util/timestamp.ts';\nimport { calculateAbandonment } from './abandonment.ts';\nimport { groupReleasesIntoBuckets } from './bucket.ts';\nimport { getNewestMatchingVersion, resolveCurrentVersion } from './current.ts';\nimport type { DigestLikeUpdate } from './digest.ts';\nimport {\n applyMinimumReleaseAgeToDigestUpdate,\n couldApplyMinimumReleaseAgeToDigest,\n resolveUpdateDigests,\n} from './digest.ts';\nimport { filterVersions } from './filter.ts';\nimport { filterInternalChecks } from './filter-checks.ts';\nimport { generateUpdate } from './generate.ts';\nimport { resolveRangeStrategy } from './range-strategy.ts';\nimport { getRollbackUpdate } from './rollback.ts';\nimport { calculateMostRecentTimestamp } from './timestamps.ts';\nimport type { LookupUpdateConfig, UpdateResult } from './types.ts';\nimport {\n addReplacementUpdateIfValid,\n isReplacementRulesConfigured,\n stripNoopUpdates,\n} from './utils.ts';\nimport {\n matchVersionCompatibility,\n restoreVersionCompatibility,\n} from './version-compatibility.ts';\nimport { applyVulnerabilityFixFilter } from './vulnerability.ts';\n\nasync function getTimestamp(\n config: LookupUpdateConfig,\n versions: Release[],\n version: string,\n versioningApi: allVersioning.VersioningApi,\n): Promise<Timestamp | null | undefined> {\n const currentRelease = versions.find(\n (v) =>\n versioningApi.isValid(v.version) &&\n versioningApi.equals(v.version, version),\n );\n\n if (!currentRelease) {\n return null;\n }\n\n if (currentRelease.releaseTimestamp) {\n return currentRelease.releaseTimestamp;\n }\n\n const remoteRelease = await postprocessRelease(config, currentRelease);\n return remoteRelease?.releaseTimestamp;\n}\n\nexport async function lookupUpdates(\n inconfig: LookupUpdateConfig,\n): Promise<Result<UpdateResult>> {\n let config: LookupUpdateConfig = { ...inconfig };\n config.versioning ??= getDefaultVersioning(config.datasource);\n\n const versioningApi = allVersioning.get(config.versioning);\n\n let dependency: ReleaseResult | null = null;\n const res: UpdateResult = {\n versioning: config.versioning,\n updates: [],\n warnings: [],\n };\n // Timestamp of the release a `digest`/`pinDigest` update's current value currently resolves to (the newest version matching it, regardless of `rangeStrategy`), as opposed to `res.currentVersionTimestamp` which tracks whatever the configured rangeStrategy resolves `currentVersion` to (e.g. the oldest for `bump`)\n let newestMatchingVersionTimestamp: Timestamp | null | undefined;\n // The `digest` update for `config.currentDigest` (if one is added), so its age check can run after `newDigest` is fetched and no-op updates are stripped.\n let digestUpdate: DigestLikeUpdate | undefined;\n\n try {\n logger.trace(\n {\n dependency: config.packageName,\n currentValue: config.currentValue,\n },\n 'lookupUpdates',\n );\n if (config.currentValue && !isString(config.currentValue)) {\n // If currentValue is not a string, then it's invalid\n logger.debug(\n `Invalid currentValue for ${config.packageName}: ${safeStringify(config.currentValue)} (${typeof config.currentValue})`,\n );\n res.skipReason = 'invalid-value';\n return Result.ok(res);\n }\n if (!isGetPkgReleasesConfig(config)) {\n res.skipReason = 'invalid-config';\n return Result.ok(res);\n }\n if (!getDatasourceFor(config.datasource)) {\n res.skipReason = 'invalid-config';\n res.warnings.push({\n topic: config.packageName,\n message: `Unknown datasource \"${config.datasource}\" for package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n let compareValue =\n config.isLockfileOnly && config.lockedVersion\n ? config.lockedVersion\n : config.currentValue;\n const versionCompatibilityMatch = matchVersionCompatibility(config);\n if (versionCompatibilityMatch) {\n compareValue = versionCompatibilityMatch.compareValue;\n config.currentCompatibility =\n versionCompatibilityMatch.currentCompatibility;\n res.currentCompatibility = versionCompatibilityMatch.currentCompatibility;\n }\n\n const isValid =\n isString(compareValue) && versioningApi.isValid(compareValue);\n\n const unconstrainedValue =\n !!config.lockedVersion && isUndefined(config.currentValue);\n\n if (isValid || unconstrainedValue) {\n if (\n !config.updatePinnedDependencies &&\n !config.isLockfileOnly &&\n // TODO #22198\n versioningApi.isSingleVersion(compareValue!)\n ) {\n res.skipReason = 'is-pinned';\n return Result.ok(res);\n }\n\n const { val: releaseResult, err: lookupError } = await getRawPkgReleases(\n config,\n )\n .transform((res) => calculateMostRecentTimestamp(versioningApi, res))\n .transform((res) => calculateAbandonment(res, config))\n .transform((res) => applyDatasourceFilters(res, config))\n .unwrap();\n\n if (lookupError instanceof Error) {\n throw lookupError;\n }\n\n if (lookupError) {\n // If dependency lookup fails then warn and return\n const warning: ValidationMessage = {\n topic: config.packageName,\n message: `Failed to look up ${config.datasource} package ${config.packageName}: ${lookupError}`,\n };\n logger.debug(\n {\n dependency: config.packageName,\n packageFile: config.packageFile,\n },\n warning.message,\n );\n // TODO: return warnings in own field\n res.warnings.push(warning);\n return Result.ok(res);\n }\n\n dependency = releaseResult;\n\n if (dependency.deprecationMessage) {\n logger.debug(\n `Found deprecationMessage for ${config.datasource} package ${config.packageName}`,\n );\n }\n\n assignKeys(res, dependency, [\n 'deprecationMessage',\n 'sourceUrl',\n 'registryUrl',\n 'sourceDirectory',\n 'homepage',\n 'changelogUrl',\n 'dependencyUrl',\n 'lookupName',\n 'packageScope',\n 'mostRecentTimestamp',\n 'isAbandoned',\n 'respectLatest',\n ]);\n\n const latestVersion = dependency.tags?.latest;\n // Filter out any results from datasource that don't comply with our versioning\n let allVersions = dependency.releases.filter((release) =>\n versioningApi.isVersion(release.version),\n );\n const allReleaseVersions = new Set(allVersions.map((r) => r.version));\n // The datasources used in these tests always return at least one\n // version-like release, so neither this block nor the currentDigest\n // check inside it is reached. A lookup whose releases are all\n // unversioned tags does not get here either - with a digest configured\n // it takes the digest-only path above instead - see #40625\n // istanbul ignore if\n if (allVersions.length === 0) {\n const message = `Found no results from datasource that look like a version`;\n logger.info(\n {\n dependency: config.packageName,\n result: dependency,\n },\n message,\n );\n if (!config.currentDigest) {\n return Result.ok(res);\n }\n }\n // Reapply package rules in case we missed something from sourceUrl\n config = await applyPackageRules(\n { ...config, sourceUrl: res.sourceUrl },\n 'source-url',\n );\n if (config.followTag) {\n const taggedVersion = dependency.tags?.[config.followTag];\n if (!taggedVersion) {\n res.warnings.push({\n topic: config.packageName,\n message: `Can't find version with tag ${config.followTag} for ${config.datasource} package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n allVersions = allVersions.filter(\n (v) =>\n v.version === taggedVersion ||\n (v.version === compareValue &&\n versioningApi.isGreaterThan(taggedVersion, compareValue)),\n );\n }\n\n const inRangeOnlyStrategy = config.rangeStrategy === 'in-range-only';\n // Check that existing constraint can be satisfied\n const allSatisfyingVersions =\n (inRangeOnlyStrategy || config.rollbackPrs) && !unconstrainedValue\n ? allVersions.filter((v) =>\n // TODO #22198\n versioningApi.matches(v.version, compareValue!),\n )\n : allVersions;\n if (!allSatisfyingVersions.length) {\n logger.debug(\n `Found no satisfying versions with '${config.versioning}' versioning`,\n );\n }\n\n if (config.rollbackPrs && !allSatisfyingVersions.length) {\n const rollback = getRollbackUpdate(config, allVersions, versioningApi);\n // istanbul ignore if\n if (!rollback) {\n res.warnings.push({\n topic: config.packageName,\n // TODO: types (#22198)\n message: `Can't find version matching ${compareValue!} for ${\n config.datasource\n } package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n res.updates.push(rollback);\n }\n let rangeStrategy = resolveRangeStrategy(config);\n\n const currentVersion = resolveCurrentVersion(\n compareValue,\n config.lockedVersion,\n versioningApi,\n rangeStrategy,\n latestVersion,\n allVersions,\n );\n\n if (!currentVersion) {\n // v8 ignore else -- TODO: add test #40625\n if (!config.lockedVersion) {\n logger.debug(\n `No currentVersion or lockedVersion found for ${config.packageName}`,\n );\n res.skipReason = 'invalid-value';\n }\n return Result.ok(res);\n }\n\n res.currentVersion = currentVersion;\n\n // Use lockedVersion for the timestamp lookup when available, because\n // res.currentVersion is later overwritten to lockedVersion (see below).\n // Without this, strategies like \"replace\" would compute the timestamp\n // for the highest satisfying version (e.g. 1.4.1) while the reported\n // currentVersion ends up being the locked one (e.g. 1.0.0).\n const versionForTimestamp = config.lockedVersion ?? currentVersion;\n const currentVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n versionForTimestamp,\n versioningApi,\n );\n\n if (isNonEmptyString(currentVersionTimestamp)) {\n res.currentVersionTimestamp = currentVersionTimestamp;\n res.currentVersionAgeInDays = getElapsedDays(currentVersionTimestamp);\n\n if (\n config.packageRules?.some((rule) =>\n isNonEmptyString(rule.matchCurrentAge),\n )\n ) {\n // Reapply package rules to check matches for matchCurrentAge\n config = await applyPackageRules(\n { ...config, currentVersionTimestamp },\n 'current-timestamp',\n );\n }\n }\n\n if (\n config.currentDigest\n ? couldApplyMinimumReleaseAgeToDigest(config, 'digest')\n : config.pinDigests &&\n couldApplyMinimumReleaseAgeToDigest(config, 'pinDigest')\n ) {\n const newestMatchingVersion = getNewestMatchingVersion(\n compareValue,\n versioningApi,\n latestVersion,\n allVersions,\n );\n if (newestMatchingVersion) {\n newestMatchingVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n newestMatchingVersion,\n versioningApi,\n );\n }\n }\n\n if (\n compareValue &&\n currentVersion &&\n rangeStrategy === 'pin' &&\n !versioningApi.isSingleVersion(compareValue)\n ) {\n const newValue =\n versioningApi.getPinnedValue?.(currentVersion) ?? currentVersion;\n res.updates.push({\n updateType: 'pin',\n isPin: true,\n newValue,\n newVersion: currentVersion,\n newMajor: versioningApi.getMajor(currentVersion)!,\n });\n }\n if (rangeStrategy === 'pin') {\n // Fall back to replace once pinning logic is done\n rangeStrategy = 'replace';\n }\n // A non-version can only get this far via a locked version under\n // rangeStrategy=pin, but the timestamp lookup above calls `equals()` on\n // it first and throws - see #40625\n // istanbul ignore if\n if (!versioningApi.isVersion(currentVersion)) {\n res.skipReason = 'invalid-version';\n return Result.ok(res);\n }\n // Filter latest, unstable, etc\n // TODO #22198\n let filteredReleases = filterVersions(\n config,\n currentVersion,\n latestVersion!,\n inRangeOnlyStrategy ? allSatisfyingVersions : allVersions,\n versioningApi,\n ).filter((v) => {\n if (config.isLockfileOnly) {\n return true;\n }\n\n // Leave only compatible versions\n return (\n unconstrainedValue ||\n versioningApi.isCompatible(v.version, compareValue)\n );\n });\n const vulnerabilityFix = applyVulnerabilityFixFilter(\n config,\n res,\n versioningApi,\n filteredReleases,\n );\n filteredReleases = vulnerabilityFix.releases;\n const { shrinkedViaVulnerability } = vulnerabilityFix;\n\n const buckets = groupReleasesIntoBuckets(\n config,\n currentVersion,\n filteredReleases,\n versioningApi,\n );\n const depResultConfig = mergeChildConfig(config, res);\n for (const [bucket, releases] of Object.entries(buckets)) {\n const sortedReleases = releases.sort((r1, r2) =>\n versioningApi.sortVersions(r1.version, r2.version),\n );\n const { release, pendingChecks, pendingReleases } =\n await filterInternalChecks(\n depResultConfig,\n versioningApi,\n bucket,\n sortedReleases,\n );\n // `filterInternalChecks()` normally yields a release, falling back to\n // the newest pending one; only a datasource rejecting every candidate\n // during postprocessing leaves none - see #40625\n // istanbul ignore next\n if (!release) {\n return Result.ok(res);\n }\n const newVersion = release.version;\n const update = await generateUpdate(\n config,\n config.isLockfileOnly ? config.currentValue : compareValue,\n versioningApi,\n // TODO #22198\n\n rangeStrategy!,\n config.lockedVersion ?? currentVersion,\n bucket,\n release,\n allReleaseVersions,\n );\n\n // An update between two pseudo-versions of the same module changes the\n // commit and nothing else, so it is a digest update - see #29034\n if (\n config.manager === 'gomod' &&\n isPseudoVersion(compareValue) &&\n isPseudoVersion(update.newValue) &&\n config.currentDigest !== update.newDigest\n ) {\n update.updateType = 'digest';\n\n // As this has already been processed by `filterInternalChecks()`, but we're changing the `updateType`, we need to apply the digest-scoped minimumReleaseAge rules.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `update.updateType` never is here - true is a safe constant.\n await applyMinimumReleaseAgeToDigestUpdate(\n update as DigestLikeUpdate,\n config,\n res,\n true,\n release.releaseTimestamp,\n );\n }\n\n if (pendingChecks) {\n update.pendingChecks = pendingChecks;\n }\n\n if (pendingReleases.length) {\n update.pendingVersions = pendingReleases.map((r) => r.version);\n }\n if (!update.newValue || update.newValue === compareValue) {\n if (!config.lockedVersion) {\n continue;\n }\n // istanbul ignore if\n if (rangeStrategy === 'bump') {\n logger.trace(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n lockedVersion: config.lockedVersion,\n newVersion,\n },\n 'Skipping bump because newValue is the same',\n );\n continue;\n }\n res.isSingleVersion = true;\n }\n res.isSingleVersion ??=\n isString(update.newValue) &&\n versioningApi.isSingleVersion(update.newValue);\n // Nothing but a rollback should ever propose a lower version, so a\n // downgrade means the lookup went wrong and the update is dropped - see\n // #29921. A versioning which reports each value as greater than the\n // other has no order between them (e.g. aws-machine-image relies on the\n // datasource order), so no downgrade can be claimed.\n if (\n update.updateType !== 'rollback' &&\n update.newValue &&\n versioningApi.isVersion(update.newValue) &&\n compareValue &&\n versioningApi.isVersion(compareValue) &&\n versioningApi.isGreaterThan(compareValue, update.newValue) &&\n !versioningApi.isGreaterThan(update.newValue, compareValue)\n ) {\n logger.warn(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n compareValue,\n currentVersion: config.currentVersion,\n update,\n allVersionsLength: allVersions.length,\n filteredReleaseVersions: filteredReleases.map((r) => r.version),\n shrinkedViaVulnerability,\n },\n 'Unexpected downgrade detected: skipping',\n );\n } else {\n res.updates.push(update);\n }\n }\n } else if (compareValue) {\n logger.debug(\n `Dependency ${config.packageName} has unsupported/unversioned value ${compareValue} (versioning=${config.versioning})`,\n );\n\n if (!config.pinDigests && !config.currentDigest) {\n logger.debug(\n `Skipping ${config.packageName} because no currentDigest or pinDigests`,\n );\n res.skipReason = 'invalid-value';\n } else {\n delete res.skipReason;\n }\n } else {\n res.skipReason = 'invalid-value';\n }\n\n if (isReplacementRulesConfigured(config)) {\n addReplacementUpdateIfValid(res.updates, config);\n } else if (dependency?.replacementName && dependency.replacementVersion) {\n res.updates.push({\n updateType: 'replacement',\n newName: dependency.replacementName,\n newValue: dependency.replacementVersion,\n });\n }\n\n // Record if the dep is fixed to a version\n if (config.lockedVersion) {\n res.currentVersion = config.lockedVersion;\n res.fixedVersion = config.lockedVersion;\n } else if (compareValue && versioningApi.isSingleVersion(compareValue)) {\n res.fixedVersion = compareValue.replace(regEx(/^=+/), '');\n }\n\n // massage versionCompatibility\n restoreVersionCompatibility(config, compareValue, res.updates);\n\n // Add digests if necessary\n if (supportsDigests(config.datasource)) {\n if (config.currentDigest) {\n if (!config.digestOneAndOnly || !res.updates.length) {\n // digest update - age-checked after the strip below, once newDigest is known\n digestUpdate = {\n updateType: 'digest',\n newValue: config.currentValue,\n };\n res.updates.push(digestUpdate);\n }\n } else if (\n config.pinDigests &&\n // only update the digest in the package file if it's managed by us\n !config.digestManagedExternally &&\n // Create a pin only if one doesn't already exists\n // v8 ignore else -- TODO: add test #40625\n !res.updates.some((update) => update.updateType === 'pin')\n ) {\n // pin digest\n const pinDigestUpdate: DigestLikeUpdate = {\n isPinDigest: true,\n updateType: 'pinDigest',\n newValue: config.currentValue,\n };\n await applyMinimumReleaseAgeToDigestUpdate(\n pinDigestUpdate,\n config,\n res,\n isValid || unconstrainedValue,\n newestMatchingVersionTimestamp,\n );\n res.updates.push(pinDigestUpdate);\n }\n if (versioningApi.valueToVersion) {\n // TODO #22198\n res.currentVersion = versioningApi.valueToVersion(res.currentVersion!);\n for (const update of res.updates) {\n // TODO #22198\n update.newVersion = versioningApi.valueToVersion(update.newVersion!);\n }\n }\n if (res.registryUrl) {\n config.registryUrls = [res.registryUrl];\n }\n\n // update digest for all\n await resolveUpdateDigests(config, res, dependency);\n }\n\n if (res.updates.length) {\n delete res.skipReason;\n }\n // Strip out any non-changed ones\n res.updates = stripNoopUpdates(config, res.updates);\n\n // If there is a digest update proposed which is in the pending updates for this dependency, ensure that `minimumReleaseAge` is applied.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `digestUpdate` never is - true is a safe constant.\n if (digestUpdate && res.updates.includes(digestUpdate)) {\n await applyMinimumReleaseAgeToDigestUpdate(\n digestUpdate,\n config,\n res,\n true,\n newestMatchingVersionTimestamp,\n );\n }\n\n const release =\n res.updates.length > 0\n ? (dependency?.releases.find(\n (r) => r.version === res.updates[0].newValue,\n ) ??\n dependency?.releases.find(\n (r) => r.version === res.updates[0].newVersion,\n ))\n : null;\n\n if (release?.changelogContent) {\n res.changelogContent = release.changelogContent;\n res.changelogUrl = release.changelogUrl;\n }\n } catch (err) /* istanbul ignore next */ {\n if (err instanceof ExternalHostError) {\n return Result.err(err);\n }\n\n if (err instanceof Error && err.message === CONFIG_VALIDATION) {\n return Result.err(err);\n }\n\n logger.error(\n {\n currentDigest: config.currentDigest,\n currentValue: config.currentValue,\n datasource: config.datasource,\n packageName: config.packageName,\n digestOneAndOnly: config.digestOneAndOnly,\n followTag: config.followTag,\n lockedVersion: config.lockedVersion,\n packageFile: config.packageFile,\n pinDigests: config.pinDigests,\n rollbackPrs: config.rollbackPrs,\n isVulnerabilityAlert: config.isVulnerabilityAlert,\n updatePinnedDependencies: config.updatePinnedDependencies,\n err,\n },\n 'lookupUpdates error',\n );\n res.skipReason = 'internal-error';\n }\n return Result.ok(res);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,eAAe,aACb,QACA,UACA,SACA,eACuC;CACvC,MAAM,iBAAiB,SAAS,MAC7B,MACC,cAAc,QAAQ,EAAE,OAAO,KAC/B,cAAc,OAAO,EAAE,SAAS,OAAO,CAC3C;CAEA,IAAI,CAAC,gBACH,OAAO;CAGT,IAAI,eAAe,kBACjB,OAAO,eAAe;CAIxB,QAAO,MADqB,mBAAmB,QAAQ,cAAc,EAAA,EAC/C;AACxB;AAEA,eAAsB,cACpB,UAC+B;CAC/B,IAAI,SAA6B,EAAE,GAAG,SAAS;CAC/C,OAAO,eAAe,qBAAqB,OAAO,UAAU;CAE5D,MAAM,gBAAgBA,IAAkB,OAAO,UAAU;CAEzD,IAAI,aAAmC;CACvC,MAAM,MAAoB;EACxB,YAAY,OAAO;EACnB,SAAS,CAAC;EACV,UAAU,CAAC;CACb;CAEA,IAAI;CAEJ,IAAI;CAEJ,IAAI;EACF,OAAO,MACL;GACE,YAAY,OAAO;GACnB,cAAc,OAAO;EACvB,GACA,eACF;EACA,IAAI,OAAO,gBAAgB,CAAC,SAAS,OAAO,YAAY,GAAG;GAEzD,OAAO,MACL,4BAA4B,OAAO,YAAY,IAAI,cAAc,OAAO,YAAY,EAAE,IAAI,OAAO,OAAO,aAAa,EACvH;GACA,IAAI,aAAa;GACjB,OAAO,OAAO,GAAG,GAAG;EACtB;EACA,IAAI,CAAC,uBAAuB,MAAM,GAAG;GACnC,IAAI,aAAa;GACjB,OAAO,OAAO,GAAG,GAAG;EACtB;EACA,IAAI,CAAC,iBAA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,GAAG;EAGvB,IAAI,eAAe,SAAS,IAAI,YAAA,qBAC9B,OAAO,OAAO,IAAI,GAAG;EAGvB,OAAO,MACL;GACE,eAAe,OAAO;GACtB,cAAc,OAAO;GACrB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,kBAAkB,OAAO;GACzB,WAAW,OAAO;GAClB,eAAe,OAAO;GACtB,aAAa,OAAO;GACpB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,sBAAsB,OAAO;GAC7B,0BAA0B,OAAO;GACjC;EACF,GACA,qBACF;EACA,IAAI,aAAa;CACnB;CACA,OAAO,OAAO,GAAG,GAAG;AACtB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["allVersioning.get"],"sources":["../../../../../lib/workers/repository/process/lookup/index.ts"],"sourcesContent":["import { isNonEmptyString, isString, isUndefined } from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../../config/index.ts';\nimport type { ValidationMessage } from '../../../../config/types.ts';\nimport { CONFIG_VALIDATION } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n getDatasourceFor,\n getDefaultVersioning,\n} from '../../../../modules/datasource/common.ts';\nimport type {\n Release,\n ReleaseResult,\n} from '../../../../modules/datasource/index.ts';\nimport {\n applyDatasourceFilters,\n getRawPkgReleases,\n isGetPkgReleasesConfig,\n supportsDigests,\n} from '../../../../modules/datasource/index.ts';\nimport { postprocessRelease } from '../../../../modules/datasource/postprocess-release.ts';\nimport { isPseudoVersion } from '../../../../modules/versioning/gomod/index.ts';\nimport * as allVersioning from '../../../../modules/versioning/index.ts';\nimport { ExternalHostError } from '../../../../types/errors/external-host-error.ts';\nimport { assignKeys } from '../../../../util/assign-keys.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { applyPackageRules } from '../../../../util/package-rules/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { Result } from '../../../../util/result.ts';\nimport { safeStringify } from '../../../../util/stringify.ts';\nimport type { Timestamp } from '../../../../util/timestamp.ts';\nimport { calculateAbandonment } from './abandonment.ts';\nimport { groupReleasesIntoBuckets } from './bucket.ts';\nimport { getNewestMatchingVersion, resolveCurrentVersion } from './current.ts';\nimport type { DigestLikeUpdate } from './digest.ts';\nimport {\n applyMinimumReleaseAgeToDigestUpdate,\n couldApplyMinimumReleaseAgeToDigest,\n resolveUpdateDigests,\n} from './digest.ts';\nimport { filterVersions } from './filter.ts';\nimport { filterInternalChecks } from './filter-checks.ts';\nimport { generateUpdate } from './generate.ts';\nimport { resolveRangeStrategy } from './range-strategy.ts';\nimport { getRollbackUpdate } from './rollback.ts';\nimport { calculateMostRecentTimestamp } from './timestamps.ts';\nimport type { LookupUpdateConfig, UpdateResult } from './types.ts';\nimport {\n addReplacementUpdateIfValid,\n isReplacementRulesConfigured,\n stripNoopUpdates,\n} from './utils.ts';\nimport {\n matchVersionCompatibility,\n restoreVersionCompatibility,\n} from './version-compatibility.ts';\nimport { applyVulnerabilityFixFilter } from './vulnerability.ts';\n\nasync function getTimestamp(\n config: LookupUpdateConfig,\n versions: Release[],\n version: string,\n versioningApi: allVersioning.VersioningApi,\n): Promise<Timestamp | null | undefined> {\n const currentRelease = versions.find(\n (v) =>\n versioningApi.isValid(v.version) &&\n versioningApi.equals(v.version, version),\n );\n\n if (!currentRelease) {\n return null;\n }\n\n if (currentRelease.releaseTimestamp) {\n return currentRelease.releaseTimestamp;\n }\n\n const remoteRelease = await postprocessRelease(config, currentRelease);\n return remoteRelease?.releaseTimestamp;\n}\n\nexport async function lookupUpdates(\n inconfig: LookupUpdateConfig,\n): Promise<Result<UpdateResult>> {\n let config: LookupUpdateConfig = { ...inconfig };\n config.versioning ??= getDefaultVersioning(config.datasource);\n\n const versioningApi = allVersioning.get(config.versioning);\n\n let dependency: ReleaseResult | null = null;\n const res: UpdateResult = {\n versioning: config.versioning,\n updates: [],\n warnings: [],\n };\n // Timestamp of the release a `digest`/`pinDigest` update's current value currently resolves to (the newest version matching it, regardless of `rangeStrategy`), as opposed to `res.currentVersionTimestamp` which tracks whatever the configured rangeStrategy resolves `currentVersion` to (e.g. the oldest for `bump`)\n let newestMatchingVersionTimestamp: Timestamp | null | undefined;\n // The `digest` update for `config.currentDigest` (if one is added), so its age check can run after `newDigest` is fetched and no-op updates are stripped.\n let digestUpdate: DigestLikeUpdate | undefined;\n\n try {\n logger.trace(\n {\n dependency: config.packageName,\n currentValue: config.currentValue,\n },\n 'lookupUpdates',\n );\n if (config.currentValue && !isString(config.currentValue)) {\n // If currentValue is not a string, then it's invalid\n logger.debug(\n `Invalid currentValue for ${config.packageName}: ${safeStringify(config.currentValue)} (${typeof config.currentValue})`,\n );\n res.skipReason = 'invalid-value';\n return Result.ok(res);\n }\n if (!isGetPkgReleasesConfig(config)) {\n res.skipReason = 'invalid-config';\n return Result.ok(res);\n }\n if (!getDatasourceFor(config.datasource)) {\n res.skipReason = 'invalid-config';\n res.warnings.push({\n topic: config.packageName,\n message: `Unknown datasource \"${config.datasource}\" for package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n let compareValue =\n config.isLockfileOnly && config.lockedVersion\n ? config.lockedVersion\n : config.currentValue;\n const versionCompatibilityMatch = matchVersionCompatibility(config);\n if (versionCompatibilityMatch) {\n compareValue = versionCompatibilityMatch.compareValue;\n config.currentCompatibility =\n versionCompatibilityMatch.currentCompatibility;\n res.currentCompatibility = versionCompatibilityMatch.currentCompatibility;\n }\n\n const isValid =\n isString(compareValue) && versioningApi.isValid(compareValue);\n\n const unconstrainedValue =\n !!config.lockedVersion && isUndefined(config.currentValue);\n\n if (isValid || unconstrainedValue) {\n if (\n !config.updatePinnedDependencies &&\n !config.isLockfileOnly &&\n // TODO #22198\n versioningApi.isSingleVersion(compareValue!)\n ) {\n res.skipReason = 'is-pinned';\n return Result.ok(res);\n }\n\n const { val: releaseResult, err: lookupError } = await getRawPkgReleases(\n config,\n )\n .transform((res) => calculateMostRecentTimestamp(versioningApi, res))\n .transform((res) => calculateAbandonment(res, config))\n .transform((res) => applyDatasourceFilters(res, config))\n .unwrap();\n\n if (lookupError instanceof Error) {\n throw lookupError;\n }\n\n if (lookupError) {\n // If dependency lookup fails then warn and return\n const warning: ValidationMessage = {\n topic: config.packageName,\n message: `Failed to look up ${config.datasource} package ${config.packageName}: ${lookupError}`,\n };\n logger.debug(\n {\n dependency: config.packageName,\n packageFile: config.packageFile,\n },\n warning.message,\n );\n // TODO: return warnings in own field\n res.warnings.push(warning);\n return Result.ok(res);\n }\n\n dependency = releaseResult;\n\n if (dependency.deprecationMessage) {\n logger.debug(\n `Found deprecationMessage for ${config.datasource} package ${config.packageName}`,\n );\n }\n\n assignKeys(res, dependency, [\n 'deprecationMessage',\n 'sourceUrl',\n 'registryUrl',\n 'effectiveDatasource',\n 'sourceDirectory',\n 'homepage',\n 'changelogUrl',\n 'dependencyUrl',\n 'lookupName',\n 'packageScope',\n 'mostRecentTimestamp',\n 'isAbandoned',\n 'respectLatest',\n ]);\n\n const latestVersion = dependency.tags?.latest;\n // Filter out any results from datasource that don't comply with our versioning\n let allVersions = dependency.releases.filter((release) =>\n versioningApi.isVersion(release.version),\n );\n const allReleaseVersions = new Set(allVersions.map((r) => r.version));\n // The datasources used in these tests always return at least one\n // version-like release, so neither this block nor the currentDigest\n // check inside it is reached. A lookup whose releases are all\n // unversioned tags does not get here either - with a digest configured\n // it takes the digest-only path above instead - see #40625\n // istanbul ignore if\n if (allVersions.length === 0) {\n const message = `Found no results from datasource that look like a version`;\n logger.info(\n {\n dependency: config.packageName,\n result: dependency,\n },\n message,\n );\n if (!config.currentDigest) {\n return Result.ok(res);\n }\n }\n // Reapply package rules in case we missed something from sourceUrl\n config = await applyPackageRules(\n {\n ...config,\n sourceUrl: res.sourceUrl,\n effectiveDatasource: res.effectiveDatasource,\n },\n 'source-url',\n );\n if (config.followTag) {\n const taggedVersion = dependency.tags?.[config.followTag];\n if (!taggedVersion) {\n res.warnings.push({\n topic: config.packageName,\n message: `Can't find version with tag ${config.followTag} for ${config.datasource} package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n allVersions = allVersions.filter(\n (v) =>\n v.version === taggedVersion ||\n (v.version === compareValue &&\n versioningApi.isGreaterThan(taggedVersion, compareValue)),\n );\n }\n\n const inRangeOnlyStrategy = config.rangeStrategy === 'in-range-only';\n // Check that existing constraint can be satisfied\n const allSatisfyingVersions =\n (inRangeOnlyStrategy || config.rollbackPrs) && !unconstrainedValue\n ? allVersions.filter((v) =>\n // TODO #22198\n versioningApi.matches(v.version, compareValue!),\n )\n : allVersions;\n if (!allSatisfyingVersions.length) {\n logger.debug(\n `Found no satisfying versions with '${config.versioning}' versioning`,\n );\n }\n\n if (config.rollbackPrs && !allSatisfyingVersions.length) {\n const rollback = getRollbackUpdate(config, allVersions, versioningApi);\n // istanbul ignore if\n if (!rollback) {\n res.warnings.push({\n topic: config.packageName,\n // TODO: types (#22198)\n message: `Can't find version matching ${compareValue!} for ${\n config.datasource\n } package ${config.packageName}`,\n });\n return Result.ok(res);\n }\n res.updates.push(rollback);\n }\n let rangeStrategy = resolveRangeStrategy(config);\n\n const currentVersion = resolveCurrentVersion(\n compareValue,\n config.lockedVersion,\n versioningApi,\n rangeStrategy,\n latestVersion,\n allVersions,\n );\n\n if (!currentVersion) {\n // v8 ignore else -- TODO: add test #40625\n if (!config.lockedVersion) {\n logger.debug(\n `No currentVersion or lockedVersion found for ${config.packageName}`,\n );\n res.skipReason = 'invalid-value';\n }\n return Result.ok(res);\n }\n\n res.currentVersion = currentVersion;\n\n // Use lockedVersion for the timestamp lookup when available, because\n // res.currentVersion is later overwritten to lockedVersion (see below).\n // Without this, strategies like \"replace\" would compute the timestamp\n // for the highest satisfying version (e.g. 1.4.1) while the reported\n // currentVersion ends up being the locked one (e.g. 1.0.0).\n const versionForTimestamp = config.lockedVersion ?? currentVersion;\n const currentVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n versionForTimestamp,\n versioningApi,\n );\n\n if (isNonEmptyString(currentVersionTimestamp)) {\n res.currentVersionTimestamp = currentVersionTimestamp;\n res.currentVersionAgeInDays = getElapsedDays(currentVersionTimestamp);\n\n if (\n config.packageRules?.some((rule) =>\n isNonEmptyString(rule.matchCurrentAge),\n )\n ) {\n // Reapply package rules to check matches for matchCurrentAge\n config = await applyPackageRules(\n { ...config, currentVersionTimestamp },\n 'current-timestamp',\n );\n }\n }\n\n if (\n config.currentDigest\n ? couldApplyMinimumReleaseAgeToDigest(config, 'digest')\n : config.pinDigests &&\n couldApplyMinimumReleaseAgeToDigest(config, 'pinDigest')\n ) {\n const newestMatchingVersion = getNewestMatchingVersion(\n compareValue,\n versioningApi,\n latestVersion,\n allVersions,\n );\n if (newestMatchingVersion) {\n newestMatchingVersionTimestamp = await getTimestamp(\n config,\n allVersions,\n newestMatchingVersion,\n versioningApi,\n );\n }\n }\n\n if (\n compareValue &&\n currentVersion &&\n rangeStrategy === 'pin' &&\n !versioningApi.isSingleVersion(compareValue)\n ) {\n const newValue =\n versioningApi.getPinnedValue?.(currentVersion) ?? currentVersion;\n res.updates.push({\n updateType: 'pin',\n isPin: true,\n newValue,\n newVersion: currentVersion,\n newMajor: versioningApi.getMajor(currentVersion)!,\n });\n }\n if (rangeStrategy === 'pin') {\n // Fall back to replace once pinning logic is done\n rangeStrategy = 'replace';\n }\n // A non-version can only get this far via a locked version under\n // rangeStrategy=pin, but the timestamp lookup above calls `equals()` on\n // it first and throws - see #40625\n // istanbul ignore if\n if (!versioningApi.isVersion(currentVersion)) {\n res.skipReason = 'invalid-version';\n return Result.ok(res);\n }\n // Filter latest, unstable, etc\n // TODO #22198\n let filteredReleases = filterVersions(\n config,\n currentVersion,\n latestVersion!,\n inRangeOnlyStrategy ? allSatisfyingVersions : allVersions,\n versioningApi,\n ).filter((v) => {\n if (config.isLockfileOnly) {\n return true;\n }\n\n // Leave only compatible versions\n return (\n unconstrainedValue ||\n versioningApi.isCompatible(v.version, compareValue)\n );\n });\n const vulnerabilityFix = applyVulnerabilityFixFilter(\n config,\n res,\n versioningApi,\n filteredReleases,\n );\n filteredReleases = vulnerabilityFix.releases;\n const { shrinkedViaVulnerability } = vulnerabilityFix;\n\n const buckets = groupReleasesIntoBuckets(\n config,\n currentVersion,\n filteredReleases,\n versioningApi,\n );\n const depResultConfig = mergeChildConfig(config, res);\n for (const [bucket, releases] of Object.entries(buckets)) {\n const sortedReleases = releases.sort((r1, r2) =>\n versioningApi.sortVersions(r1.version, r2.version),\n );\n const { release, pendingChecks, pendingReleases } =\n await filterInternalChecks(\n depResultConfig,\n versioningApi,\n bucket,\n sortedReleases,\n );\n // `filterInternalChecks()` normally yields a release, falling back to\n // the newest pending one; only a datasource rejecting every candidate\n // during postprocessing leaves none - see #40625\n // istanbul ignore next\n if (!release) {\n return Result.ok(res);\n }\n const newVersion = release.version;\n const update = await generateUpdate(\n config,\n config.isLockfileOnly ? config.currentValue : compareValue,\n versioningApi,\n // TODO #22198\n\n rangeStrategy!,\n config.lockedVersion ?? currentVersion,\n bucket,\n release,\n allReleaseVersions,\n );\n\n // An update between two pseudo-versions of the same module changes the\n // commit and nothing else, so it is a digest update - see #29034\n if (\n config.manager === 'gomod' &&\n isPseudoVersion(compareValue) &&\n isPseudoVersion(update.newValue) &&\n config.currentDigest !== update.newDigest\n ) {\n update.updateType = 'digest';\n\n // As this has already been processed by `filterInternalChecks()`, but we're changing the `updateType`, we need to apply the digest-scoped minimumReleaseAge rules.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `update.updateType` never is here - true is a safe constant.\n await applyMinimumReleaseAgeToDigestUpdate(\n update as DigestLikeUpdate,\n config,\n res,\n true,\n release.releaseTimestamp,\n );\n }\n\n if (pendingChecks) {\n update.pendingChecks = pendingChecks;\n }\n\n if (pendingReleases.length) {\n update.pendingVersions = pendingReleases.map((r) => r.version);\n }\n if (!update.newValue || update.newValue === compareValue) {\n if (!config.lockedVersion) {\n continue;\n }\n // istanbul ignore if\n if (rangeStrategy === 'bump') {\n logger.trace(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n lockedVersion: config.lockedVersion,\n newVersion,\n },\n 'Skipping bump because newValue is the same',\n );\n continue;\n }\n res.isSingleVersion = true;\n }\n res.isSingleVersion ??=\n isString(update.newValue) &&\n versioningApi.isSingleVersion(update.newValue);\n // Nothing but a rollback should ever propose a lower version, so a\n // downgrade means the lookup went wrong and the update is dropped - see\n // #29921. A versioning which reports each value as greater than the\n // other has no order between them (e.g. aws-machine-image relies on the\n // datasource order), so no downgrade can be claimed.\n if (\n update.updateType !== 'rollback' &&\n update.newValue &&\n versioningApi.isVersion(update.newValue) &&\n compareValue &&\n versioningApi.isVersion(compareValue) &&\n versioningApi.isGreaterThan(compareValue, update.newValue) &&\n !versioningApi.isGreaterThan(update.newValue, compareValue)\n ) {\n logger.warn(\n {\n packageName: config.packageName,\n currentValue: config.currentValue,\n compareValue,\n currentVersion: config.currentVersion,\n update,\n allVersionsLength: allVersions.length,\n filteredReleaseVersions: filteredReleases.map((r) => r.version),\n shrinkedViaVulnerability,\n },\n 'Unexpected downgrade detected: skipping',\n );\n } else {\n res.updates.push(update);\n }\n }\n } else if (compareValue) {\n logger.debug(\n `Dependency ${config.packageName} has unsupported/unversioned value ${compareValue} (versioning=${config.versioning})`,\n );\n\n if (!config.pinDigests && !config.currentDigest) {\n logger.debug(\n `Skipping ${config.packageName} because no currentDigest or pinDigests`,\n );\n res.skipReason = 'invalid-value';\n } else {\n delete res.skipReason;\n }\n } else {\n res.skipReason = 'invalid-value';\n }\n\n if (isReplacementRulesConfigured(config)) {\n addReplacementUpdateIfValid(res.updates, config);\n } else if (dependency?.replacementName && dependency.replacementVersion) {\n res.updates.push({\n updateType: 'replacement',\n newName: dependency.replacementName,\n newValue: dependency.replacementVersion,\n });\n }\n\n // Record if the dep is fixed to a version\n if (config.lockedVersion) {\n res.currentVersion = config.lockedVersion;\n res.fixedVersion = config.lockedVersion;\n } else if (compareValue && versioningApi.isSingleVersion(compareValue)) {\n res.fixedVersion = compareValue.replace(regEx(/^=+/), '');\n }\n\n // massage versionCompatibility\n restoreVersionCompatibility(config, compareValue, res.updates);\n\n // Add digests if necessary\n if (supportsDigests(config.datasource)) {\n if (config.currentDigest) {\n if (!config.digestOneAndOnly || !res.updates.length) {\n // digest update - age-checked after the strip below, once newDigest is known\n digestUpdate = {\n updateType: 'digest',\n newValue: config.currentValue,\n };\n res.updates.push(digestUpdate);\n }\n } else if (\n config.pinDigests &&\n // only update the digest in the package file if it's managed by us\n !config.digestManagedExternally &&\n // Create a pin only if one doesn't already exists\n // v8 ignore else -- TODO: add test #40625\n !res.updates.some((update) => update.updateType === 'pin')\n ) {\n // pin digest\n const pinDigestUpdate: DigestLikeUpdate = {\n isPinDigest: true,\n updateType: 'pinDigest',\n newValue: config.currentValue,\n };\n await applyMinimumReleaseAgeToDigestUpdate(\n pinDigestUpdate,\n config,\n res,\n isValid || unconstrainedValue,\n newestMatchingVersionTimestamp,\n );\n res.updates.push(pinDigestUpdate);\n }\n if (versioningApi.valueToVersion) {\n // TODO #22198\n res.currentVersion = versioningApi.valueToVersion(res.currentVersion!);\n for (const update of res.updates) {\n // TODO #22198\n update.newVersion = versioningApi.valueToVersion(update.newVersion!);\n }\n }\n if (res.registryUrl) {\n config.registryUrls = [res.registryUrl];\n }\n\n // update digest for all\n await resolveUpdateDigests(config, res, dependency);\n }\n\n if (res.updates.length) {\n delete res.skipReason;\n }\n // Strip out any non-changed ones\n res.updates = stripNoopUpdates(config, res.updates);\n\n // If there is a digest update proposed which is in the pending updates for this dependency, ensure that `minimumReleaseAge` is applied.\n // `currentVersionWasResolved` only matters for `pinDigest`, which `digestUpdate` never is - true is a safe constant.\n if (digestUpdate && res.updates.includes(digestUpdate)) {\n await applyMinimumReleaseAgeToDigestUpdate(\n digestUpdate,\n config,\n res,\n true,\n newestMatchingVersionTimestamp,\n );\n }\n\n const release =\n res.updates.length > 0\n ? (dependency?.releases.find(\n (r) => r.version === res.updates[0].newValue,\n ) ??\n dependency?.releases.find(\n (r) => r.version === res.updates[0].newVersion,\n ))\n : null;\n\n if (release?.changelogContent) {\n res.changelogContent = release.changelogContent;\n res.changelogUrl = release.changelogUrl;\n }\n } catch (err) /* istanbul ignore next */ {\n if (err instanceof ExternalHostError) {\n return Result.err(err);\n }\n\n if (err instanceof Error && err.message === CONFIG_VALIDATION) {\n return Result.err(err);\n }\n\n logger.error(\n {\n currentDigest: config.currentDigest,\n currentValue: config.currentValue,\n datasource: config.datasource,\n packageName: config.packageName,\n digestOneAndOnly: config.digestOneAndOnly,\n followTag: config.followTag,\n lockedVersion: config.lockedVersion,\n packageFile: config.packageFile,\n pinDigests: config.pinDigests,\n rollbackPrs: config.rollbackPrs,\n isVulnerabilityAlert: config.isVulnerabilityAlert,\n updatePinnedDependencies: config.updatePinnedDependencies,\n err,\n },\n 'lookupUpdates error',\n );\n res.skipReason = 'internal-error';\n }\n return Result.ok(res);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,eAAe,aACb,QACA,UACA,SACA,eACuC;CACvC,MAAM,iBAAiB,SAAS,MAC7B,MACC,cAAc,QAAQ,EAAE,OAAO,KAC/B,cAAc,OAAO,EAAE,SAAS,OAAO,CAC3C;CAEA,IAAI,CAAC,gBACH,OAAO;CAGT,IAAI,eAAe,kBACjB,OAAO,eAAe;CAIxB,QAAO,MADqB,mBAAmB,QAAQ,cAAc,EAAA,EAC/C;AACxB;AAEA,eAAsB,cACpB,UAC+B;CAC/B,IAAI,SAA6B,EAAE,GAAG,SAAS;CAC/C,OAAO,eAAe,qBAAqB,OAAO,UAAU;CAE5D,MAAM,gBAAgBA,IAAkB,OAAO,UAAU;CAEzD,IAAI,aAAmC;CACvC,MAAM,MAAoB;EACxB,YAAY,OAAO;EACnB,SAAS,CAAC;EACV,UAAU,CAAC;CACb;CAEA,IAAI;CAEJ,IAAI;CAEJ,IAAI;EACF,OAAO,MACL;GACE,YAAY,OAAO;GACnB,cAAc,OAAO;EACvB,GACA,eACF;EACA,IAAI,OAAO,gBAAgB,CAAC,SAAS,OAAO,YAAY,GAAG;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S,MACnB,MAAM,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAC,QACtC,KACA,YAAY,SAAS,MAClB,MAAM,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAC,UACtC,IACA;EAEN,IAAI,SAAS,kBAAkB;GAC7B,IAAI,mBAAmB,QAAQ;GAC/B,IAAI,eAAe,QAAQ;EAC7B;CACF,SAAS,gCAAgC;EACvC,IAAI,eAAe,mBACjB,OAAO,OAAO,IAAI,GAAG;EAGvB,IAAI,eAAe,SAAS,IAAI,YAAA,qBAC9B,OAAO,OAAO,IAAI,GAAG;EAGvB,OAAO,MACL;GACE,eAAe,OAAO;GACtB,cAAc,OAAO;GACrB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,kBAAkB,OAAO;GACzB,WAAW,OAAO;GAClB,eAAe,OAAO;GACtB,aAAa,OAAO;GACpB,YAAY,OAAO;GACnB,aAAa,OAAO;GACpB,sBAAsB,OAAO;GAC7B,0BAA0B,OAAO;GACjC;EACF,GACA,qBACF;EACA,IAAI,aAAa;CACnB;CACA,OAAO,OAAO,GAAG,GAAG;AACtB"}
|
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.144.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"got": "16.0.0",
|
|
164
164
|
"graph-data-structure": "4.5.0",
|
|
165
165
|
"handlebars": "4.7.9",
|
|
166
|
-
"ignore": "7.0.
|
|
166
|
+
"ignore": "7.0.11",
|
|
167
167
|
"ini": "6.0.0",
|
|
168
168
|
"json-dup-key-validator": "1.0.3",
|
|
169
169
|
"json-stringify-pretty-compact": "4.0.0",
|
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.144.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.144.1",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"definitions": {
|
|
@@ -3378,8 +3378,8 @@
|
|
|
3378
3378
|
"default": false
|
|
3379
3379
|
},
|
|
3380
3380
|
"enabled": {
|
|
3381
|
-
"description": "Enable or disable corresponding functionality.\nSee also: https://docs.renovatebot.com/configuration-options/#
|
|
3382
|
-
"markdownDescription": "Enable or disable corresponding functionality.\n\nSee also: [enabled](https://docs.renovatebot.com/configuration-options/#
|
|
3381
|
+
"description": "Enable or disable corresponding functionality.\nSee also: https://docs.renovatebot.com/configuration-options/#enabled",
|
|
3382
|
+
"markdownDescription": "Enable or disable corresponding functionality.\n\nSee also: [enabled](https://docs.renovatebot.com/configuration-options/#enabled)",
|
|
3383
3383
|
"type": "boolean",
|
|
3384
3384
|
"default": true
|
|
3385
3385
|
},
|
|
@@ -3476,8 +3476,8 @@
|
|
|
3476
3476
|
"type": "string"
|
|
3477
3477
|
},
|
|
3478
3478
|
"fetchChangeLogs": {
|
|
3479
|
-
"description": "Controls if and when changelogs/release notes are fetched.\nSee also: https://docs.renovatebot.com/configuration-options/#
|
|
3480
|
-
"markdownDescription": "Controls if and when changelogs/release notes are fetched.\n\nSee also: [fetchChangeLogs](https://docs.renovatebot.com/configuration-options/#
|
|
3479
|
+
"description": "Controls if and when changelogs/release notes are fetched.\nSee also: https://docs.renovatebot.com/configuration-options/#fetchchangelogs",
|
|
3480
|
+
"markdownDescription": "Controls if and when changelogs/release notes are fetched.\n\nSee also: [fetchChangeLogs](https://docs.renovatebot.com/configuration-options/#fetchchangelogs)",
|
|
3481
3481
|
"type": "string",
|
|
3482
3482
|
"enum": [
|
|
3483
3483
|
"off",
|
|
@@ -5920,8 +5920,8 @@
|
|
|
5920
5920
|
}
|
|
5921
5921
|
},
|
|
5922
5922
|
"managerFilePatterns": {
|
|
5923
|
-
"description": "RegEx (`re2`) and glob patterns for matching manager files.\nSee also: https://docs.renovatebot.com/configuration-options/#
|
|
5924
|
-
"markdownDescription": "RegEx (`re2`) and glob patterns for matching manager files.\n\nSee also: [managerFilePatterns](https://docs.renovatebot.com/configuration-options/#
|
|
5923
|
+
"description": "RegEx (`re2`) and glob patterns for matching manager files.\nSee also: https://docs.renovatebot.com/configuration-options/#managerfilepatterns",
|
|
5924
|
+
"markdownDescription": "RegEx (`re2`) and glob patterns for matching manager files.\n\nSee also: [managerFilePatterns](https://docs.renovatebot.com/configuration-options/#managerfilepatterns)",
|
|
5925
5925
|
"oneOf": [
|
|
5926
5926
|
{
|
|
5927
5927
|
"type": "array",
|