diff --git a/lib/config/app-strings.ts b/lib/config/app-strings.ts index bc3fb3f0c93d193a5a166058ca04fffbfeaca3ed..8c3758d402b9894c161754b18dddd8789e177b04 100644 --- a/lib/config/app-strings.ts +++ b/lib/config/app-strings.ts @@ -1,7 +1,5 @@ export const appName = 'Renovate'; -export const appSlug = 'renovate'; - export const configFileNames = [ 'renovate.json', 'renovate.json5', diff --git a/lib/config/definitions.ts b/lib/config/definitions.ts index 3ea310b5ddc065694c0c362dc794199ec99d73ac..64622fea1fa126dcac7c0023d33c2b2dde42f7ce 100644 --- a/lib/config/definitions.ts +++ b/lib/config/definitions.ts @@ -1,4 +1,4 @@ -import { appName, appSlug } from './app-strings'; +import { appName } from './app-strings'; import { RenovateConfigStage } from './common'; export interface RenovateOptionBase { @@ -906,7 +906,7 @@ const options: RenovateOptions[] = [ description: 'Prefix to use for all branch names', stage: 'branch', type: 'string', - default: `${appSlug}/`, + default: `renovate/`, }, { name: 'bumpVersion', diff --git a/lib/platform/azure/index.ts b/lib/platform/azure/index.ts index 57f6226219df90bf1c8dd79f3a995660c49be094..8c8c70cde360b3dc104259bcc73d02576ec59873 100644 --- a/lib/platform/azure/index.ts +++ b/lib/platform/azure/index.ts @@ -3,7 +3,6 @@ import { GitPullRequestMergeStrategy } from 'azure-devops-node-api/interfaces/Gi import * as azureHelper from './azure-helper'; import * as azureApi from './azure-got-wrapper'; import * as hostRules from '../../util/host-rules'; -import { appSlug } from '../../config/app-strings'; import GitStorage, { StatusResult, File } from '../git/storage'; import { logger } from '../../logger'; import { @@ -519,7 +518,7 @@ export async function mergePr(pr: number): Promise<void> { export function getPrBody(input: string): string { // Remove any HTML we use return smartTruncate(input, 4000) - .replace(new RegExp(`\n---\n\n.*?<!-- ${appSlug}-rebase -->.*?\n`), '') + .replace(new RegExp(`\n---\n\n.*?<!-- rebase-check -->.*?\n`), '') .replace('<summary>', '**') .replace('</summary>', '**') .replace('<details>', '') diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts index c99f5bbf5bee9611a42a71f0eae02dcfd60175b9..c1491ca7738bc14ee98b5842540cebdd1412ea8a 100644 --- a/lib/platform/bitbucket/index.ts +++ b/lib/platform/bitbucket/index.ts @@ -6,7 +6,6 @@ import * as hostRules from '../../util/host-rules'; import { logger } from '../../logger'; import GitStorage, { StatusResult, File } from '../git/storage'; import { readOnlyIssueBody } from '../utils/read-only-issue-body'; -import { appSlug } from '../../config/app-strings'; import * as comments from './comments'; import { PlatformConfig, @@ -517,7 +516,7 @@ export function getPrBody(input: string): string { return smartTruncate(input, 50000) .replace(/<\/?summary>/g, '**') .replace(/<\/?details>/g, '') - .replace(new RegExp(`\n---\n\n.*?<!-- ${appSlug}-rebase -->.*?\n`), '') + .replace(new RegExp(`\n---\n\n.*?<!-- rebase-check -->.*?\n`), '') .replace(/\]\(\.\.\/pull\//g, '](../../pull-requests/'); } diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index 8ccb406abb89a63ad91e43e1523628e55d1f7349..80e2055d01b96d821a726f158679f680d135a8bb 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -15,7 +15,7 @@ import { VulnerabilityAlert, } from '../common'; -import { appName, appSlug, configFileNames } from '../../config/app-strings'; +import { appName, configFileNames } from '../../config/app-strings'; import { sanitize } from '../../util/sanitize'; import { smartTruncate } from '../utils/pr-body'; @@ -1640,7 +1640,7 @@ export async function createPr( logger.debug('Setting statusCheckVerify'); await setBranchStatus( branchName, - `${appSlug}/verify`, + `renovate/verify`, `${appName} verified pull request`, 'success', 'https://github.com/renovatebot/renovate' diff --git a/lib/workers/branch/index.ts b/lib/workers/branch/index.ts index b4dcdc07a8138612f0ced83a84051b367b1a1bf2..48144399bda7654586739e6a6d89bd7c66e9e1d9 100644 --- a/lib/workers/branch/index.ts +++ b/lib/workers/branch/index.ts @@ -18,7 +18,7 @@ import { } from './status-checks'; import { prAlreadyExisted } from './check-existing'; import { ensurePr, checkAutoMerge } from '../pr'; -import { appName, appSlug } from '../../config/app-strings'; +import { appName } from '../../config/app-strings'; import { RenovateConfig } from '../../config'; import { platform } from '../../platform'; import { emojify } from '../../util/emoji'; @@ -48,7 +48,7 @@ function rebaseCheck(config: RenovateConfig, branchPr: any): boolean { const labelRebase = branchPr.labels && branchPr.labels.includes(config.rebaseLabel); const prRebaseChecked = - branchPr.body && branchPr.body.includes(`- [x] <!-- ${appSlug}-rebase -->`); + branchPr.body && branchPr.body.includes(`- [x] <!-- rebase-check -->`); return titleRebase || labelRebase || prRebaseChecked; } @@ -507,7 +507,7 @@ export async function processBranch( ); } } - const context = `${appSlug}/artifacts`; + const context = `renovate/artifacts`; const description = 'Artifact file update failure'; const state = 'failure'; const existingState = await platform.getBranchStatusCheck( diff --git a/lib/workers/branch/parent.ts b/lib/workers/branch/parent.ts index 4ca6e2a0d317f4964c75b31c000851e23b0aaf09..7c1a4ea331c9a1917104f20a667b3d6d05bf791c 100644 --- a/lib/workers/branch/parent.ts +++ b/lib/workers/branch/parent.ts @@ -1,5 +1,4 @@ import { logger } from '../../logger'; -import { appSlug } from '../../config/app-strings'; import { RenovateConfig } from '../../config'; import { platform } from '../../platform'; @@ -25,7 +24,7 @@ export async function getParentBranch( logger.info('Manual rebase requested via PR title for #' + pr.number); return { parentBranch: undefined }; } - if (pr.body && pr.body.includes(`- [x] <!-- ${appSlug}-rebase -->`)) { + if (pr.body && pr.body.includes(`- [x] <!-- rebase-check -->`)) { logger.info('Manual rebase requested via PR checkbox for #' + pr.number); return { parentBranch: undefined }; } diff --git a/lib/workers/branch/status-checks.ts b/lib/workers/branch/status-checks.ts index c96e15c54b2dd560866bcb1766f0955bf3cda8f9..c0d780b292eab9438dd5af84925d6eface2ffcb8 100644 --- a/lib/workers/branch/status-checks.ts +++ b/lib/workers/branch/status-checks.ts @@ -1,5 +1,4 @@ import { logger } from '../../logger'; -import { appSlug } from '../../config/app-strings'; import { RenovateConfig } from '../../config'; import { platform } from '../../platform'; @@ -38,7 +37,7 @@ export async function setStability(config: StabilityConfig): Promise<void> { if (!config.stabilityStatus) { return; } - const context = `${appSlug}/stability-days`; + const context = `renovate/stability-days`; const description = config.stabilityStatus === 'success' ? 'Updates have met stability days requirement' @@ -64,7 +63,7 @@ export async function setUnpublishable( if (!config.unpublishSafe) { return; } - const context = `${appSlug}/unpublish-safe`; + const context = `renovate/unpublish-safe`; // Set canBeUnpublished status check const state = config.canBeUnpublished ? 'pending' : 'success'; const description = config.canBeUnpublished diff --git a/lib/workers/pr/body/controls.js b/lib/workers/pr/body/controls.js index d57fdec8bdb10b53db7b47ad4f33449df71d2cae..a3cb70e1211ec456a90183b6754e0f0d3de40d1d 100644 --- a/lib/workers/pr/body/controls.js +++ b/lib/workers/pr/body/controls.js @@ -1,5 +1,3 @@ -const { appSlug } = require('../../../config/app-strings'); - export function getControls() { - return `\n\n---\n\n - [ ] <!-- ${appSlug}-rebase -->If you want to rebase/retry this PR, check this box\n\n`; + return `\n\n---\n\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box\n\n`; } diff --git a/lib/workers/repository/finalise/validate.js b/lib/workers/repository/finalise/validate.js index 099f558582a0fabc67356180760be88ebf9df829..d43405036df7960b4c59563b24f026167ce26036 100644 --- a/lib/workers/repository/finalise/validate.js +++ b/lib/workers/repository/finalise/validate.js @@ -2,14 +2,14 @@ const JSON5 = require('json5'); const { logger, setMeta } = require('../../../logger'); const { migrateAndValidate } = require('../../../config/migrate-validate'); const { configFileNames } = require('../../../config/app-strings'); -const { appName, appSlug } = require('../../../config/app-strings'); +const { appName } = require('../../../config/app-strings'); const { platform } = require('../../../platform'); async function getRenovatePrs(branchPrefix) { return (await platform.getPrList()) .filter(pr => pr.state === 'open') .filter(pr => pr.branchName && !pr.branchName.startsWith(branchPrefix)) - .filter(pr => pr.title && pr.title.match(new RegExp(appSlug, 'i'))); + .filter(pr => pr.title && pr.title.match(new RegExp('renovate', 'i'))); } async function getRenovateFiles(prNo) { @@ -100,7 +100,7 @@ async function validatePrs(config) { // istanbul ignore else if (pr.sourceRepo === config.repository) { logger.info({ status, description }, 'Setting PR validation status'); - const context = `${appSlug}/validate`; + const context = `renovate/validate`; await platform.setBranchStatus( pr.branchName, context, diff --git a/lib/workers/repository/onboarding/branch/check.ts b/lib/workers/repository/onboarding/branch/check.ts index fe3e535264072cc32feccc847d55fb1e1e7642dc..06daee97240c7e381238d9dc423d39905cc540bf 100644 --- a/lib/workers/repository/onboarding/branch/check.ts +++ b/lib/workers/repository/onboarding/branch/check.ts @@ -1,10 +1,6 @@ import { logger } from '../../../../logger'; import { platform } from '../../../../platform'; -import { - appName, - appSlug, - configFileNames, -} from '../../../../config/app-strings'; +import { appName, configFileNames } from '../../../../config/app-strings'; import { RenovateConfig } from '../../../../config'; const findFile = async (fileName: string): Promise<boolean> => { @@ -25,7 +21,7 @@ const configFileExists = async (): Promise<boolean> => { const packageJsonConfigExists = async (): Promise<boolean> => { try { const pJson = JSON.parse(await platform.getFile('package.json')); - if (pJson[appSlug]) { + if (pJson.renovate) { return true; } } catch (err) { diff --git a/lib/workers/repository/onboarding/branch/config.ts b/lib/workers/repository/onboarding/branch/config.ts index 659011ae01081f1a266db45660a8cf034a7b0f00..3366477f47709723a2685c30c5ce6cd6c589a525 100644 --- a/lib/workers/repository/onboarding/branch/config.ts +++ b/lib/workers/repository/onboarding/branch/config.ts @@ -2,7 +2,6 @@ import is from '@sindresorhus/is'; import { clone } from '../../../../util/clone'; import { platform } from '../../../../platform'; import { logger } from '../../../../logger'; -import { appSlug } from '../../../../config/app-strings'; import { RenovateConfig } from '../../../../config'; export async function getOnboardingConfig( @@ -20,13 +19,15 @@ export async function getOnboardingConfig( const { label, branchName, ignore } = greenkeeperConfig; if (label) { logger.info({ label }, 'Migrating Greenkeeper label'); - onboardingConfig.labels = [String(label).replace('greenkeeper', appSlug)]; + onboardingConfig.labels = [ + String(label).replace('greenkeeper', 'renovate'), + ]; } if (branchName) { logger.info({ branch: branchName }, 'Migrating Greenkeeper branchName'); onboardingConfig.branchName = String(branchName).replace( 'greenkeeper', - appSlug + 'renovate' ); } if (is.nonEmptyArray(ignore)) { diff --git a/test/platform/bitbucket-server/index.spec.ts b/test/platform/bitbucket-server/index.spec.ts index 75dfed7b14457805e500551cd94a9da584bd992b..bd062a410592b97bdb0bdbb758e89e5eb5164e15 100644 --- a/test/platform/bitbucket-server/index.spec.ts +++ b/test/platform/bitbucket-server/index.spec.ts @@ -693,7 +693,7 @@ describe('platform/bitbucket-server', () => { it('sanitizes HTML comments in the body', () => { const prBody = bitbucket.getPrBody(`--- -- [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box +- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box - [ ] <!-- recreate-branch=renovate/docker-renovate-renovate-16.x --><a href="/some/link">Update renovate/renovate to 16.1.2</a> --- diff --git a/test/platform/utils/__snapshots__/pr-body.spec.ts.snap b/test/platform/utils/__snapshots__/pr-body.spec.ts.snap index e96d6b3a905612fa84f79e7fb80e8c5161a1f662..862190f2dc9f0508db6d3c4e62a8227554160502 100644 --- a/test/platform/utils/__snapshots__/pr-body.spec.ts.snap +++ b/test/platform/utils/__snapshots__/pr-body.spec.ts.snap @@ -35,7 +35,7 @@ exports[`platform/utils/pr-body .smartTruncate truncates to 1000 1`] = ` ##### Features -- **docker:** AWS ECR authentication support ([#​4497](https://togi</details> +- **docker:** AWS ECR authentication support ([#​4497](https://togithu</details> --- @@ -51,7 +51,7 @@ exports[`platform/utils/pr-body .smartTruncate truncates to 1000 1`] = ` --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- diff --git a/test/platform/utils/_fixtures/pr-body.txt b/test/platform/utils/_fixtures/pr-body.txt index 44c2bdc3e052ec4142bd96da6bb19173141c5d7a..a31ef54312a4eef6d1d62dba53666d8c6099a725 100644 --- a/test/platform/utils/_fixtures/pr-body.txt +++ b/test/platform/utils/_fixtures/pr-body.txt @@ -94,7 +94,7 @@ This PR contains the following updates: --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- diff --git a/test/workers/branch/index.spec.js b/test/workers/branch/index.spec.js index 1ae2cfa5b41a3f18bed4059cf777a25e441bbe90..aeb6123a3e617940faf001b6eb544e0282cb53cb 100644 --- a/test/workers/branch/index.spec.js +++ b/test/workers/branch/index.spec.js @@ -18,7 +18,6 @@ const automerge = require('../../../lib/workers/branch/automerge'); const prWorker = require('../../../lib/workers/pr'); /** @type any */ const getUpdated = require('../../../lib/workers/branch/get-updated'); -const { appSlug } = require('../../../lib/config/app-strings'); /** @type any */ const { platform } = require('../../../lib/platform'); @@ -425,7 +424,7 @@ describe('workers/branch', () => { platform.getBranchPr.mockResolvedValueOnce({ title: 'rebase!', state: 'open', - body: `- [x] <!-- ${appSlug}-rebase -->`, + body: `- [x] <!-- rebase-check -->`, isModified: true, }); @@ -456,7 +455,7 @@ describe('workers/branch', () => { platform.getBranchPr.mockResolvedValueOnce({ title: 'rebase!', state: 'open', - body: `- [x] <!-- ${appSlug}-rebase -->`, + body: `- [x] <!-- rebase-check -->`, isModified: true, }); @@ -484,7 +483,7 @@ describe('workers/branch', () => { platform.getBranchPr.mockResolvedValueOnce({ title: 'rebase!', state: 'open', - body: `- [x] <!-- ${appSlug}-rebase -->`, + body: `- [x] <!-- rebase-check -->`, isModified: true, }); diff --git a/test/workers/branch/parent.spec.js b/test/workers/branch/parent.spec.js index b5bbfd02389c5ceaa3604168dec8e53e0d0e40a6..b87d969d3b182dc56b8e2760289eb1a58cd573b5 100644 --- a/test/workers/branch/parent.spec.js +++ b/test/workers/branch/parent.spec.js @@ -65,7 +65,7 @@ describe('workers/branch/parent', () => { platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ title: 'Update foo to v4', - body: 'blah\nblah\n- [x] <!-- renovate-rebase -->foo\n', + body: 'blah\nblah\n- [x] <!-- rebase-check -->foo\n', }); const res = await getParentBranch(config); expect(res.parentBranch).toBeUndefined(); diff --git a/test/workers/pr/__snapshots__/index.spec.ts.snap b/test/workers/pr/__snapshots__/index.spec.ts.snap index b243516b653e1a8521ce54de5567e7c672572f95..24e043961cc2b8249afa9e2142a225f8b35fa022 100644 --- a/test/workers/pr/__snapshots__/index.spec.ts.snap +++ b/test/workers/pr/__snapshots__/index.spec.ts.snap @@ -63,7 +63,7 @@ Array [ --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", Array [], false, Object { @@ -111,7 +111,7 @@ Array [ --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", Array [], false, Object { @@ -176,7 +176,7 @@ note 2 --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", Array [], false, Object { @@ -224,7 +224,7 @@ Array [ --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", Array [], false, Object { @@ -270,7 +270,7 @@ Object { --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", "displayNumber": "Existing PR", "isModified": false, "title": "Update dependency dummy to v1.1.0", @@ -312,7 +312,7 @@ Object { --- - - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box", + - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box", "displayNumber": "Existing PR", "isModified": false, "title": "wrong",