diff --git a/lib/config/definitions.js b/lib/config/definitions.js index f983ef68d9a61cf22d7ee8b22e31a480182b3e4f..7bfc318654358a94e63fd81183a08a8de040bfe2 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -130,15 +130,6 @@ const options = [ default: false, admin: true, }, - { - name: 'mirrorMode', - description: - 'Set to true to use fork mode with config in branch `renovate-config`', - stage: 'repository', - type: 'boolean', - default: false, - admin: true, - }, { name: 'requireConfig', description: 'Set to true if repositories must have a config to activate.', diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index 26e813a294c3d4574739fd38197c43bfff6202c0..305461f2a5953142771313937e2f6116b08e6eff 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -12,7 +12,6 @@ const { appName, appSlug, configFileNames, - onboardingBranch, urls, } = require('../../config/app-strings'); @@ -119,7 +118,6 @@ async function initRepo({ endpoint, forkMode, forkToken, - mirrorMode, gitAuthor, gitPrivateKey, gitFs, @@ -298,41 +296,6 @@ async function initRepo({ } await config.storage.initRepo(config); } - // istanbul ignore if - if (mirrorMode) { - logger.info('Bot is in mirrorMode'); - config.mirrorMode = true; - const parentRepo = res.body.parent.full_name; - logger.debug('Parent repo is ' + parentRepo); - const parentDefaultBranch = (await get(`repos/${repository}`)).body - .default_branch; - logger.debug('Parent default branch is ' + parentDefaultBranch); - const parentSha = (await get( - `repos/${parentRepo}/git/refs/heads/${parentDefaultBranch}` - )).body.object.sha; - logger.debug('Parent sha is ' + parentSha); - // This is a lovely "hack" by GitHub that lets us force update our fork's master - // with the base commit from the parent repository - config.baseCommitSha = await getBaseCommitSHA(); - if (parentSha !== config.baseCommitSHA) { - logger.info('Updating fork default branch'); - await get.patch( - `repos/${config.repository}/git/refs/heads/${config.baseBranch}`, - { - body: { - sha: parentSha, - force: true, - }, - } - ); - } - if (!(await branchExists('renovate-config'))) { - await config.storage.createBranch( - 'renovate-config', - config.baseCommitSHA - ); - } - } // istanbul ignore if if (gitFs) { @@ -960,12 +923,7 @@ async function createPr( useDefaultBranch, statusCheckVerify ) { - let base = useDefaultBranch ? config.defaultBranch : config.baseBranch; - // istanbul ignore if - if (config.mirrorMode && branchName === onboardingBranch) { - logger.debug('Using renovate-config as base branch for mirror config'); - base = 'renovate-config'; - } + const base = useDefaultBranch ? config.defaultBranch : config.baseBranch; // Include the repository owner to handle forkMode and regular mode const head = `${config.repository.split('/')[0]}:${branchName}`; const options = { diff --git a/lib/workers/repository/init/config.js b/lib/workers/repository/init/config.js index be428724a21a6fcfcffb1f2af69d887ee32bc6a6..da56b137704cc415e48e779c6ef4d536d759070a 100644 --- a/lib/workers/repository/init/config.js +++ b/lib/workers/repository/init/config.js @@ -7,32 +7,11 @@ const presets = require('../../../config/presets'); const npmApi = require('../../../datasource/npm'); const { flattenPackageRules } = require('./flatten'); const hostRules = require('../../../util/host-rules'); -const { - configFileNames, - onboardingBranch, -} = require('../../../config/app-strings'); - -const defaultConfigFile = configFileNames[0]; +const { configFileNames } = require('../../../config/app-strings'); // Check for repository config async function mergeRenovateConfig(config) { let returnConfig = { ...config }; - // istanbul ignore if - if (config.mirrorMode) { - logger.info('Repository is in mirror mode'); - const renovateJson = JSON.parse( - await platform.getFile( - defaultConfigFile, - config.repoIsOnboarded ? 'renovate-config' : onboardingBranch - ) - ); - logger.debug({ renovateJson }, 'mirrorMode config'); - const migratedConfig = await migrateAndValidate(config, renovateJson); - const resolvedConfig = await presets.resolveConfigPresets(migratedConfig); - returnConfig = mergeChildConfig(returnConfig, resolvedConfig); - returnConfig.renovateJsonPresent = true; - return returnConfig; - } const fileList = await platform.getFileList(); async function detectConfigFile() { for (const fileName of configFileNames) { diff --git a/lib/workers/repository/process/write.js b/lib/workers/repository/process/write.js index 9a32216c5d92d2eb500a7515ca7e7f5548090762..8382ad90c299df452bbeb04e10aef65f07afe715 100644 --- a/lib/workers/repository/process/write.js +++ b/lib/workers/repository/process/write.js @@ -15,17 +15,13 @@ async function writeUpdates(config, packageFiles, allBranches) { .sort() .join(', ')}` ); - if (!config.mirrorMode) { - branches = branches.filter(branchConfig => { - if (branchConfig.blockedByPin) { - logger.debug( - `Branch ${branchConfig.branchName} is blocked by a Pin PR` - ); - return false; - } - return true; - }); - } + branches = branches.filter(branchConfig => { + if (branchConfig.blockedByPin) { + logger.debug(`Branch ${branchConfig.branchName} is blocked by a Pin PR`); + return false; + } + return true; + }); let prsRemaining = await getPrsRemaining(config, branches); for (const branch of branches) { const res = await branchWorker.processBranch( diff --git a/website/docs/self-hosted-configuration.md b/website/docs/self-hosted-configuration.md index e537f9ee4bb2acf2b08aace88998ba48d2a52b2d..b8b7ee0e4b0957d9d777a1d1f3b755363d08cc52 100644 --- a/website/docs/self-hosted-configuration.md +++ b/website/docs/self-hosted-configuration.md @@ -50,10 +50,6 @@ Set it to a string specifing the transport used by Git (`https`, `http` or `ssh` ## logLevel -## mirrorMode - -You probably have no need for this option - it is an experimental setting for the Renovate hosted GitHub App. - ## onboarding Set this to `false` if (a) you configure Renovate entirely on the bot side (i.e. empty `renovate.json` in repositories) and (b) you wish to run Renovate on every repository the bot has access to, and (c) you wish to skip the onboarding PRs.