RC-350 Unify ruling expectation file locations - #6103
Conversation
Move ruling expectation files from its/ruling/src/test/resources/<project>/ to its/ruling/src/test/resources/expected/java/<project>/ This normalizes the expectation file locations to be consistent across all analyzers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
||
| private static void prepareDumpOldFolder() throws Exception { | ||
| Path allRulesFolder = Paths.get("src/test/resources"); | ||
| Path allRulesFolder = Paths.get("src/test/resources/expected/java"); |
There was a problem hiding this comment.
⚠️ Bug: CI ruling-root inputs still point at the old expectation root
ruling-update-and-notify copies the merged actual_* artifacts straight into ruling-root (cp -rv "$TEMP_DIR"/* "${ruling-root}/" in SonarSource/core-languages-tooling-public/ruling-update-and-notify/action.yml:302), and the artifacts are laid out as <project>/java-SXXXX.json. With ruling-root: 'its/ruling/src/test/resources' unchanged, the auto-update job will recreate the pre-PR its/ruling/src/test/resources/<project>/ tree instead of updating expected/java/<project>/, so the generated update PR never fixes the ruling failure that JavaRulingTest reads from src/test/resources/expected/java. Likewise ruling-diff-comment parses each changed path with parse_ruling_relative_path, which requires exactly <project>/<repo>-<rule>.json after stripping ruling-root; the new paths yield expected/java/<project>/java-SXXXX.json (4 parts), so every ruling file is dropped with "Skipping unrecognized ruling path" and no diff comment is ever posted again. Point both ruling-root inputs at its/ruling/src/test/resources/expected/java.
build.yml: point the auto-update action at the new expectation root (apply the same change to ruling-diff-comment.yml:56):
ruling-root: 'its/ruling/src/test/resources/expected/java'
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
Code Review
|
| Auto-apply | Compact | Unblock |
|
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|





Summary
its/ruling/src/test/resources/<project>/toits/ruling/src/test/resources/expected/java/<project>/JavaRulingTestto reference the new pathTest plan
🤖 Generated with Claude Code