diff --git a/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap b/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap index ef33c27800cd4f0a2126cd1cfead3155234354de..4e39cee3d113b40d6a2cb1f2b101c147e125d5fc 100644 --- a/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/process/lookup/__snapshots__/index.spec.ts.snap @@ -881,126 +881,6 @@ Array [ ] `; -exports[`workers/repository/process/lookup .lookupUpdates() returns only one update if automerging 1`] = ` -Array [ - Object { - "fromVersion": "0.4.0", - "isSingleVersion": true, - "newMajor": 1, - "newMinor": 4, - "newValue": "1.4.1", - "releaseTimestamp": "2015-05-17T04:25:07.299Z", - "skippedOverVersions": Array [ - "0.4.1", - "0.4.2", - "0.4.4", - "0.5.0", - "0.5.1", - "0.5.2", - "0.5.3", - "0.6.0", - "0.7.0", - "0.7.1", - "0.7.2", - "0.8.0", - "0.8.1", - "0.8.2", - "0.8.3", - "0.8.4", - "0.8.5", - "0.8.6", - "0.8.7", - "0.8.8", - "0.8.9", - "0.8.10", - "0.8.11", - "0.8.12", - "0.9.0", - "0.9.1", - "0.9.2", - "0.9.3", - "0.9.4", - "0.9.5", - "0.9.6", - "0.9.7", - "1.0.0", - "1.0.1", - "1.1.0", - "1.1.1", - "1.1.2", - "1.2.0", - "1.2.1", - "1.3.0", - "1.4.0", - ], - "toVersion": "1.4.1", - "updateType": "major", - }, -] -`; - -exports[`workers/repository/process/lookup .lookupUpdates() returns only one update if automerging major 1`] = ` -Array [ - Object { - "isPin": true, - "newMajor": 0, - "newValue": "0.4.4", - "updateType": "pin", - }, - Object { - "blockedByPin": true, - "fromVersion": "0.4.4", - "isSingleVersion": true, - "newMajor": 1, - "newMinor": 4, - "newValue": "1.4.1", - "releaseTimestamp": "2015-05-17T04:25:07.299Z", - "skippedOverVersions": Array [ - "0.5.0", - "0.5.1", - "0.5.2", - "0.5.3", - "0.6.0", - "0.7.0", - "0.7.1", - "0.7.2", - "0.8.0", - "0.8.1", - "0.8.2", - "0.8.3", - "0.8.4", - "0.8.5", - "0.8.6", - "0.8.7", - "0.8.8", - "0.8.9", - "0.8.10", - "0.8.11", - "0.8.12", - "0.9.0", - "0.9.1", - "0.9.2", - "0.9.3", - "0.9.4", - "0.9.5", - "0.9.6", - "0.9.7", - "1.0.0", - "1.0.1", - "1.1.0", - "1.1.1", - "1.1.2", - "1.2.0", - "1.2.1", - "1.3.0", - "1.4.0", - ], - "toVersion": "1.4.1", - "updateType": "major", - }, -] -`; - exports[`workers/repository/process/lookup .lookupUpdates() returns patch minor and major 1`] = ` Array [ Object { diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index d6655f8625bb90f9d9d10c53d668b25bb3badee3..cf42ad406744cf1f0411eaf3ef62ee9e652bfbc3 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -119,26 +119,6 @@ describe('workers/repository/process/lookup', () => { expect(res.updates).toMatchSnapshot(); expect(res.updates).toHaveLength(1); }); - it('returns only one update if automerging', async () => { - config.automerge = true; - config.currentValue = '0.4.0'; - config.rangeStrategy = 'pin'; - config.depName = 'q'; - config.datasource = datasourceNpmId; - nock('https://registry.npmjs.org').get('/q').reply(200, qJson); - const res = await lookup.lookupUpdates(config); - expect(res.updates).toMatchSnapshot(); - expect(res.updates).toHaveLength(1); - }); - it('returns only one update if automerging major', async () => { - config.major = { automerge: true }; - config.currentValue = '^0.4.0'; - config.rangeStrategy = 'pin'; - config.depName = 'q'; - config.datasource = datasourceNpmId; - nock('https://registry.npmjs.org').get('/q').reply(200, qJson); - expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); - }); it('returns both updates if automerging minor', async () => { config.minor = { automerge: true }; config.currentValue = '^0.4.0'; diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 4f0508ef424113568b25db6472f2b930d2b3af3b..6be3071085ba20d74be677716ee254c76a1db41a 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -115,16 +115,12 @@ function getFromVersion( function getBucket(config: LookupUpdateConfig, update: LookupUpdate): string { const { separateMajorMinor, separateMultipleMajor } = config; const { updateType, newMajor } = update; - if ( - !separateMajorMinor || - config.major.automerge === true || - (config.automerge && config.major.automerge !== false) - ) { - return 'latest'; - } if (separateMultipleMajor && updateType === 'major') { return `major-${newMajor}`; } + if (!separateMajorMinor) { + return 'latest'; + } return updateType; } @@ -333,7 +329,7 @@ export async function lookupUpdates( update.newMajor = version.getMajor(toVersion); update.newMinor = version.getMinor(toVersion); update.updateType = - update.updateType || getType(config, update.fromVersion, toVersion); + update.updateType || getType(config, fromVersion, toVersion); const bucket = getBucket(config, update); if (buckets[bucket]) {