diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index b23555415ca6a53f1ca0f58a328d0af61f19c0ba..19594b26108f52b82206b7bef61083038bd23b5d 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -39,7 +39,6 @@ module.exports = { findPr, createPr, getPr, - getPrFiles, updatePr, mergePr, // file @@ -831,18 +830,6 @@ async function getPr(prNo) { return pr; } -// Return a list of all modified files in a PR -async function getPrFiles(prNo) { - logger.debug({ prNo }, 'getPrFiles'); - if (!prNo) { - return []; - } - const files = (await get( - `repos/${config.parentRepo || config.repository}/pulls/${prNo}/files` - )).body; - return files.map(f => f.filename); -} - async function updatePr(prNo, title, body) { logger.debug(`updatePr(${prNo}, ${title}, body)`); const patchBody = { title }; diff --git a/lib/platform/gitlab/index.js b/lib/platform/gitlab/index.js index 939579d02206b7d8e986486ce048cba1de4cbf0e..52d69e2ff24842e9a2f88683c9e8322bd1654b2c 100644 --- a/lib/platform/gitlab/index.js +++ b/lib/platform/gitlab/index.js @@ -34,7 +34,6 @@ module.exports = { findPr, createPr, getPr, - getPrFiles, updatePr, mergePr, // file @@ -482,11 +481,6 @@ async function getPr(iid) { return pr; } -function getPrFiles() { - // TODO - return []; -} - async function updatePr(iid, title, description) { await get.put(`projects/${config.repository}/merge_requests/${iid}`, { body: { diff --git a/lib/platform/vsts/index.js b/lib/platform/vsts/index.js index b16f5656d2c08f0a87d721977a4712587c138a92..7fd084193157a1e3d0b507299c41950e4dd95c02 100644 --- a/lib/platform/vsts/index.js +++ b/lib/platform/vsts/index.js @@ -36,7 +36,6 @@ module.exports = { findPr, createPr, getPr, - getPrFiles, updatePr, mergePr, // file @@ -557,9 +556,3 @@ async function addReviewers(prNo, reviewers) { }) ); } - -// to become async? -function getPrFiles(prNo) { - logger.info(`getPrFiles(prNo)(${prNo}) - Not supported by VSTS (yet!)`); - return []; -} diff --git a/test/platform/__snapshots__/index.spec.js.snap b/test/platform/__snapshots__/index.spec.js.snap index 0543b2fb6e3ccfd68643a64e0609a65c41e530b9..13901bdef4d8a93ded572d0cf77bfe58eeb99f11 100644 --- a/test/platform/__snapshots__/index.spec.js.snap +++ b/test/platform/__snapshots__/index.spec.js.snap @@ -27,7 +27,6 @@ Array [ "findPr", "createPr", "getPr", - "getPrFiles", "updatePr", "mergePr", "commitFilesToBranch", @@ -63,7 +62,6 @@ Array [ "findPr", "createPr", "getPr", - "getPrFiles", "updatePr", "mergePr", "commitFilesToBranch", @@ -99,7 +97,6 @@ Array [ "findPr", "createPr", "getPr", - "getPrFiles", "updatePr", "mergePr", "commitFilesToBranch", diff --git a/test/platform/github/__snapshots__/index.spec.js.snap b/test/platform/github/__snapshots__/index.spec.js.snap index 91fdb424155c2a47c499176150d46a36367fb35f..19a04807f6ad6fb736ab11461b31c2790e98837b 100644 --- a/test/platform/github/__snapshots__/index.spec.js.snap +++ b/test/platform/github/__snapshots__/index.spec.js.snap @@ -523,13 +523,6 @@ Object { } `; -exports[`platform/github getPrFiles() returns files 1`] = ` -Array [ - "renovate.json", - "not renovate.json", -] -`; - exports[`platform/github getRepos should return an array of repos 1`] = ` Array [ Array [ diff --git a/test/platform/github/index.spec.js b/test/platform/github/index.spec.js index 7b840d9568c82a78a55915c4f5cf51401cda6950..6a49737c84cccded5c2fd99cb0066ac359904933 100644 --- a/test/platform/github/index.spec.js +++ b/test/platform/github/index.spec.js @@ -1309,23 +1309,6 @@ describe('platform/github', () => { expect(pr).toMatchSnapshot(); }); }); - describe('getPrFiles()', () => { - it('should return empty if no prNo is passed', async () => { - const prFiles = await github.getPrFiles(null); - expect(prFiles).toEqual([]); - }); - it('returns files', async () => { - get.mockReturnValueOnce({ - body: [ - { filename: 'renovate.json' }, - { filename: 'not renovate.json' }, - ], - }); - const prFiles = await github.getPrFiles(123); - expect(prFiles).toMatchSnapshot(); - expect(prFiles).toHaveLength(2); - }); - }); describe('updatePr(prNo, title, body)', () => { it('should update the PR', async () => { await initRepo({ repository: 'some/repo', token: 'token' }); diff --git a/test/platform/gitlab/index.spec.js b/test/platform/gitlab/index.spec.js index 94bca4325e71073dbe01e1b5c2b297a15ff3eb26..cfc9d94cf91945c1d6ef5d46f3526ada3e035f80 100644 --- a/test/platform/gitlab/index.spec.js +++ b/test/platform/gitlab/index.spec.js @@ -610,12 +610,6 @@ describe('platform/gitlab', () => { expect(pr).toMatchSnapshot(); }); }); - describe('getPrFiles()', () => { - it('should return empty', async () => { - const prFiles = await gitlab.getPrFiles(); - expect(prFiles).toEqual([]); - }); - }); describe('updatePr(prNo, title, body)', () => { jest.resetAllMocks(); it('updates the PR', async () => { diff --git a/test/platform/vsts/index.spec.js b/test/platform/vsts/index.spec.js index eb0a81f047f550554a793ba36b2edc16dc0bb1a7..381ca7d157034d2955e0dbf93da402b1e917fa70 100644 --- a/test/platform/vsts/index.spec.js +++ b/test/platform/vsts/index.spec.js @@ -691,11 +691,5 @@ describe('platform/vsts', () => { const res = await vsts.mergePr(); expect(res).toBeUndefined(); }); - - // to become async? - it('getPrFiles', () => { - const res = vsts.getPrFiles(46); - expect(res.length).toBe(0); - }); }); });