Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pull request chaining for GitHub #896

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GreyTeardrop
Copy link
Contributor

@GreyTeardrop GreyTeardrop commented Apr 8, 2024

Description

When attempting to analyze a GitHub PR that targets another PR's branch, analysis fails with an error like

No branch exists in Sonarqube with the name central-email-rate-limit

That happens as SonarQube server only stores PR analysis results in the "Pull Requests" area and does not expose it via "Branches", so none are fetched via /api/project_branches/list endpoint.

This change makes a request to the /api/project_pull_requests/list endpoint and merges its response with the response from /api/project_branches/list.

Technical details

  1. I haven't spotted any constants that could be used to build PROJECT_PULL_REQUESTS_URL in the same way PROJECT_BRANCHES_URL is built.
  2. PR required a reorg of the CommunityProjectBranchesLoader's test to support mocking of multiple endpoints. 2c15a21 includes just that change without any production code changes, edacbe2 that makes the actual change then only needs minimal changes in the unit test.

Populate ProjectBranches with BranchInfos for project pull requests in
addition to scanned branches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant