From 16dfc0e0880b2534167df1218bddf155f0e87657 Mon Sep 17 00:00:00 2001 From: Maxime Brunet <max@brnt.mx> Date: Fri, 25 Feb 2022 03:39:48 -0800 Subject: [PATCH] fix(bitbucket): Use HTTP GET method instead of HEAD (#14403) Co-authored-by: Rhys Arkins <rhys@arkins.net> --- lib/platform/bitbucket/index.spec.ts | 12 ++++++------ lib/platform/bitbucket/index.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/platform/bitbucket/index.spec.ts b/lib/platform/bitbucket/index.spec.ts index 734429fcbc..b27574d4e1 100644 --- a/lib/platform/bitbucket/index.spec.ts +++ b/lib/platform/bitbucket/index.spec.ts @@ -756,11 +756,11 @@ describe('platform/bitbucket/index', () => { 'reviewers: Bob Smith is not a member of this workspace and cannot be added to this pull request', }, }) - .head( + .get( '/2.0/workspaces/some/members/%7Bd2238482-2e9f-48b3-8630-de22ccb9e42f%7D' ) .reply(404) - .head( + .get( '/2.0/workspaces/some/members/%7B90b6646d-1724-4a64-9fd9-539515fe94e9%7D' ) .reply(200) @@ -802,7 +802,7 @@ describe('platform/bitbucket/index', () => { 'reviewers: Bob Smith is not a member of this workspace and cannot be added to this pull request', }, }) - .head( + .get( '/2.0/workspaces/some/members/%7Bd2238482-2e9f-48b3-8630-de22ccb9e42f%7D' ) .reply(401); @@ -1014,11 +1014,11 @@ describe('platform/bitbucket/index', () => { 'reviewers: Bob Smith is not a member of this workspace and cannot be added to this pull request', }, }) - .head( + .get( '/2.0/workspaces/some/members/%7Bd2238482-2e9f-48b3-8630-de22ccb9e42f%7D' ) .reply(404) - .head( + .get( '/2.0/workspaces/some/members/%7B90b6646d-1724-4a64-9fd9-539515fe94e9%7D' ) .reply(200) @@ -1055,7 +1055,7 @@ describe('platform/bitbucket/index', () => { 'reviewers: Bob Smith is not a member of this workspace and cannot be added to this pull request', }, }) - .head( + .get( '/2.0/workspaces/some/members/%7Bd2238482-2e9f-48b3-8630-de22ccb9e42f%7D' ) .reply(401); diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts index 5237540f68..5eeda8cd65 100644 --- a/lib/platform/bitbucket/index.ts +++ b/lib/platform/bitbucket/index.ts @@ -676,7 +676,7 @@ async function sanitizeReviewers( // Validate that each previous PR reviewer account is still a member of this workspace for (const reviewer of reviewers) { try { - await bitbucketHttp.head( + await bitbucketHttp.get( `/2.0/workspaces/${workspace}/members/${reviewer.uuid}` ); -- GitLab