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

Updating sonar github action to also retrieve and upload hotspots #11

Merged
merged 59 commits into from
May 10, 2024

Conversation

carlosu7
Copy link
Contributor

@carlosu7 carlosu7 commented May 7, 2024

Related issue: #7 and #10

Screenshot 2024-05-07 at 11 45 09 a m

@carlosu7 carlosu7 requested a review from drdavella May 7, 2024 17:46
dist/index.js Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file was uploaded just for testing purposes but it won't be merged

Base automatically changed from draft/defect-dojo to main May 7, 2024 17:57
const { prNumber } = getGitHubContext();
const url = `${apiUrl}/issues/search?componentKeys=${encodeURIComponent(
componentKey
)}&resolved=false`;
)}&resolved=false&ps=${MAX_PAGE_SIZE}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating page size limit to 500

Issue: #10

Copy link
Member

@drdavella drdavella left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall but we need to make sure we're using the correct analysis inputs parameters to distinguish between issues and hotspots.

src/sonar.ts Show resolved Hide resolved
src/action.ts Outdated
break;
case "sonar":
const issuesfile = await fetchOrLocateSonarResultsFile("issues");
await uploadInputFile(tool, issuesfile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function call isn't quite correct anymore. In this case, instead of tool we need to pass "sonar_issues". The sonar parameter is still supported for now but has been deprecated since we need to differentiate between issues and hotspots.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the purpose of that change is because of the way the URL is built and used to upload the files to pixee, right? @drdavella

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right, Pixeebot stores sonar issues and sonar hotspots in separate buckets so we need to upload them to different endpoints.

src/action.ts Outdated Show resolved Hide resolved
src/sonar.ts Show resolved Hide resolved
@carlosu7 carlosu7 requested a review from drdavella May 9, 2024 19:20
@carlosu7 carlosu7 merged commit 244efe4 into main May 10, 2024
1 check passed
@carlosu7 carlosu7 deleted the sonar-hotspots branch May 10, 2024 17:41
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

2 participants