GHA-220 Add 'Rules updated' column to update-rule-metadata PR summary#123
Conversation
SummaryThis PR extracts the PR summary generation logic into a testable What reviewers should knowStart here: Review Key decisions: The "Rules updated" count relies on Watch for: The path format in the logs changed from "meaningful" names (e.g., "security/java") to full literal paths (e.g., "=== PATH:frontend/java ==="), which simplifies parsing. This is why lines in
|
… table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f894adf to
a2f8cff
Compare
There was a problem hiding this comment.
Conclusion: The "Rules updated" count will silently return 0 for any repo where sonarpedia directories are more than two levels deep — which is the common case for Java/analyzers repos. The root bug flagged in the previous review round is still present in this implementation.
- Resolve SCRIPT to absolute path so it works after cd into temp dirs - Add explicit return 0 to shell functions (S7682) - Extract repeated literals into constants OLD_RULE_CONTENT and INITIAL_COMMIT_MSG (S1192) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a rule has both an .html and a .json file changed, it was previously counted as 2 files. Now strips the extension and deduplicates by rule ID before counting, so S1896.html + S1896.json = 1 rule updated. Add a test case (Test 5) specifically covering this deduplication scenario. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The @ns/gha-219-slack-no-docker ref was used for integration testing. Now that GHA-219 is being merged, switch to the stable @v1 tag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids repeating the same string literals 4 times each, fixing SonarQube Cloud S1192 issues on PR 123. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SonarQube reviewer guide
|
There was a problem hiding this comment.
SonarCloud false positives: The four MAJOR issues about missing explicit return statements (AZ0Z_SBhqViT6RaT21Af–Ai) are false positives — all four functions (assert_output_contains, run_test, init_git, run_script) already end with return 0. Similarly, the MINOR issues about '<rule>old</rule>' and 'initial' being used as literals (AZ0Z_SBhqViT6RaT21Aj–Ak) are false positives: OLD_RULE_CONTENT and INITIAL_COMMIT_MSG constants were already defined at lines 14–15 before this commit. All eight reported issues should be dismissed in SonarCloud.




Summary
update-rule-metadataaction.html/.json, excludingsonarpedia.json) were actually changed in the PR per sonarpedia directoryTest plan
🤖 Generated with Claude Code