2020-03-02 11:06:16 +00:00
|
|
|
import { LogLevel } from 'bunyan';
|
2020-05-01 16:03:48 +00:00
|
|
|
import { Range } from 'semver';
|
2020-03-02 11:06:16 +00:00
|
|
|
import { HostRule } from '../types';
|
2019-08-23 13:46:31 +00:00
|
|
|
|
|
|
|
export type RenovateConfigStage =
|
|
|
|
| 'global'
|
|
|
|
| 'repository'
|
|
|
|
| 'package'
|
|
|
|
| 'branch'
|
|
|
|
| 'pr';
|
|
|
|
|
2020-06-29 13:51:22 +00:00
|
|
|
export type RepositoryCacheConfig = 'disabled' | 'enabled' | 'reset';
|
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
export interface GroupConfig extends Record<string, unknown> {
|
|
|
|
branchName?: string;
|
|
|
|
branchTopic?: string;
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
// TODO: Proper typings
|
|
|
|
export interface RenovateSharedConfig {
|
2020-10-06 20:02:35 +00:00
|
|
|
$schema?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
automerge?: boolean;
|
2020-03-02 11:06:16 +00:00
|
|
|
branchPrefix?: string;
|
2019-10-04 07:36:07 +00:00
|
|
|
branchName?: string;
|
2020-05-03 08:14:22 +00:00
|
|
|
manager?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
commitMessage?: string;
|
2020-08-26 13:00:45 +00:00
|
|
|
commitMessagePrefix?: string;
|
2020-06-01 05:30:11 +00:00
|
|
|
draftPR?: boolean;
|
2019-08-23 13:46:31 +00:00
|
|
|
enabled?: boolean;
|
2020-03-02 11:06:16 +00:00
|
|
|
enabledManagers?: string[];
|
2020-10-06 20:02:35 +00:00
|
|
|
extends?: string[];
|
2020-05-03 08:14:22 +00:00
|
|
|
fileMatch?: string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
group?: GroupConfig;
|
|
|
|
groupName?: string;
|
|
|
|
groupSlug?: string;
|
2020-05-03 08:14:22 +00:00
|
|
|
includePaths?: string[];
|
2019-10-04 07:36:07 +00:00
|
|
|
ignoreDeps?: string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
ignorePaths?: string[];
|
2019-10-04 07:36:07 +00:00
|
|
|
labels?: string[];
|
2020-12-03 14:20:09 +00:00
|
|
|
addLabels?: string[];
|
2020-07-11 09:55:30 +00:00
|
|
|
dependencyDashboardApproval?: boolean;
|
2021-02-03 14:48:54 +00:00
|
|
|
hashedBranchLength?: number;
|
2020-03-02 11:06:16 +00:00
|
|
|
npmrc?: string;
|
2019-12-06 14:41:59 +00:00
|
|
|
platform?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
postUpgradeTasks?: PostUpgradeTasks;
|
|
|
|
prBodyColumns?: string[];
|
2020-05-07 08:23:45 +00:00
|
|
|
prBodyDefinitions?: Record<string, string>;
|
2020-03-02 11:06:16 +00:00
|
|
|
prCreation?: 'immediate' | 'not-pending' | 'status-success' | 'approval';
|
2019-12-06 14:41:59 +00:00
|
|
|
productLinks?: Record<string, string>;
|
2020-01-06 08:16:15 +00:00
|
|
|
prPriority?: number;
|
2020-03-02 11:06:16 +00:00
|
|
|
rebaseLabel?: string;
|
2020-02-22 15:31:50 +00:00
|
|
|
rebaseWhen?: string;
|
2019-12-06 14:41:59 +00:00
|
|
|
recreateClosed?: boolean;
|
2020-06-29 13:51:22 +00:00
|
|
|
repository?: string;
|
|
|
|
repositoryCache?: RepositoryCacheConfig;
|
2019-12-06 14:41:59 +00:00
|
|
|
requiredStatusChecks?: string[];
|
2020-01-06 08:16:15 +00:00
|
|
|
schedule?: string[];
|
2020-09-11 11:15:04 +00:00
|
|
|
semanticCommits?: 'auto' | 'enabled' | 'disabled';
|
2019-10-04 07:36:07 +00:00
|
|
|
semanticCommitScope?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
semanticCommitType?: string;
|
2020-01-06 08:16:15 +00:00
|
|
|
suppressNotifications?: string[];
|
2019-12-06 14:41:59 +00:00
|
|
|
timezone?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
unicodeEmoji?: boolean;
|
|
|
|
}
|
|
|
|
|
2021-02-05 08:20:47 +00:00
|
|
|
export interface RepoAdminConfig {
|
|
|
|
dockerImagePrefix?: string;
|
|
|
|
dockerUser?: string;
|
|
|
|
}
|
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
export interface RenovateAdminConfig {
|
2020-11-10 13:25:37 +00:00
|
|
|
allowPostUpgradeCommandTemplating?: boolean;
|
2020-02-04 05:59:13 +00:00
|
|
|
allowedPostUpgradeCommands?: string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
autodiscover?: boolean;
|
|
|
|
autodiscoverFilter?: string;
|
|
|
|
|
|
|
|
baseDir?: string;
|
|
|
|
cacheDir?: string;
|
|
|
|
configWarningReuseIssue?: boolean;
|
2020-09-08 10:59:47 +00:00
|
|
|
|
2021-01-19 08:11:45 +00:00
|
|
|
customEnvVariables?: Record<string, string>;
|
2020-09-08 10:59:47 +00:00
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
dryRun?: boolean;
|
2020-12-18 14:33:21 +00:00
|
|
|
|
2020-04-14 05:05:30 +00:00
|
|
|
endpoint?: string;
|
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
localDir?: string;
|
|
|
|
logFile?: string;
|
|
|
|
logFileLevel?: LogLevel;
|
|
|
|
logLevel?: LogLevel;
|
|
|
|
logContext?: string;
|
|
|
|
|
|
|
|
onboarding?: boolean;
|
|
|
|
onboardingBranch?: string;
|
2020-08-26 13:00:45 +00:00
|
|
|
onboardingCommitMessage?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
onboardingPrTitle?: string;
|
|
|
|
onboardingConfig?: RenovateSharedConfig;
|
2020-12-07 09:14:46 +00:00
|
|
|
onboardingConfigFileName?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
|
2020-04-14 05:05:30 +00:00
|
|
|
platform?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
postUpdateOptions?: string[];
|
|
|
|
privateKey?: string | Buffer;
|
2020-09-07 06:42:33 +00:00
|
|
|
privateKeyPath?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
repositories?: RenovateRepository[];
|
|
|
|
requireConfig?: boolean;
|
|
|
|
trustLevel?: 'low' | 'high';
|
2020-05-25 08:23:32 +00:00
|
|
|
redisUrl?: string;
|
2020-05-29 10:46:21 +00:00
|
|
|
gitPrivateKey?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
}
|
|
|
|
|
2020-02-04 05:59:13 +00:00
|
|
|
export type PostUpgradeTasks = {
|
|
|
|
commands?: string[];
|
|
|
|
fileFilters?: string[];
|
|
|
|
};
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
type UpdateConfig<
|
|
|
|
T extends RenovateSharedConfig = RenovateSharedConfig
|
|
|
|
> = Partial<Record<UpdateType, T>>;
|
|
|
|
|
2019-11-26 13:05:25 +00:00
|
|
|
export type RenovateRepository =
|
|
|
|
| string
|
|
|
|
| {
|
|
|
|
repository: string;
|
|
|
|
};
|
|
|
|
|
2020-03-06 08:07:55 +00:00
|
|
|
export interface CustomManager {
|
2020-05-03 14:57:17 +00:00
|
|
|
fileMatch: string[];
|
2020-03-06 08:07:55 +00:00
|
|
|
matchStrings: string[];
|
2020-11-27 05:55:57 +00:00
|
|
|
matchStringsStrategy?: string;
|
2020-03-06 08:07:55 +00:00
|
|
|
depNameTemplate?: string;
|
|
|
|
datasourceTemplate?: string;
|
|
|
|
lookupNameTemplate?: string;
|
|
|
|
versioningTemplate?: string;
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
// TODO: Proper typings
|
|
|
|
export interface RenovateConfig
|
2020-03-02 11:06:16 +00:00
|
|
|
extends RenovateAdminConfig,
|
|
|
|
RenovateSharedConfig,
|
2019-08-23 13:46:31 +00:00
|
|
|
UpdateConfig<PackageRule>,
|
2020-05-30 05:15:08 +00:00
|
|
|
AssigneesAndReviewersConfig,
|
2020-03-02 11:06:16 +00:00
|
|
|
Record<string, unknown> {
|
2020-05-06 07:56:52 +00:00
|
|
|
depName?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
baseBranches?: string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
baseBranch?: string;
|
2020-07-12 19:30:11 +00:00
|
|
|
defaultBranch?: string;
|
2019-10-04 07:36:07 +00:00
|
|
|
branchList?: string[];
|
2020-04-29 12:27:33 +00:00
|
|
|
description?: string | string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
errors?: ValidationMessage[];
|
2019-12-17 05:56:42 +00:00
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
gitAuthor?: string;
|
2019-12-17 05:56:42 +00:00
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
hostRules?: HostRule[];
|
|
|
|
|
|
|
|
ignorePresets?: string[];
|
2019-10-04 07:36:07 +00:00
|
|
|
includeForks?: boolean;
|
|
|
|
isFork?: boolean;
|
2020-03-02 11:06:16 +00:00
|
|
|
|
2020-05-03 15:03:23 +00:00
|
|
|
fileList?: string[];
|
|
|
|
|
2020-07-11 09:55:30 +00:00
|
|
|
dependencyDashboard?: boolean;
|
|
|
|
dependencyDashboardAutoclose?: boolean;
|
|
|
|
dependencyDashboardChecks?: Record<string, string>;
|
|
|
|
dependencyDashboardRebaseAllOpen?: boolean;
|
|
|
|
dependencyDashboardTitle?: string;
|
2020-07-23 13:35:43 +00:00
|
|
|
dependencyDashboardHeader?: string;
|
|
|
|
dependencyDashboardFooter?: string;
|
2020-04-15 08:33:00 +00:00
|
|
|
packageFile?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
packageRules?: PackageRule[];
|
2020-01-06 08:16:15 +00:00
|
|
|
prConcurrentLimit?: number;
|
|
|
|
prHourlyLimit?: number;
|
2020-11-19 10:05:56 +00:00
|
|
|
|
|
|
|
registryUrls?: string[];
|
|
|
|
|
2019-10-04 07:36:07 +00:00
|
|
|
repoIsOnboarded?: boolean;
|
2020-03-02 11:06:16 +00:00
|
|
|
|
|
|
|
updateType?: UpdateType;
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
warnings?: ValidationMessage[];
|
2020-03-02 11:06:16 +00:00
|
|
|
vulnerabilityAlerts?: RenovateSharedConfig;
|
2020-03-06 08:07:55 +00:00
|
|
|
regexManagers?: CustomManager[];
|
2020-10-19 08:05:05 +00:00
|
|
|
|
|
|
|
fetchReleaseNotes?: boolean;
|
2019-08-23 13:46:31 +00:00
|
|
|
}
|
|
|
|
|
2020-05-30 05:15:08 +00:00
|
|
|
export interface AssigneesAndReviewersConfig {
|
|
|
|
assigneesFromCodeOwners?: boolean;
|
|
|
|
assignees?: string[];
|
|
|
|
assigneesSampleSize?: number;
|
|
|
|
reviewersFromCodeOwners?: boolean;
|
|
|
|
reviewers?: string[];
|
|
|
|
reviewersSampleSize?: number;
|
|
|
|
additionalReviewers?: string[];
|
|
|
|
}
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
export type UpdateType =
|
|
|
|
| 'major'
|
|
|
|
| 'minor'
|
|
|
|
| 'patch'
|
|
|
|
| 'pin'
|
|
|
|
| 'digest'
|
|
|
|
| 'lockFileMaintenance'
|
2020-03-02 11:06:16 +00:00
|
|
|
| 'lockfileUpdate'
|
2019-08-23 13:46:31 +00:00
|
|
|
| 'rollback'
|
|
|
|
| 'bump';
|
|
|
|
|
2020-11-27 05:55:57 +00:00
|
|
|
export type MatchStringsStrategy = 'any' | 'recursive' | 'combination';
|
|
|
|
|
2019-08-23 13:46:31 +00:00
|
|
|
// TODO: Proper typings
|
|
|
|
export interface PackageRule
|
|
|
|
extends RenovateSharedConfig,
|
|
|
|
UpdateConfig,
|
|
|
|
Record<string, any> {
|
2021-01-29 10:43:42 +00:00
|
|
|
matchPaths?: string[];
|
|
|
|
matchLanguages?: string[];
|
|
|
|
matchBaseBranches?: string[];
|
|
|
|
matchManagers?: string | string[];
|
|
|
|
matchDatasources?: string[];
|
|
|
|
matchDepTypes?: string[];
|
|
|
|
matchPackageNames?: string[];
|
|
|
|
matchPackagePatterns?: string[];
|
2019-08-23 13:46:31 +00:00
|
|
|
excludePackageNames?: string[];
|
|
|
|
excludePackagePatterns?: string[];
|
|
|
|
matchCurrentVersion?: string | Range;
|
2021-01-29 10:43:42 +00:00
|
|
|
matchSourceUrlPrefixes?: string[];
|
|
|
|
matchUpdateTypes?: UpdateType[];
|
2019-08-23 13:46:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ValidationMessage {
|
|
|
|
depName: string;
|
|
|
|
message: string;
|
|
|
|
}
|