renovate
Version:
Automated dependency updates. Flexible so you don't need to be.
643 lines (642 loc) • 23 kB
TypeScript
import { Category } from "../constants/category.js";
import { PlatformId } from "../constants/platforms.js";
import { LogLevelRemap } from "../logger/types.js";
import { ManagerName } from "../manager-list.generated.js";
import { AdditionalConstraintName, ConstraintName, ToolName } from "../util/exec/types.js";
import { Timestamp } from "../util/timestamp.js";
import { GitNoVerifyOption } from "../util/git/types.js";
import { GitUrlOption, RepoSortMethod, SortMethod } from "../modules/platform/types.js";
import { MergeConfidence } from "../util/merge-confidence/types.js";
import { HostRule } from "../types/host-rules.js";
import { SkipReason, StageName } from "../types/skip-reason.js";
import { RangeStrategy } from "../types/versioning.js";
import { AutoMergeType, Nullish } from "../types/index.js";
import { CustomManager } from "../modules/manager/custom/types.js";
//#region lib/config/types.d.ts
type RenovateConfigStage = 'global' | 'inherit' | 'repository' | 'package' | 'branch' | 'pr';
type RenovateSplit = 'init' | 'onboarding' | 'extract' | 'lookup' | 'update';
type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';
type RepositoryCacheType = 'local' | (string & {});
type DryRunConfig = 'extract' | 'lookup' | 'full';
type RequiredConfig = 'required' | 'optional' | 'ignored';
interface GroupConfig extends Record<string, unknown> {
branchName?: string;
branchTopic?: string;
}
type RecreateWhen = 'auto' | 'never' | 'always';
type PlatformCommitOptions = 'auto' | 'disabled' | 'enabled';
type BinarySource = 'docker' | 'global' | 'install' | 'hermit';
/**
* Any configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration), or:
*
* - in a datasource-specific configuration
* - in a manager-specific configuration
* - in a Package Rule
*
* @see RenovateConfig for the superset of all configuration allowed in a given repository
*
*/
interface RenovateSharedConfig {
$schema?: string;
abandonmentThreshold?: Nullish<string>;
addLabels?: string[];
assignAutomerge?: boolean;
autoApprove?: boolean;
autoReplaceGlobalMatch?: boolean;
automerge?: boolean;
automergeSchedule?: string[];
automergeStrategy?: MergeStrategy;
automergeType?: AutoMergeType;
azureWorkItemId?: number;
branchName?: string;
branchNameStrict?: boolean;
branchPrefix?: string;
branchPrefixOld?: string;
bumpVersions?: BumpVersionConfig[];
commitBody?: string;
commitBodyTable?: boolean;
commitMessage?: string;
commitMessageAction?: string;
commitMessageExtra?: string;
commitMessageLowerCase?: 'auto' | 'never';
commitMessagePrefix?: string;
commitMessageTopic?: string;
confidential?: boolean;
configValidationError?: boolean;
changelogUrl?: string;
dependencyDashboardApproval?: boolean;
draftPR?: boolean;
enabled?: boolean;
enabledManagers?: string[];
encrypted?: Record<string, string>;
extends?: string[];
extractVersion?: string;
managerFilePatterns?: string[];
followTag?: string;
force?: RenovateConfig;
gitIgnoredAuthors?: string[];
group?: GroupConfig;
groupName?: string;
groupSingleUpdates?: boolean;
groupSlug?: string;
hashedBranchLength?: number;
ignoreDeps?: string[];
ignorePaths?: string[];
ignoreTests?: boolean;
ignoreUnstable?: boolean;
includePaths?: string[];
internalChecksAsSuccess?: boolean;
internalChecksFilter?: 'strict' | 'flexible' | 'none';
keepUpdatedLabel?: string;
labels?: string[];
manager?: string;
milestone?: number;
minimumReleaseAge?: Nullish<string>;
npmrc?: string;
npmrcMerge?: boolean;
npmToken?: string;
pinDigests?: boolean;
platformAutomerge?: boolean;
platformCommit?: PlatformCommitOptions;
postUpgradeTasks?: PostUpgradeTasks;
prBodyColumns?: string[];
prBodyDefinitions?: Record<string, string>;
prBodyHeadingDefinitions?: Record<string, string>;
prBodyNotes?: string[];
prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';
prFooter?: string;
prHeader?: string;
prPriority?: number;
prTitle?: string;
prTitleStrict?: boolean;
productLinks?: Record<string, string>;
pruneBranchAfterAutomerge?: boolean;
rangeStrategy?: RangeStrategy;
rebaseLabel?: string;
rebaseWhen?: string;
recreateClosed?: boolean;
recreateWhen?: RecreateWhen;
repository?: string;
repositoryCache?: RepositoryCacheConfig;
repositoryCacheType?: RepositoryCacheType;
respectLatest?: boolean;
rollbackPrs?: boolean;
schedule?: string[];
semanticCommitScope?: string | null;
semanticCommitType?: string;
semanticCommits?: 'auto' | 'enabled' | 'disabled';
separateMajorMinor?: boolean;
separateMinorPatch?: boolean;
separateMultipleMajor?: boolean;
separateMultipleMinor?: boolean;
skipArtifactsUpdate?: boolean;
stopUpdatingLabel?: string;
suppressNotifications?: string[];
timezone?: string;
unicodeEmoji?: boolean;
updateNotScheduled?: boolean;
versioning?: string;
versionCompatibility?: string;
}
/**
* Contains all options with globalOnly=true && inheritConfigSupport=true
*/
interface GlobalInheritableConfig {
bbUseDevelopmentBranch?: boolean;
configFileNames?: string[];
onboarding?: boolean;
onboardingAutoCloseAge?: number;
onboardingBranch?: string;
onboardingCommitMessage?: string;
onboardingConfig?: RenovateConfig;
onboardingConfigFileName?: string;
onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';
onboardingPrTitle?: string;
requireConfig?: RequiredConfig;
}
/** @deprecated use `RepoGlobalConfig` instead **/
interface GlobalOnlyConfigLegacy {
autodiscover?: boolean;
autodiscoverFilter?: string[] | string;
autodiscoverNamespaces?: string[];
autodiscoverProjects?: string[];
autodiscoverTopics?: string[];
baseDir?: string;
cacheDir?: string;
containerbaseDir?: string;
detectHostRulesFromEnv?: boolean;
dockerCliOptions?: string;
endpoint?: string;
forceCli?: boolean;
gitNoVerify?: GitNoVerifyOption[];
gitPrivateKey?: string;
gitPrivateKeyPassphrase?: string;
globalExtends?: string[];
mergeConfidenceDatasources?: string[];
mergeConfidenceEndpoint?: string;
platform?: PlatformId;
processEnv?: Record<string, string>;
prCommitsPerRunLimit?: number;
privateKey?: string;
privateKeyOld?: string;
privateKeyPath?: string;
privateKeyPathOld?: string;
redisPrefix?: string;
redisUrl?: string;
repositories?: RenovateRepository[];
useCloudMetadataServices?: boolean;
deleteConfigFile?: boolean;
deleteAdditionalConfigFile?: boolean;
}
/**
* Any global-only configuration set by self-hosted administrators.
*
* Used within the repository worker.
*
* Should only contain config options where globalOnly=true.
*/
interface RepoGlobalConfig extends GlobalInheritableConfig {
allowedCommands?: string[];
allowCustomCrateRegistries?: boolean;
allowPlugins?: boolean;
allowScripts?: boolean;
allowShellExecutorForPostUpgradeCommands?: boolean;
allowedEnv?: string[];
allowedHeaders?: string[];
binarySource?: BinarySource;
cacheDir?: string;
cacheHardTtlMinutes?: number;
cacheTtlOverride?: Record<string, number>;
containerbaseDir?: string;
customEnvVariables?: Record<string, string>;
dockerChildPrefix?: string;
dockerCliOptions?: string;
dockerSidecarImage?: string;
dockerUser?: string;
dryRun?: DryRunConfig;
encryptedWarning?: string;
endpoint?: string;
executionTimeout?: number;
exposeAllEnv?: boolean;
gitTimeout?: number;
githubTokenWarn?: boolean;
includeMirrors?: boolean;
localDir?: string;
migratePresets?: Record<string, string>;
platform?: PlatformId;
prCacheSyncMaxPages?: number;
presetCachePersistence?: boolean;
httpCacheTtlDays?: number;
autodiscoverRepoSort?: RepoSortMethod;
autodiscoverRepoOrder?: SortMethod;
userAgent?: string;
dockerMaxPages?: number;
s3Endpoint?: string;
s3PathStyle?: boolean;
cachePrivatePackages?: boolean;
repositoryCacheForceLocal?: boolean;
configFileNames?: string[];
ignorePrAuthor?: boolean;
allowedUnsafeExecutions?: AllowedUnsafeExecution[];
onboardingAutoCloseAge?: number;
toolSettings?: ToolSettingsOptions;
}
/**
* Those options are global only but still passed into the repository worker config.
*
* @deprecated https://github.com/renovatebot/renovate/issues/39693
*/
interface LegacyAdminConfig {
baseDir?: string;
localDir?: string;
logContext?: string;
onboarding?: boolean;
onboardingBranch?: string;
onboardingNoDeps?: 'auto' | 'enabled' | 'disabled';
onboardingRebaseCheckbox?: boolean;
onboardingConfig?: RenovateConfig;
onboardingConfigFileName?: string;
optimizeForDisabled?: boolean;
persistRepoData?: boolean;
prCommitsPerRunLimit?: number;
requireConfig?: RequiredConfig;
useCloudMetadataServices?: boolean;
writeDiscoveredRepos?: string;
}
type ExecutionMode = 'branch' | 'update';
interface PostUpgradeTasks {
commands?: string[];
workingDirTemplate?: string;
dataFileTemplate?: string;
fileFilters?: string[];
executionMode: ExecutionMode;
installTools?: Partial<Record<ToolName, Record<never, never>>>;
}
type UpdateConfig<T extends RenovateSharedConfig = RenovateSharedConfig> = Partial<Record<UpdateType, T | null>>;
type RenovateRepository = string | (AllConfig & {
repository: string;
});
type UseBaseBranchConfigType = 'merge' | 'none';
type ConstraintsFilter = 'strict' | 'none';
type MinimumReleaseAgeBehaviour = 'timestamp-required' | 'timestamp-optional';
declare const allowedStatusCheckStrings: readonly ["minimumReleaseAge", "mergeConfidence", "configValidation", "artifactError"];
type StatusCheckKey = (typeof allowedStatusCheckStrings)[number];
type UserEnv = Record<string, string>;
/**
* Computed properties, for internal use only
*/
interface RenovateInternalConfig {
/** computed base branch from patterns - for internal use only */
baseBranches?: string[];
currentCompatibility?: string;
datasource?: string;
hasBaseBranches?: boolean;
isFork?: boolean;
isVulnerabilityAlert?: boolean;
/** What is this used for? */
remediations?: unknown;
/** What is this used for? */
vulnerabilityAlertsOnly?: boolean;
}
/**
* Configuration that could be used either top-level in a repository config (or Global, Inherited or Shareable Preset configuration).
*
* This is a superset of any configuration that a Renovate user (not self-hosted administrator) can set.
*/
interface RenovateConfig extends LegacyAdminConfig, RenovateSharedConfig, UpdateConfig<PackageRule>, AssigneesAndReviewersConfig, ConfigMigration, RenovateInternalConfig {
s3Endpoint?: string;
s3PathStyle?: boolean;
reportFormatting?: boolean;
reportPath?: string;
reportType?: 'logging' | 'file' | 's3' | null;
depName?: string;
/** user configurable base branch patterns*/
baseBranchPatterns?: string[];
useBaseBranchConfig?: UseBaseBranchConfigType;
baseBranch?: string;
defaultBranch?: string;
branchList?: string[];
cloneSubmodules?: boolean;
cloneSubmodulesFilter?: string[];
description?: string | string[];
detectGlobalManagerConfig?: boolean;
errors?: ValidationMessage[];
forkModeDisallowMaintainerEdits?: boolean;
forkProcessing?: 'auto' | 'enabled' | 'disabled';
forkToken?: string;
gitAuthor?: string;
hostRules?: HostRule[];
inheritConfig?: boolean;
inheritConfigFileName?: string;
inheritConfigRepoName?: string;
inheritConfigStrict?: boolean;
ignorePresets?: string[];
fileList?: string[];
configWarningReuseIssue?: boolean;
dependencyDashboard?: boolean;
dependencyDashboardAutoclose?: boolean;
dependencyDashboardChecks?: Record<string, string>;
dependencyDashboardIssue?: number;
dependencyDashboardTitle?: string;
dependencyDashboardHeader?: string;
dependencyDashboardFooter?: string;
dependencyDashboardLabels?: string[];
dependencyDashboardOSVVulnerabilitySummary?: 'none' | 'all' | 'unresolved';
dependencyDashboardReportAbandonment?: boolean;
mode?: 'silent' | 'full';
packageFile?: string;
packageRules?: PackageRule[];
postUpdateOptions?: string[];
branchConcurrentLimit?: number | null;
parentOrg?: string;
prConcurrentLimit?: number;
commitHourlyLimit?: number;
prHourlyLimit?: number;
printConfig?: boolean;
pruneStaleBranches?: boolean;
defaultRegistryUrls?: string[];
registryUrls?: string[] | null;
registryAliases?: Record<string, string>;
/**
* What is this used for?
* @deprecated
*/
renovateJsonPresent?: boolean;
repoIsOnboarded?: boolean;
repoIsActivated?: boolean;
topLevelOrg?: string;
updateInternalDeps?: boolean;
updateType?: UpdateType;
warnings?: ValidationMessage[];
vulnerabilityAlerts?: RenovateSharedConfig;
osvVulnerabilityAlerts?: boolean;
vulnerabilitySeverity?: string;
customManagers?: CustomManager[];
customDatasources?: Record<string, CustomDatasourceConfig>;
fetchChangeLogs?: FetchChangeLogsOptions;
secrets?: Record<string, string>;
variables?: Record<string, string>;
constraints?: Partial<Record<ConstraintName, string>>;
/**
* Any specific overrides for the versioning for the `AdditionalConstraintName`s.
*/
constraintsVersioning?: Partial<Record<AdditionalConstraintName, string>>;
skipInstalls?: boolean | null;
constraintsFiltering?: ConstraintsFilter;
checkedBranches?: string[];
customizeDashboard?: Record<string, string>;
statusCheckNames?: Record<StatusCheckKey, string | null>;
/**
* User configured environment variables that Renovate uses when executing package manager commands
*/
env?: UserEnv;
logLevelRemap?: LogLevelRemap[];
branchTopic?: string;
additionalBranchPrefix?: string;
sharedVariableName?: string;
minimumGroupSize?: number;
configFileNames?: string[];
minimumReleaseAgeBehaviour?: MinimumReleaseAgeBehaviour;
toolSettings?: ToolSettingsOptions;
}
declare const CustomDatasourceFormats: readonly ["html", "json", "plain", "toml", "yaml"];
type CustomDatasourceFormats = (typeof CustomDatasourceFormats)[number];
interface CustomDatasourceConfig {
defaultRegistryUrlTemplate?: string;
format?: CustomDatasourceFormats;
transformTemplates?: string[];
}
/**
* The superset of all configuration that a self-hosted administrator can set, alongside all repository-level configuration.
*
*/
interface AllConfig extends RenovateConfig, GlobalOnlyConfigLegacy, RepoGlobalConfig {
gitUrl?: GitUrlOption;
password?: string;
token?: string;
username?: string;
}
interface AssigneesAndReviewersConfig {
assigneesFromCodeOwners?: boolean;
expandCodeOwnersGroups?: boolean;
assignees?: string[];
assigneesSampleSize?: number;
ignoreReviewers?: string[];
reviewersFromCodeOwners?: boolean;
reviewers?: string[];
reviewersSampleSize?: number;
additionalReviewers?: string[];
filterUnavailableUsers?: boolean;
}
type UpdateType = 'major' | 'minor' | 'patch' | 'pin' | 'digest' | 'pinDigest' | 'lockFileMaintenance' | 'lockfileUpdate' | 'rollback' | 'bump' | 'replacement';
declare const UpdateTypesOptions: readonly ["major", "minor", "patch", "pin", "digest", "pinDigest", "lockFileMaintenance", "rollback", "replacement"];
type UpdateTypeOptions = (typeof UpdateTypesOptions)[number];
type FetchChangeLogsOptions = 'off' | 'branch' | 'pr';
type MatchStringsStrategy = 'any' | 'recursive' | 'combination';
type MergeStrategy = 'auto' | 'fast-forward' | 'merge-commit' | 'rebase' | 'rebase-merge' | 'squash';
type AllowedUnsafeExecution = 'bazelModDeps' | 'goGenerate' | 'gradleWrapper' | 'mise';
interface PackageRule extends RenovateSharedConfig, RenovateInternalConfig, UpdateConfig {
allowedVersions?: string;
description?: string | string[];
matchBaseBranches?: string[];
matchCategories?: string[];
matchConfidence?: MergeConfidence[];
matchCurrentAge?: string;
matchCurrentValue?: string;
matchCurrentVersion?: string;
matchDatasources?: string[];
matchDepNames?: string[];
matchDepTypes?: string[];
matchFileNames?: string[];
matchManagers?: string[];
matchNewValue?: string;
matchPackageNames?: string[];
matchRepositories?: string[];
matchSourceUrls?: string[];
matchRegistryUrls?: string[];
matchUpdateTypes?: UpdateType[];
matchJsonata?: string[];
overrideDatasource?: string;
overrideDepName?: string;
overridePackageName?: string;
registryUrls?: string[] | null;
replacementName?: string;
replacementVersion?: string;
sourceUrl?: string;
sourceDirectory?: string;
vulnerabilitySeverity?: string;
vulnerabilityFixVersion?: string;
}
interface ValidationMessage {
topic: string;
message: string;
}
type AllowedParents = '.' | 'bumpVersions' | 'customDatasources' | 'customManagers' | 'hostRules' | 'logLevelRemap' | 'packageRules' | 'postUpgradeTasks' | 'vulnerabilityAlerts' | 'toolSettings' | ManagerName | UpdateTypeOptions;
interface RenovateOptionBase {
/**
* If true, the option can only be configured by people with access to the Renovate instance.
* Furthermore, the option should be documented in docs/usage/self-hosted-configuration.md.
*/
globalOnly?: boolean;
inheritConfigSupport?: boolean;
allowedValues?: string[];
allowString?: boolean;
cli?: boolean;
description: string;
env?: false | string;
/**
* Do not validate object children
*/
freeChoice?: boolean;
mergeable?: boolean;
autogenerated?: boolean;
name: string;
parents?: AllowedParents[];
stage?: RenovateConfigStage;
experimental?: boolean;
experimentalDescription?: string;
experimentalIssues?: number[];
advancedUse?: boolean;
/**
* This is used to add a deprecation message in the docs
*/
deprecationMsg?: string;
/**
* For internal use only: add it to any config option that supports regex or glob matching
*/
patternMatch?: boolean;
/**
* For internal use only: add it to any config option of type integer that supports negative integers
*/
allowNegative?: boolean;
/**
* Managers which support this option, leave undefined if all managers support it.
*/
supportedManagers?: string[];
/**
* Platforms which support this option, leave undefined if all platforms support it.
*/
supportedPlatforms?: PlatformId[];
/**
* Conditions that must be met for this option to be required.
*/
requiredIf?: RenovateRequiredOption[];
/**
* If true, the option's value supports Renovate templating.
* @see https://docs.renovatebot.com/templates/
*/
supportsTemplating?: boolean;
}
interface RenovateRequiredOption {
siblingProperties: {
property: string;
value: string;
}[];
}
interface RenovateArrayOption<T extends string | number | Record<string, unknown> = Record<string, unknown>> extends RenovateOptionBase {
default?: T[] | null;
mergeable?: boolean;
type: 'array';
subType?: 'string' | 'object' | 'number';
}
interface RenovateStringArrayOption extends RenovateArrayOption<string> {
format?: 'regex';
subType: 'string';
}
interface RenovateNumberArrayOption extends RenovateArrayOption<number> {
subType: 'number';
}
interface RenovateBooleanOption extends RenovateOptionBase {
default?: boolean | null;
type: 'boolean';
}
interface RenovateIntegerOption extends RenovateOptionBase {
default?: number | null;
type: 'integer';
}
interface RenovateStringOption extends RenovateOptionBase {
default?: string | null;
format?: 'regex';
replaceLineReturns?: boolean;
type: 'string';
}
interface RenovateObjectOption extends RenovateOptionBase {
default?: any;
additionalProperties?: Record<string, unknown> | boolean;
mergeable?: boolean;
type: 'object';
}
type RenovateOptions = RenovateStringOption | RenovateNumberArrayOption | RenovateStringArrayOption | RenovateIntegerOption | RenovateBooleanOption | RenovateArrayOption | RenovateObjectOption;
interface PackageRuleInputConfig extends RenovateConfig {
versioning?: string;
packageFile?: string;
lockFiles?: string[];
depType?: string;
depTypes?: string[];
depName?: string;
packageName?: string | null;
newValue?: string | null;
currentValue?: string | null;
currentVersion?: string;
lockedVersion?: string;
updateType?: UpdateType;
mergeConfidenceLevel?: MergeConfidence | undefined;
isBump?: boolean;
sourceUrl?: string | null;
categories?: string[];
baseBranch?: string;
manager?: string;
datasource?: string;
packageRules?: (PackageRule & PackageRuleInputConfig)[];
releaseTimestamp?: Timestamp | null;
repository?: string;
currentVersionAgeInDays?: number;
currentVersionTimestamp?: string;
enabled?: boolean;
skipReason?: SkipReason;
skipStage?: StageName;
}
interface ConfigMigration {
configMigration?: boolean;
}
interface MigratedConfig {
/**
* Indicates whether there was a migration applied to the configuration.
*
* @returns
* `false` if the configuration does not need migrating, and `migratedConfig` can be ignored
* `true` if the configuration was migrated, and if so, `migratedConfig` should be used instead of the provided config
*/
isMigrated: boolean;
migratedConfig: RenovateConfig;
}
interface MigratedRenovateConfig extends RenovateConfig {
endpoints?: HostRule[];
pathRules: PackageRule[];
packages: PackageRule[];
node?: RenovateConfig;
travis?: RenovateConfig;
gradle?: RenovateConfig;
}
interface ManagerConfig extends RenovateConfig {
manager: string;
categories?: Category[];
}
interface ValidationResult {
errors: ValidationMessage[];
warnings: ValidationMessage[];
}
interface BumpVersionConfig {
bumpType?: string;
filePatterns: string[];
matchStrings: string[];
name?: string;
}
interface ToolSettingsOptions {
jvmMaxMemory?: number;
jvmMemory?: number;
nodeMaxMemory?: number;
}
//#endregion
export { AllConfig, AllowedParents, AllowedUnsafeExecution, AssigneesAndReviewersConfig, BinarySource, BumpVersionConfig, ConfigMigration, ConstraintsFilter, CustomDatasourceConfig, CustomDatasourceFormats, DryRunConfig, ExecutionMode, FetchChangeLogsOptions, GlobalInheritableConfig, GlobalOnlyConfigLegacy, GroupConfig, LegacyAdminConfig, ManagerConfig, MatchStringsStrategy, MergeStrategy, MigratedConfig, MigratedRenovateConfig, MinimumReleaseAgeBehaviour, PackageRule, PackageRuleInputConfig, PlatformCommitOptions, PostUpgradeTasks, RecreateWhen, RenovateArrayOption, RenovateBooleanOption, RenovateConfig, RenovateConfigStage, RenovateIntegerOption, RenovateInternalConfig, RenovateNumberArrayOption, RenovateObjectOption, RenovateOptionBase, RenovateOptions, RenovateRepository, RenovateRequiredOption, RenovateSharedConfig, RenovateSplit, RenovateStringArrayOption, RenovateStringOption, RepoGlobalConfig, RepositoryCacheConfig, RepositoryCacheType, RequiredConfig, StatusCheckKey, ToolSettingsOptions, UpdateConfig, UpdateType, UpdateTypeOptions, UpdateTypesOptions, UseBaseBranchConfigType, ValidationMessage, ValidationResult, allowedStatusCheckStrings };
//# sourceMappingURL=types.d.ts.map