SONARJAVA-6586 Demonstrate ruling test report upload to GitHub#5757
SONARJAVA-6586 Demonstrate ruling test report upload to GitHub#5757romainbrenguier wants to merge 1 commit into
Conversation
| "com.google.guava:guava:src/com/google/common/collect/ImmutableMultimap.java": [ | ||
| 343 | ||
| ], | ||
| "com.google.guava:guava:src/com/google/common/reflect/Types.java": [ | ||
| 618 | ||
| ], | ||
| "com.google.guava:guava:src/com/google/thirdparty/publicsuffix/TrieParser.java": [ | ||
| 30 | ||
| ] |
There was a problem hiding this comment.
🚨 Bug: Intentional ruling-test breakage must not be merged
Commit b675e7c removes the expected S1118 issue at com.google.guava:guava:src/com/google/common/reflect/Types.java:618 from the baseline JSON. As the PR description itself states, this is a deliberate demonstration change that will cause the guava ruling test (JavaRulingTest) to fail in CI, since the analyzer still detects an issue at Types.java:618 that is no longer present in the baseline.
While this is intentional for demonstrating the artifact-upload workflow, the change is not safe to merge into master: it will leave the ruling QA job permanently red. Before merging, this baseline entry must be restored:
"com.google.guava:guava:src/com/google/common/reflect/Types.java": [
618
],
Recommendation: keep only the documentation commit (bce24c6) on the merge branch and drop/revert the baseline modification, or close this PR as a demonstration-only branch.
Restore the removed expected issue so the guava ruling test passes.:
"com.google.guava:guava:src/com/google/common/collect/ImmutableMultimap.java": [
343
],
"com.google.guava:guava:src/com/google/common/reflect/Types.java": [
618
],
"com.google.guava:guava:src/com/google/thirdparty/publicsuffix/TrieParser.java": [
30
]
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
There was a problem hiding this comment.
Comment gitar unblock to override this block and allow merging.
Configure merge blocking · Maintainers can dismiss this review.
Ruling Diff SummaryDetected changes in 1 rule file(s): 1 issue(s) removed, 3 issue(s) added. S1118 (
|
Implements a GitHub Action workflow that automatically posts detailed comments on pull requests when ruling test expected results change. The comment includes: - Summary of changed rules and issue counts - Detailed diff showing added/removed issues per file - Code snippets with context around each issue location - Proper handling of submodule sources Implementation details: - New workflow: .github/workflows/ruling-diff-comment.yml - Custom action: .github/actions/ruling-diff-comment/ - Automatically triggered on PR changes to ruling test files - Updates existing comment to avoid spam Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
8a8df9d to
5d86207
Compare
|
CI failed: The CI build failed due to a test regression in `JavaRulingTest.guava`, caused by a mismatch between actual analysis output and the expected ruling test results after your changes.OverviewThe CI pipeline failed during the FailuresRuling Test Regression (confidence: high)
Summary
Code Review 🚫 Blocked 0 resolved / 1 findingsImplements automated PR comments for ruling test diffs and documents the reporting infrastructure. The intentional breakage of the S1118 test in commit b675e7c must be reverted before merging. 🚨 Bug: Intentional ruling-test breakage must not be merged📄 its/ruling/src/test/resources/guava/java-S1118.json:8-13 Commit b675e7c removes the expected S1118 issue at While this is intentional for demonstrating the artifact-upload workflow, the change is not safe to merge into Recommendation: keep only the documentation commit (bce24c6) on the merge branch and drop/revert the baseline modification, or close this PR as a demonstration-only branch. Restore the removed expected issue so the guava ruling test passes.🤖 Prompt for agentsTip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |





Summary
This PR demonstrates the existing ruling test report upload functionality in sonar-java. The infrastructure for uploading ruling test reports to GitHub as artifacts when tests fail is already implemented and working.
What This PR Does
RULING_REPORT_UPLOAD.mdInfrastructure Already in Place
The repository already has:
✅ Custom GitHub Action (
.github/actions/upload-actual/action.yml) that:✅ Workflow integration in
.github/workflows/build.yml:✅ Report generation via sonar-lits-plugin:
Expected CI Behavior
When the ruling tests run in CI, they will:
guavaproject test (S1118 rule)actual_<runner>_<profile>- Raw JSON files with detected issuesdiff_<runner>_<profile>.html- Visual HTML diff showing changesTest Change
Modified
its/ruling/src/test/resources/guava/java-S1118.json:Types.java:618How to Verify
Comparison with sonar-python-enterprise
This implementation is identical to sonar-python-enterprise:
Note
This is a demonstration PR. The test modification should not be merged as it intentionally breaks the ruling test.
🤖 Generated with Claude Code
Summary by Gitar
ruling-diff-commentGitHub Action and workflow to automatically post/update issue deltas on PRs when ruling JSON files change.ruling_diff.pyto calculate and format added/removed issues by comparingbaseandheadcommits, including source code snippets.RULING_REPORT_UPLOAD.mdproviding a comprehensive guide on ruling test infrastructure, report generation, and the new PR comment functionality.This will update automatically on new commits.