fix: drop configurable appName (#4931)

This commit is contained in:
Rhys Arkins 2019-12-05 11:55:14 +01:00 committed by GitHub
parent 1c33d1c101
commit 2adad0dae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 50 additions and 68 deletions

View file

@ -1,5 +1,3 @@
export const appName = 'Renovate';
export const configFileNames = [
'renovate.json',
'renovate.json5',

View file

@ -1,4 +1,3 @@
import { appName } from './app-strings';
import { RenovateConfigStage } from './common';
export interface RenovateOptionBase {
@ -143,7 +142,7 @@ const options: RenovateOptions[] = [
},
{
name: 'enabled',
description: `Enable or disable ${appName}`,
description: `Enable or disable the bot`,
stage: 'package',
type: 'boolean',
cli: false,
@ -319,7 +318,7 @@ const options: RenovateOptions[] = [
name: 'masterIssueTitle',
description: 'Title to use for the Master Issue',
type: 'string',
default: `Update Dependencies (${appName} Bot)`,
default: `Update Dependencies (Renovate Bot)`,
},
{
name: 'configWarningReuseIssue',

View file

@ -15,7 +15,7 @@ import {
VulnerabilityAlert,
} from '../common';
import { appName, configFileNames } from '../../config/app-strings';
import { configFileNames } from '../../config/app-strings';
import { sanitize } from '../../util/sanitize';
import { smartTruncate } from '../utils/pr-body';
@ -1641,7 +1641,7 @@ export async function createPr(
await setBranchStatus(
branchName,
`renovate/verify`,
`${appName} verified pull request`,
`Renovate verified pull request`,
'success',
'https://github.com/renovatebot/renovate'
);

View file

@ -1,14 +1,12 @@
import { appName } from '../../config/app-strings';
export function smartTruncate(input: string, len: number): string {
if (input.length < len) {
return input;
}
const releaseNotesMatch = input.match(
new RegExp(`### Release Notes.*### ${appName} configuration`, 'ms')
new RegExp(`### Release Notes.*### Renovate configuration`, 'ms')
);
if (releaseNotesMatch) {
const divider = `</details>\n\n---\n\n### ${appName} configuration`;
const divider = `</details>\n\n---\n\n### Renovate configuration`;
const [releaseNotes] = releaseNotesMatch;
const nonReleaseNotesLength =
input.length - releaseNotes.length - divider.length;

View file

@ -18,7 +18,6 @@ import {
} from './status-checks';
import { prAlreadyExisted } from './check-existing';
import { ensurePr, checkAutoMerge } from '../pr';
import { appName } from '../../config/app-strings';
import { RenovateConfig } from '../../config';
import { platform } from '../../platform';
import { emojify } from '../../util/emoji';
@ -97,14 +96,14 @@ export async function processBranch(
'Closed PR already exists. Skipping branch.'
);
if (existingPr.state === 'closed') {
const subject = `${appName} Ignore Notification`;
const subject = `Renovate Ignore Notification`;
let content;
if (config.updateType === 'major') {
content = `As this PR has been closed unmerged, ${appName} will ignore this upgrade and you will not receive PRs for *any* future ${config.newMajor}.x releases. However, if you upgrade to ${config.newMajor}.x manually then ${appName} will then reenable updates for minor and patch updates automatically.`;
content = `As this PR has been closed unmerged, Renovate will ignore this upgrade and you will not receive PRs for *any* future ${config.newMajor}.x releases. However, if you upgrade to ${config.newMajor}.x manually then Renovate will then reenable updates for minor and patch updates automatically.`;
} else if (config.updateType === 'digest') {
content = `As this PR has been closed unmerged, ${appName} will ignore this upgrade updateType and you will not receive PRs for *any* future ${config.depName}:${config.currentValue} digest updates. Digest updates will resume if you update the specified tag at any time.`;
content = `As this PR has been closed unmerged, Renovate will ignore this upgrade updateType and you will not receive PRs for *any* future ${config.depName}:${config.currentValue} digest updates. Digest updates will resume if you update the specified tag at any time.`;
} else {
content = `As this PR has been closed unmerged, ${appName} will now ignore this update (${config.newValue}). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the \`ignoreDeps\` array of your renovate config.`;
content = `As this PR has been closed unmerged, Renovate will now ignore this update (${config.newValue}). You will still receive a PR once a newer version is released, so if you wish to permanently ignore this dependency, please add it to the \`ignoreDeps\` array of your renovate config.`;
}
content +=
'\n\nIf this PR was closed by mistake or you changed your mind, you can simply rename this PR and you will soon get a fresh replacement PR opened.';
@ -180,9 +179,9 @@ export async function processBranch(
}
} else {
let content = emojify(
`:construction_worker: This PR has received other commits, so ${appName} will stop updating it to avoid conflicts or other problems.`
`:construction_worker: This PR has received other commits, so Renovate will stop updating it to avoid conflicts or other problems.`
);
content += ` If you wish to abandon your changes and have ${appName} start over you may click the "rebase" checkbox in the PR body/description.`;
content += ` If you wish to abandon your changes and have Renovate start over you may click the "rebase" checkbox in the PR body/description.`;
if (!config.suppressNotifications.includes('prEditNotification')) {
if (config.dryRun) {
logger.info(
@ -467,13 +466,13 @@ export async function processBranch(
{ artifactErrors: config.artifactErrors },
'artifactErrors'
);
let content = `${appName} failed to update `;
let content = `Renovate failed to update `;
content +=
config.artifactErrors.length > 1 ? 'artifacts' : 'an artifact';
content +=
' related to this branch. You probably do not want to merge this PR as-is.';
content += emojify(
`\n\n:recycle: ${appName} will retry this branch, including artifacts, only when one of the following happens:\n\n`
`\n\n:recycle: Renovate will retry this branch, including artifacts, only when one of the following happens:\n\n`
);
content +=
' - any of the package files in this branch needs updating, or \n';

View file

@ -7,7 +7,6 @@ import { logger, setMeta, getErrors } from '../../logger';
import * as configParser from '../../config';
import * as repositoryWorker from '../repository';
import * as cache from './cache';
import { appName } from '../../config/app-strings';
import { autodiscoverRepositories } from './autodiscover';
import { initPlatform } from '../../platform';
import * as hostRules from '../../util/host-rules';
@ -106,7 +105,7 @@ export async function start(): Promise<0 | 1> {
}
setMeta({});
printStats();
logger.info(`${appName} finished`);
logger.info(`Renovate finished`);
} catch (err) /* istanbul ignore next */ {
if (err.message.startsWith('Init: ')) {
logger.fatal(err.message.substring(6));

View file

@ -1,4 +1,3 @@
const { appName } = require('../../../config/app-strings');
const { platform } = require('../../../platform');
const { emojify } = require('../../../util/emoji');
@ -7,7 +6,7 @@ module.exports = {
};
async function getPrConfigDescription(config) {
let prBody = `\n\n---\n\n### ${appName} configuration\n\n`;
let prBody = `\n\n---\n\n### Renovate configuration\n\n`;
prBody += emojify(`:date: **Schedule**: `);
if (
config.schedule &&

View file

@ -3,7 +3,6 @@ import is from '@sindresorhus/is';
const handlebars = require('handlebars');
const { logger } = require('../../../logger');
const { appName } = require('../../../config/app-strings');
const { emojify } = require('../../../util/emoji');
export function getPrNotes(config) {
@ -44,7 +43,7 @@ export function getPrExtraNotes(config) {
if (config.isPin) {
res += emojify(
`:pushpin: **Important**: ${appName} will wait until you have merged this Pin PR before creating any *upgrade* PRs for the affected packages. Add the preset \`:preserveSemverRanges\` your config if you instead don't wish to pin dependencies.\n\n`
`:pushpin: **Important**: Renovate will wait until you have merged this Pin PR before creating any *upgrade* PRs for the affected packages. Add the preset \`:preserveSemverRanges\` your config if you instead don't wish to pin dependencies.\n\n`
);
}

View file

@ -1,5 +1,4 @@
const { logger } = require('../../logger');
const { appName } = require('../../config/app-strings');
const { platform } = require('../../platform');
module.exports = {
@ -8,7 +7,7 @@ module.exports = {
async function raiseConfigWarningIssue(config, error) {
logger.debug('raiseConfigWarningIssue()');
let body = `There is an error with this repository's ${appName} configuration that needs to be fixed. As a precaution, ${appName} will stop PRs until it is resolved.\n\n`;
let body = `There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.\n\n`;
if (error.configFile) {
body += `File: \`${error.configFile}\`\n`;
}
@ -19,8 +18,8 @@ async function raiseConfigWarningIssue(config, error) {
const pr = await platform.getBranchPr(config.onboardingBranch);
if (pr && pr.state && pr.state.startsWith('open')) {
logger.info('Updating onboarding PR with config error notice');
body = `## Action Required: Fix ${appName} Configuration\n\n${body}`;
body += `\n\nOnce you have resolved this problem (in this onboarding branch), ${appName} will return to providing you with a preview of your repository's configuration.`;
body = `## Action Required: Fix Renovate Configuration\n\n${body}`;
body += `\n\nOnce you have resolved this problem (in this onboarding branch), Renovate will return to providing you with a preview of your repository's configuration.`;
if (config.dryRun) {
logger.info('DRY-RUN: Would update PR #' + pr.number);
} else await platform.updatePr(pr.number, config.onboardingPrTitle, body);
@ -30,7 +29,7 @@ async function raiseConfigWarningIssue(config, error) {
const once = false;
const shouldReopen = config.configWarningReuseIssue;
const res = await platform.ensureIssue(
`Action Required: Fix ${appName} Configuration`,
`Action Required: Fix Renovate Configuration`,
body,
once,
shouldReopen

View file

@ -1,6 +1,5 @@
const { validatePrs } = require('./validate');
const { pruneStaleBranches } = require('./prune');
const { appName } = require('../../../config/app-strings');
const { platform } = require('../../../platform');
module.exports = {
@ -13,6 +12,6 @@ async function finaliseRepo(config, branchList) {
await validatePrs(config);
await pruneStaleBranches(config, branchList);
await platform.ensureIssueClosing(
`Action Required: Fix ${appName} Configuration`
`Action Required: Fix Renovate Configuration`
);
}

View file

@ -2,7 +2,6 @@ const JSON5 = require('json5');
const { logger, setMeta } = require('../../../logger');
const { migrateAndValidate } = require('../../../config/migrate-validate');
const { configFileNames } = require('../../../config/app-strings');
const { appName } = require('../../../config/app-strings');
const { platform } = require('../../../platform');
async function getRenovatePrs(branchPrefix) {
@ -28,7 +27,7 @@ async function validatePrs(config) {
setMeta({ repository: config.repository });
logger.debug('branchPrefix: ' + config.branchPrefix);
const renovatePrs = await getRenovatePrs(config.branchPrefix);
logger.debug({ renovatePrs }, `Found ${renovatePrs.length} ${appName} PRs`);
logger.debug({ renovatePrs }, `Found ${renovatePrs.length} Renovate PRs`);
let validations = [];
for (const pr of renovatePrs) {
try {
@ -84,16 +83,16 @@ async function validatePrs(config) {
// if the PR has renovate files then we set a status no matter what
let status;
let description;
const subject = `${appName} Configuration Errors`;
const subject = `Renovate Configuration Errors`;
if (validations.length) {
const content = validations
.map(v => `\`${v.file}\`: ${v.message}`)
.join('\n\n');
await platform.ensureComment(pr.number, subject, content);
status = 'failure';
description = `${appName} config validation failed`; // GitHub limit
description = `Renovate config validation failed`; // GitHub limit
} else {
description = `${appName} config is valid`;
description = `Renovate config is valid`;
status = 'success';
await platform.ensureCommentRemoval(pr.number, subject);
}

View file

@ -1,5 +1,4 @@
const { logger } = require('../../logger');
const { appName } = require('../../config/app-strings');
const { platform } = require('../../platform');
module.exports = {
@ -62,13 +61,13 @@ async function ensureMasterIssue(config, branches) {
}
return;
}
let issueBody = `This [master issue](https://renovatebot.com/blog/master-issue) contains a list of ${appName} updates and their statuses.\n\n`;
let issueBody = `This [master issue](https://renovatebot.com/blog/master-issue) contains a list of Renovate updates and their statuses.\n\n`;
const pendingApprovals = branches.filter(
branch => branch.res === 'needs-approval'
);
if (pendingApprovals.length) {
issueBody += '## Pending Approval\n\n';
issueBody += `These branches will be created by ${appName} only once you click their checkbox below.\n\n`;
issueBody += `These branches will be created by Renovate only once you click their checkbox below.\n\n`;
for (const branch of pendingApprovals) {
issueBody += getListItem(branch, 'approve');
}
@ -125,7 +124,7 @@ async function ensureMasterIssue(config, branches) {
const prEdited = branches.filter(branch => branch.res === 'pr-edited');
if (prEdited.length) {
issueBody += '## Edited/Blocked\n\n';
issueBody += `These updates have been manually edited so ${appName} will no longer make changes. To discard all commits and start over, check the box below.\n\n`;
issueBody += `These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, check the box below.\n\n`;
for (const branch of prEdited) {
const pr = await platform.getBranchPr(branch.branchName);
issueBody += getListItem(branch, 'rebase', pr);

View file

@ -1,6 +1,6 @@
import { logger } from '../../../../logger';
import { platform } from '../../../../platform';
import { appName, configFileNames } from '../../../../config/app-strings';
import { configFileNames } from '../../../../config/app-strings';
import { RenovateConfig } from '../../../../config';
const findFile = async (fileName: string): Promise<boolean> => {
@ -38,7 +38,7 @@ const closedPrExists = (config: RenovateConfig): Promise<Pr> =>
export const isOnboarded = async (config: RenovateConfig): Promise<boolean> => {
logger.debug('isOnboarded()');
const title = `Action required: Add a ${appName} config`;
const title = `Action required: Add a Renovate config`;
// Repo is onboarded if admin is bypassing onboarding and does not require a
// configuration file.
if (config.requireConfig === false && config.onboarding === false) {
@ -78,8 +78,8 @@ export const isOnboarded = async (config: RenovateConfig): Promise<boolean> => {
// ensure PR comment
await platform.ensureComment(
pr.number,
`${appName} is disabled`,
`${appName} is disabled due to lack of config. If you wish to reenable it, you can either (a) commit a config file to your base branch, or (b) rename this closed PR to trigger a replacement onboarding PR.`
`Renovate is disabled`,
`Renovate is disabled due to lack of config. If you wish to reenable it, you can either (a) commit a config file to your base branch, or (b) rename this closed PR to trigger a replacement onboarding PR.`
);
}
throw new Error('disabled');

View file

@ -1,9 +1,8 @@
import { appName } from '../../../../config/app-strings';
import { RenovateConfig } from '../../../../config';
export function getBaseBranchDesc(config: RenovateConfig): string {
// Describe base branch only if it's configured
return config.baseBranch
? `You have configured ${appName} to use branch \`${config.baseBranch}\` as base branch.\n\n`
? `You have configured Renovate to use branch \`${config.baseBranch}\` as base branch.\n\n`
: '';
}

View file

@ -1,6 +1,6 @@
import { emojify } from '../../../../util/emoji';
import { logger } from '../../../../logger';
import { appName, configFileNames } from '../../../../config/app-strings';
import { configFileNames } from '../../../../config/app-strings';
import { RenovateConfig } from '../../../../config';
import { PackageFile } from '../../../../manager/common';
@ -17,7 +17,7 @@ export function getScheduleDesc(config: RenovateConfig): string[] {
logger.debug('No schedule');
return [];
}
const desc = `Run ${appName} on following schedule: ${config.schedule}`;
const desc = `Run Renovate on following schedule: ${config.schedule}`;
return [desc];
}
@ -49,16 +49,16 @@ export function getConfigDesc(
) {
descriptionArr = descriptionArr.filter(val => !val.includes('Docker-only'));
}
let desc = `\n### Configuration Summary\n\nBased on the default config's presets, ${appName} will:\n\n`;
let desc = `\n### Configuration Summary\n\nBased on the default config's presets, Renovate will:\n\n`;
desc += ` - Start dependency updates only once this onboarding PR is merged\n`;
descriptionArr.forEach(d => {
desc += ` - ${d}\n`;
});
desc += '\n';
desc += emojify(
`:abcd: Would you like to change the way ${appName} is upgrading your dependencies?`
`:abcd: Would you like to change the way Renovate is upgrading your dependencies?`
);
desc += ` Simply edit the \`${defaultConfigFile}\` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time ${appName} runs.`;
desc += ` Simply edit the \`${defaultConfigFile}\` in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.`;
desc += '\n\n---\n';
return desc;
}

View file

@ -1,6 +1,5 @@
import { emojify } from '../../../../util/emoji';
import { logger } from '../../../../logger';
import { appName } from '../../../../config/app-strings';
import { RenovateConfig } from '../../../../config';
import { PackageFile } from '../../../../manager/common';
@ -23,7 +22,7 @@ export function getErrors(config: RenovateConfig): string {
return '';
}
errorText = `\n# Errors (${config.errors.length})\n\n`;
errorText += `${appName} has found errors that you should fix (in this branch) before finishing this PR.\n\n`;
errorText += `Renovate has found errors that you should fix (in this branch) before finishing this PR.\n\n`;
config.errors.forEach(e => {
errorText += `- \`${e.depName}\`: ${e.message}\n`;
});

View file

@ -5,7 +5,6 @@ import { getConfigDesc } from './config-description';
import { getErrors, getWarnings, getDepWarnings } from './errors-warnings';
import { getBaseBranchDesc } from './base-branch';
import { getPrList, BranchConfig } from './pr-list';
import { appName } from '../../../../config/app-strings';
import { emojify } from '../../../../util/emoji';
import { RenovateConfig } from '../../../../config';
import { PackageFile } from '../../../../manager/common';
@ -22,13 +21,13 @@ export async function ensureOnboardingPr(
logger.trace({ config });
const existingPr = await platform.getBranchPr(config.onboardingBranch);
logger.debug('Filling in onboarding PR template');
let prTemplate = `Welcome to [${appName}](${config.productLinks.homepage})! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.\n\n`;
let prTemplate = `Welcome to [Renovate](${config.productLinks.homepage})! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.\n\n`;
prTemplate += config.requireConfig
? emojify(
`:vertical_traffic_light: To activate ${appName}, merge this Pull Request. To disable ${appName}, simply close this Pull Request unmerged.\n\n`
`:vertical_traffic_light: To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.\n\n`
)
: emojify(
`:vertical_traffic_light: ${appName} will begin keeping your dependencies up-to-date only once you merge or close this Pull Request.\n\n`
`:vertical_traffic_light: Renovate will begin keeping your dependencies up-to-date only once you merge or close this Pull Request.\n\n`
);
prTemplate += emojify(
`
@ -43,7 +42,7 @@ export async function ensureOnboardingPr(
---
:question: Got questions? Check out ${appName}'s [Docs](${config.productLinks.documentation}), particularly the Getting Started section.
:question: Got questions? Check out Renovate's [Docs](${config.productLinks.documentation}), particularly the Getting Started section.
If you need any further assistance then you can also [request help here](${config.productLinks.help}).
`
);
@ -68,14 +67,14 @@ If you need any further assistance then you can also [request help here](${confi
configDesc = getConfigDesc(config, packageFiles);
} else {
configDesc = emojify(
`### Configuration\n\n:abcd: ${appName} has detected a custom config for this PR. Feel free to ask for [help](${config.productLinks.help}) if you have any doubts and would like it reviewed.\n\n`
`### Configuration\n\n:abcd: Renovate has detected a custom config for this PR. Feel free to ask for [help](${config.productLinks.help}) if you have any doubts and would like it reviewed.\n\n`
);
if (existingPr.isConflicted) {
configDesc += emojify(
`:warning: This PR has a merge conflict, however ${appName} is unable to automatically fix that due to edits in this branch. Please resolve the merge conflict manually.\n\n`
`:warning: This PR has a merge conflict, however Renovate is unable to automatically fix that due to edits in this branch. Please resolve the merge conflict manually.\n\n`
);
} else {
configDesc += `Important: Now that this branch is edited, ${appName} can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.\n\n`;
configDesc += `Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.\n\n`;
}
}
prBody = prBody.replace('{{CONFIG}}\n', configDesc);

View file

@ -1,6 +1,5 @@
import { emojify } from '../../../../util/emoji';
import { logger } from '../../../../logger';
import { appName } from '../../../../config/app-strings';
import { RenovateConfig } from '../../../../config';
import { Upgrade } from '../../../../manager/common';
@ -22,7 +21,7 @@ export function getPrList(
if (!branches.length) {
return `${prDesc}It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.\n`;
}
prDesc += `With your current configuration, ${appName} will create ${branches.length} Pull Request`;
prDesc += `With your current configuration, Renovate will create ${branches.length} Pull Request`;
prDesc += branches.length > 1 ? `s:\n\n` : `:\n\n`;
for (const branch of branches) {

View file

@ -1,7 +1,6 @@
const { logger, setMeta } = require('../../../logger');
const { mergeChildConfig } = require('../../../config');
const { extractAndUpdate } = require('./extract-update');
const { appName } = require('../../../config/app-strings');
const { platform } = require('../../../platform');
module.exports = {
@ -23,7 +22,7 @@ async function processRepo(config) {
))
) {
config.masterIssueTitle =
config.masterIssueTitle || `Update Dependencies (${appName} Bot)`;
config.masterIssueTitle || `Update Dependencies (Renovate Bot)`;
const issue = await platform.findIssue(config.masterIssueTitle);
if (issue) {
const checkMatch = ' - \\[x\\] <!-- ([a-zA-Z]+)-branch=([^\\s]+) -->';

View file

@ -49,7 +49,7 @@
}
},
"enabled": {
"description": "Enable or disable Renovate",
"description": "Enable or disable the bot",
"type": "boolean"
},
"force": {