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-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 {
|
|
|
|
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;
|
2019-08-23 13:46:31 +00:00
|
|
|
enabled?: boolean;
|
2020-03-02 11:06:16 +00:00
|
|
|
enabledManagers?: 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[];
|
2019-08-23 13:46:31 +00:00
|
|
|
managers?: string | string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
masterIssueApproval?: boolean;
|
|
|
|
npmrc?: string;
|
2019-12-06 14:41:59 +00:00
|
|
|
platform?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
postUpgradeTasks?: PostUpgradeTasks;
|
|
|
|
prBodyColumns?: string[];
|
|
|
|
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;
|
|
|
|
requiredStatusChecks?: string[];
|
2020-01-06 08:16:15 +00:00
|
|
|
schedule?: string[];
|
2019-10-04 07:36:07 +00:00
|
|
|
semanticCommits?: boolean;
|
|
|
|
semanticCommitScope?: string;
|
2019-08-23 13:46:31 +00:00
|
|
|
semanticCommitType?: string;
|
2019-10-04 07:36:07 +00:00
|
|
|
statusCheckVerify?: boolean;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GlobalConfig {
|
|
|
|
prBanner?: string;
|
|
|
|
prFooter?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RenovateAdminConfig {
|
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;
|
|
|
|
dryRun?: boolean;
|
|
|
|
|
2020-04-14 05:05:30 +00:00
|
|
|
endpoint?: string;
|
|
|
|
|
2020-03-02 11:06:16 +00:00
|
|
|
global?: GlobalConfig;
|
|
|
|
|
|
|
|
localDir?: string;
|
|
|
|
logFile?: string;
|
|
|
|
logFileLevel?: LogLevel;
|
|
|
|
logLevel?: LogLevel;
|
|
|
|
logContext?: string;
|
|
|
|
|
|
|
|
onboarding?: boolean;
|
|
|
|
onboardingBranch?: string;
|
|
|
|
onboardingPrTitle?: string;
|
|
|
|
onboardingConfig?: RenovateSharedConfig;
|
|
|
|
|
2020-04-14 05:05:30 +00:00
|
|
|
platform?: string;
|
2020-03-02 11:06:16 +00:00
|
|
|
postUpdateOptions?: string[];
|
|
|
|
privateKey?: string | Buffer;
|
|
|
|
repositories?: RenovateRepository[];
|
|
|
|
requireConfig?: boolean;
|
|
|
|
trustLevel?: 'low' | 'high';
|
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[];
|
|
|
|
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-03-02 11:06:16 +00:00
|
|
|
Record<string, unknown> {
|
2019-08-23 13:46:31 +00:00
|
|
|
baseBranches?: string[];
|
2020-03-02 11:06:16 +00:00
|
|
|
baseBranch?: string;
|
2020-05-03 18:38:09 +00:00
|
|
|
baseBranchSha?: 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[];
|
2020-03-02 11:06:16 +00:00
|
|
|
extends?: string[];
|
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-03-02 11:06:16 +00:00
|
|
|
masterIssue?: boolean;
|
|
|
|
masterIssueAutoclose?: boolean;
|
|
|
|
masterIssueChecks?: Record<string, string>;
|
|
|
|
masterIssueRebaseAllOpen?: boolean;
|
|
|
|
masterIssueTitle?: 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;
|
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[];
|
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';
|
|
|
|
|
|
|
|
// TODO: Proper typings
|
|
|
|
export interface PackageRule
|
|
|
|
extends RenovateSharedConfig,
|
|
|
|
UpdateConfig,
|
|
|
|
Record<string, any> {
|
|
|
|
paths?: string[];
|
|
|
|
languages?: string[];
|
|
|
|
baseBranchList?: string[];
|
|
|
|
datasources?: string[];
|
|
|
|
depTypeList?: string[];
|
|
|
|
packageNames?: string[];
|
|
|
|
packagePatterns?: string[];
|
|
|
|
excludePackageNames?: string[];
|
|
|
|
excludePackagePatterns?: string[];
|
|
|
|
matchCurrentVersion?: string | Range;
|
|
|
|
sourceUrlPrefixes?: string[];
|
|
|
|
|
|
|
|
updateTypes?: UpdateType[];
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ValidationMessage {
|
|
|
|
depName: string;
|
|
|
|
message: string;
|
|
|
|
}
|