Skip to content

SONARJAVA-6752 Implement verifyIssueOnProject in JavaCheckVerifier and modernize MissingPackageInfoCheckTest - #5919

Merged
romainbrenguier merged 2 commits into
masterfrom
romain/fix-qg
Aug 13, 2026
Merged

SONARJAVA-6752 Implement verifyIssueOnProject in JavaCheckVerifier and modernize MissingPackageInfoCheckTest#5919
romainbrenguier merged 2 commits into
masterfrom
romain/fix-qg

Conversation

@romainbrenguier

@romainbrenguier romainbrenguier commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This is to fix the Quality Gate.

  • Implement the previously unimplemented verifyIssueOnProject() method in JavaCheckVerifier (the newVerifier() backend)
  • Migrate MissingPackageInfoCheckTest from the deprecated newInternalVerifier() to newVerifier()
  • Update JavaCheckVerifierTest to verify verifyIssueOnProject works instead of asserting it throws

Part of RC-16

Test plan

  • All 6 MissingPackageInfoCheckTest tests pass
  • All 33 JavaCheckVerifierTest tests pass
  • All InternalCheckVerifierTest tests pass

🤖 Generated with Claude Code

…singPackageInfoCheckTest

Implement the previously unimplemented verifyIssueOnProject() method in
JavaCheckVerifier so that tests can use CheckVerifier.newVerifier() instead
of the deprecated newInternalVerifier(). Migrate MissingPackageInfoCheckTest
to use the modern API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod Bot changed the title Implement verifyIssueOnProject in JavaCheckVerifier and modernize MissingPackageInfoCheckTest SONARJAVA-6752 Implement verifyIssueOnProject in JavaCheckVerifier and modernize MissingPackageInfoCheckTest Aug 13, 2026
@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

SONARJAVA-6752

Extract shared scanning setup into scanFiles() helper to eliminate
duplication between createVerifier() and verifyIssueOnProject().
Add tests covering all error paths in verifyIssueOnProject.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqube-next

Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hashicorp-vault-sonar-prod

Copy link
Copy Markdown
Contributor

The target branch was unlocked and auto-merge was canceled to prevent unexpected actions.

@romainbrenguier
romainbrenguier merged commit e931ac9 into master Aug 13, 2026
17 checks passed
@romainbrenguier
romainbrenguier deleted the romain/fix-qg branch August 13, 2026 11:40
@gitar-bot

gitar-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Implements verifyIssueOnProject in JavaCheckVerifier and modernizes MissingPackageInfoCheckTest, addressing the duplicated scan logic finding. No issues found.

✅ 1 resolved
Quality: scanFilesForProjectIssues duplicates createVerifier scanning logic

scanFilesForProjectIssues() (lines 142-168) is almost a line-for-line copy of the scanning half of createVerifier() (lines 99-140): same version resolution, visitor list, SonarComponents, builder, cache handling and scanForTesting call. The only difference is the omission of the CommentLinesVisitor and the issue-collection tail. Extracting the shared scan setup into a single helper that both callers use would prevent the two paths from drifting (e.g. a future cache/classpath fix applied to only one). Not a functional bug, but worth consolidating.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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.

2 participants