diff --git a/lib/platform/bitbucket/index.js b/lib/platform/bitbucket/index.js index 333f41da9dd05f12751e9826f8c1d5490cd1c680..0b649888d6a1781523c6731bf788ae472467607c 100644 --- a/lib/platform/bitbucket/index.js +++ b/lib/platform/bitbucket/index.js @@ -419,7 +419,7 @@ async function getPr(prNo) { }; if (utils.prStates.open.includes(pr.state)) { - res.isUnmergeable = await isPrConflicted(prNo); + res.isConflicted = await isPrConflicted(prNo); const commits = await utils.accumulateValues(pr.links.commits.href); if (commits.length === 1) { res.canRebase = true; diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index ab5bd1fc3071d6c80cec36bd179c019bdb276401..536fa8e84a115d03ed6a9595e2bfa8f481f87eed 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -934,9 +934,9 @@ async function getOpenPrs() { } // https://developer.github.com/v4/enum/mergestatestatus if (pr.mergeStateStatus === 'DIRTY') { - pr.isUnmergeable = true; + pr.isConflicted = true; } else { - pr.isUnmergeable = false; + pr.isConflicted = false; } if (pr.commits.nodes.length === 1) { if (config.gitAuthor) { @@ -1092,7 +1092,7 @@ async function getPr(prNo) { } if (pr.mergeable_state === 'dirty') { logger.debug({ prNo }, 'PR state is dirty so unmergeable'); - pr.isUnmergeable = true; + pr.isConflicted = true; } if (pr.commits === 1) { if (config.gitAuthor) { diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index ecb55aaa01c3c8ea2a2d3518ef822c87f1539885..63efaf6554db96480fbf7cbbf160358bb6b6a4c6 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -661,7 +661,7 @@ async function getPr(iid) { if (pr.merge_status === 'cannot_be_merged') { logger.debug('pr cannot be merged'); pr.canMerge = false; - pr.isUnmergeable = true; + pr.isConflicted = true; } else { // Actually.. we can't be sure pr.canMerge = true; @@ -682,7 +682,7 @@ async function getPr(iid) { } } catch (err) { logger.warn({ err }, 'Error getting PR branch'); - pr.isUnmergeable = true; + pr.isConflicted = true; } return pr; } diff --git a/lib/platform/vsts/vsts-helper.js b/lib/platform/vsts/vsts-helper.js index 8a05f82803da439a4e834c55e2bc130b835079d2..1af0b433b3ebcae860b43e935b3d560fe189c689 100644 --- a/lib/platform/vsts/vsts-helper.js +++ b/lib/platform/vsts/vsts-helper.js @@ -240,7 +240,7 @@ function getRenovatePRFormat(vstsPr) { // Failure = 5, // } if (vstsPr.mergeStatus === 2) { - pr.isUnmergeable = true; + pr.isConflicted = true; } pr.canRebase = true; diff --git a/lib/workers/branch/parent.js b/lib/workers/branch/parent.js index 7ad9c5ce7c80d571c621a2782bb454b2c9a1aa1d..acde9ae779e33f3b762090c389a02b6e5b21a9a8 100644 --- a/lib/workers/branch/parent.js +++ b/lib/workers/branch/parent.js @@ -40,8 +40,8 @@ async function getParentBranch(config) { } // Now check if PR is unmergeable. If so then we also rebase - if (pr && pr.isUnmergeable) { - logger.debug('PR is unmergeable'); + if (pr && pr.isConflicted) { + logger.debug('PR is conflicted'); if (pr.canRebase) { logger.info(`Branch is not mergeable and needs rebasing`); // TODO: Move this down to api library diff --git a/lib/workers/pr/index.js b/lib/workers/pr/index.js index 0d29079279e2711afa2298cf6083642538eec1f2..f9d7124b0d16f18716c57a6026424930caea41ed 100644 --- a/lib/workers/pr/index.js +++ b/lib/workers/pr/index.js @@ -380,8 +380,8 @@ async function checkAutoMerge(pr, config) { if (automerge) { logger.debug('PR is configured for automerge'); // Return if PR not ready for automerge - if (pr.isUnmergeable) { - logger.info('PR is not mergeable'); + if (pr.isConflicted) { + logger.info('PR is conflicted'); logger.debug({ pr }); return false; } diff --git a/lib/workers/repository/finalise/prune.js b/lib/workers/repository/finalise/prune.js index 496a85ed158ee4c0b165a4cbb5a00b57b6216952..591261ef8293d42befb400b601cd4681f552dfee 100644 --- a/lib/workers/repository/finalise/prune.js +++ b/lib/workers/repository/finalise/prune.js @@ -24,8 +24,8 @@ async function pruneStaleBranches(config, branchList) { if (renovateBranches.includes(lockFileBranch)) { logger.debug('Checking lock file branch'); const pr = await platform.getBranchPr(lockFileBranch); - if (pr && pr.isUnmergeable) { - logger.info('Deleting lock file maintenance branch as it is unmergeable'); + if (pr && pr.isConflicted) { + logger.info('Deleting lock file maintenance branch as it is conflicted'); await platform.deleteBranch(lockFileBranch); } renovateBranches = renovateBranches.filter( diff --git a/lib/workers/repository/onboarding/pr/index.js b/lib/workers/repository/onboarding/pr/index.js index dfc4a6f2848b2320c6719fde3f7dc25bf521a088..b784eee09f9daf544ed4047b56187e3878a6e38a 100644 --- a/lib/workers/repository/onboarding/pr/index.js +++ b/lib/workers/repository/onboarding/pr/index.js @@ -53,7 +53,7 @@ Also, you can post questions about your config in [Renovate's Config Help reposi } else { configDesc = '### Configuration\n\n:abcd: Renovate has detected a custom config for this PR. Feel free to post it to the [Config Help repository](https://github.com/renovatebot/config-help/issues) if you have any doubts and would like it reviewed.\n\n'; - if (existingPr.isUnmergeable) { + if (existingPr.isConflicted) { configDesc += ':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 { diff --git a/test/platform/bitbucket/__snapshots__/index.spec.js.snap b/test/platform/bitbucket/__snapshots__/index.spec.js.snap index 03bb65aab11e8c6f2e7cd3a5700efebf21fc0a8b..1fb0c7cf25e6b990b7984682293853079c174def 100644 --- a/test/platform/bitbucket/__snapshots__/index.spec.js.snap +++ b/test/platform/bitbucket/__snapshots__/index.spec.js.snap @@ -60,8 +60,8 @@ Object { "canRebase": true, "createdAt": "2018-07-02T07:02:25.275030+00:00", "displayNumber": "Pull Request #5", + "isConflicted": false, "isStale": false, - "isUnmergeable": false, "number": 5, "state": "open", "title": "title", @@ -100,8 +100,8 @@ Object { "canRebase": true, "createdAt": "2018-07-02T07:02:25.275030+00:00", "displayNumber": "Pull Request #5", + "isConflicted": false, "isStale": false, - "isUnmergeable": false, "number": 5, "state": "open", "title": "title", diff --git a/test/platform/github/__snapshots__/index.spec.js.snap b/test/platform/github/__snapshots__/index.spec.js.snap index a6686ab1ee6eeba99f692808a3bbdd1af21a223f..7920ea6181fa073c8315fba384c479fc24908779 100644 --- a/test/platform/github/__snapshots__/index.spec.js.snap +++ b/test/platform/github/__snapshots__/index.spec.js.snap @@ -305,8 +305,8 @@ Object { "canMerge": false, "canRebase": true, "displayNumber": "Pull Request #2500", + "isConflicted": true, "isStale": true, - "isUnmergeable": true, "number": 2500, "state": "open", "title": "chore(deps): update dependency jest to v23.6.0", @@ -334,7 +334,7 @@ Object { "canRebase": true, "commits": 1, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, @@ -369,7 +369,7 @@ Object { "canRebase": false, "commits": 1, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, @@ -386,7 +386,7 @@ Object { "canRebase": true, "commits": 2, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, @@ -403,7 +403,7 @@ Object { "canRebase": true, "commits": 1, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, @@ -420,7 +420,7 @@ Object { "canRebase": true, "commits": 2, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, @@ -436,7 +436,7 @@ Object { "branchName": undefined, "commits": 2, "displayNumber": "Pull Request #1", - "isUnmergeable": true, + "isConflicted": true, "mergeable_state": "dirty", "number": 1, "sha": undefined, diff --git a/test/platform/gitlab/__snapshots__/index.spec.js.snap b/test/platform/gitlab/__snapshots__/index.spec.js.snap index 972298c3acc478922c2083d86ba14f13e429ba64..da1e9ba0e964547692a566b66ae5df25701b5487 100644 --- a/test/platform/gitlab/__snapshots__/index.spec.js.snap +++ b/test/platform/gitlab/__snapshots__/index.spec.js.snap @@ -218,7 +218,7 @@ Object { "displayNumber": "Merge Request #12345", "id": 1, "iid": 12345, - "isUnmergeable": true, + "isConflicted": true, "merge_status": "cannot_be_merged", "number": 12345, "source_branch": "some-branch", @@ -235,7 +235,7 @@ Object { "displayNumber": "Merge Request #12345", "id": 1, "iid": 12345, - "isUnmergeable": true, + "isConflicted": true, "merge_status": "cannot_be_merged", "number": 12345, "source_branch": "some-branch", diff --git a/test/platform/vsts/__snapshots__/vsts-helper.spec.js.snap b/test/platform/vsts/__snapshots__/vsts-helper.spec.js.snap index 58ed9f3a1d8e574ef4c5309588099170bddb05c2..df227f3f6d88b84c101dc4da41bb188373f3b56b 100644 --- a/test/platform/vsts/__snapshots__/vsts-helper.spec.js.snap +++ b/test/platform/vsts/__snapshots__/vsts-helper.spec.js.snap @@ -88,11 +88,11 @@ Object { } `; -exports[`platform/vsts/helpers getRenovatePRFormat should be formated (isUnmergeable) 1`] = ` +exports[`platform/vsts/helpers getRenovatePRFormat should be formated (isConflicted) 1`] = ` Object { "canRebase": true, "displayNumber": "Pull Request #undefined", - "isUnmergeable": true, + "isConflicted": true, "mergeStatus": 2, "number": undefined, "status": "open", diff --git a/test/platform/vsts/vsts-helper.spec.js b/test/platform/vsts/vsts-helper.spec.js index 1aa6848db1ca6844b2fcb4a0de7e791c25fc18f2..9f8c4c57692b31efe16b6658940ad26f419cbf4a 100644 --- a/test/platform/vsts/vsts-helper.spec.js +++ b/test/platform/vsts/vsts-helper.spec.js @@ -271,7 +271,7 @@ describe('platform/vsts/helpers', () => { expect(res).toMatchSnapshot(); }); - it('should be formated (isUnmergeable)', () => { + it('should be formated (isConflicted)', () => { const res = vstsHelper.getRenovatePRFormat({ mergeStatus: 2 }); expect(res).toMatchSnapshot(); }); diff --git a/test/workers/branch/parent.spec.js b/test/workers/branch/parent.spec.js index 707fd884bfed08caa4ea8f318957e1c03b26de2b..5ab57d862a727fb143f86477a98394d3e1ee13cc 100644 --- a/test/workers/branch/parent.spec.js +++ b/test/workers/branch/parent.spec.js @@ -26,7 +26,7 @@ describe('workers/branch/parent', () => { it('returns branchName if does not need rebaseing', async () => { platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: false, + isConflicted: false, }); const res = await getParentBranch(config); expect(res.parentBranch).toBe(config.branchName); @@ -34,7 +34,7 @@ describe('workers/branch/parent', () => { it('returns branchName if unmergeable and cannot rebase', async () => { platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: true, + isConflicted: true, canRebase: false, }); const res = await getParentBranch(config); @@ -43,7 +43,7 @@ describe('workers/branch/parent', () => { it('returns undefined if manual rebase by label', async () => { platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: true, + isConflicted: true, canRebase: false, labels: ['rebase'], }); @@ -53,7 +53,7 @@ describe('workers/branch/parent', () => { it('returns undefined if unmergeable and can rebase', async () => { platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: true, + isConflicted: true, canRebase: true, }); const res = await getParentBranch(config); @@ -63,7 +63,7 @@ describe('workers/branch/parent', () => { config.isGitLab = true; platform.branchExists.mockReturnValue(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: true, + isConflicted: true, canRebase: true, }); const res = await getParentBranch(config); @@ -90,7 +90,7 @@ describe('workers/branch/parent', () => { platform.branchExists.mockReturnValue(true); platform.isBranchStale.mockReturnValueOnce(true); platform.getBranchPr.mockReturnValue({ - isUnmergeable: true, + isConflicted: true, canRebase: false, }); const res = await getParentBranch(config); diff --git a/test/workers/pr/index.spec.js b/test/workers/pr/index.spec.js index be24b1a8356e4a4199f7b259b9aab4e4313eb597..b30536cb27ae7bfb1444107a04af93eaa3875aa0 100644 --- a/test/workers/pr/index.spec.js +++ b/test/workers/pr/index.spec.js @@ -91,7 +91,7 @@ describe('workers/pr', () => { }); it('should not automerge if enabled and pr is unmergeable', async () => { config.automerge = true; - pr.isUnmergeable = true; + pr.isConflicted = true; await prWorker.checkAutoMerge(pr, config); expect(platform.mergePr.mock.calls.length).toBe(0); }); diff --git a/test/workers/repository/finalise/prune.spec.js b/test/workers/repository/finalise/prune.spec.js index 9f81cedc3a6bc475e6af5388ab02c8d928695c30..351dbc5b7f15f5540df8b91b541622aa06be50e9 100644 --- a/test/workers/repository/finalise/prune.spec.js +++ b/test/workers/repository/finalise/prune.spec.js @@ -44,7 +44,7 @@ describe('workers/repository/finalise/prune', () => { platform.getAllRenovateBranches.mockReturnValueOnce([ 'renovate/lock-file-maintenance', ]); - platform.getBranchPr = jest.fn(() => ({ isUnmergeable: true })); + platform.getBranchPr = jest.fn(() => ({ isConflicted: true })); await cleanup.pruneStaleBranches(config, [ 'renovate/lock-file-maintenance', ]); diff --git a/test/workers/repository/onboarding/pr/index.spec.js b/test/workers/repository/onboarding/pr/index.spec.js index 1f04304e2138650f8bb33289b39a09f8259cc4af..ad10aab6d6319747fcbbad202394d309dbad9921 100644 --- a/test/workers/repository/onboarding/pr/index.spec.js +++ b/test/workers/repository/onboarding/pr/index.spec.js @@ -47,7 +47,7 @@ describe('workers/repository/onboarding/pr', () => { platform.getBranchPr.mockReturnValue({ title: 'Configure Renovate', body: createPrBody, - isUnmergeable: true, + isConflicted: true, }); await ensureOnboardingPr(config, [], branches); expect(platform.createPr.mock.calls).toHaveLength(0);