Repository navigation
AP-1498: Activate AI-enhanced ruling diff reviews - #6550
Conversation
fd37887 to
65cc87b
Compare
Ruling Diff SummaryDetected changes in 2 rule files: 4 issues removed, 2 issues added. Rule overview
Automated assessments are advisory; confidence is not a correctness guarantee. java:S3551Projects: guava · Removed: 0 · Added: 2 · Automated assessment: 🔴 negative | Confidence: medium Both added findings target unsupported operations: mark() is a no-op and reset() immediately throws, so neither performs shared-state work that needs synchronization. The snippets omit the class hierarchy, which limits confidence, but the reported locations themselves are relevant. Source examples — 2 of 2 changed findings shownguavaAutomated selection: Added false positive reset() immediately throws without accessing shared state, so requiring synchronization appears unnecessary; this is the clearest example of an added finding that should not be reported. Added Make this method "synchronized" to match the parent class implementation. 90 | /**
91 | * reset() is not supported for HashingInputStream.
92 | * @throws IOException this operation is not supported
93 | */
94 | @Override
>>> 95 | public void reset() throws IOException {
^^^^^
96 | throw new IOException("reset not supported");
97 | }
98 |
99 | /**
100 | * Returns the {@link HashCode} based on the data read from this stream. The result isAdded Make this method "synchronized" to match the parent class implementation. 83 |
84 | /**
85 | * mark() is not supported for HashingInputStream
86 | */
87 | @Override
>>> 88 | public void mark(int readlimit) {}
^^^^
89 |
90 | /**
91 | * reset() is not supported for HashingInputStream.
92 | * @throws IOException this operation is not supported
93 | */java:S5738Projects: guava · Removed: 4 · Added: 0 · Automated assessment: 🔴 negative | Confidence: high The change removes a finding on an override of Object.finalize(), which the rule explicitly says not to override because it is deprecated for removal. The other removed examples concern ThreadDeath, but their deprecation status is not established by the snippets. Source examples — 4 of 4 changed findings shownguavaAutomated selection: Removed true positive The reported location overrides finalize(), and the rule’s specification explicitly identifies overriding a deprecated method marked for removal as noncompliant. Removed Don't override this deprecated method, it has been marked for removal. 98 | @Override
99 | public InputStream openStream() throws IOException {
100 | return openInputStream();
101 | }
102 |
>>> 103 | @Override protected void finalize() {
^^^^^^^^
104 | try {
105 | reset();
106 | } catch (Throwable t) {
107 | t.printStackTrace(System.err);
108 | }Removed Remove this call to a deprecated class, it has been marked for removal. 332 | * would result in compilation failure if we directly refer to these classes.
333 | */
334 | Class<?> sharedSecrets = Class.forName(SHARED_SECRETS_CLASSNAME, false, null);
335 | Method langAccess = sharedSecrets.getMethod("getJavaLangAccess");
336 | return langAccess.invoke(null);
>>> 337 | } catch (ThreadDeath death) {
^^^^^^^^^^^
338 | throw death;
339 | } catch (Throwable t) {
340 | /*
341 | * This is not one of AppEngine's whitelisted classes, so even in Sun JDKs, this can fail with
342 | * a NoClassDefFoundError. Other apps might deny access to sun.misc packages.Removed Remove this call to a deprecated class, it has been marked for removal. 362 | private static Method getSizeMethod() {
363 | return getJlaMethod("getStackTraceDepth", Throwable.class);
364 | }
365 |
366 | @Nullable
>>> 367 | private static Method getJlaMethod(String name, Class<?>... parameterTypes) throws ThreadDeath {
^^^^^^^^^^^
368 | try {
369 | return Class.forName(JAVA_LANG_ACCESS_CLASSNAME, false, null).getMethod(name, parameterTypes);
370 | } catch (ThreadDeath death) {
371 | throw death;
372 | } catch (Throwable t) {Removed Remove this call to a deprecated class, it has been marked for removal. 365 |
366 | @Nullable
367 | private static Method getJlaMethod(String name, Class<?>... parameterTypes) throws ThreadDeath {
368 | try {
369 | return Class.forName(JAVA_LANG_ACCESS_CLASSNAME, false, null).getMethod(name, parameterTypes);
>>> 370 | } catch (ThreadDeath death) {
^^^^^^^^^^^
371 | throw death;
372 | } catch (Throwable t) {
373 | /*
374 | * Either the JavaLangAccess class itself is not found, or the method is not supported on the
375 | * JVM. |
0826eae to
113f613
Compare
✅ All code review findings resolved.
BartLucien
left a comment
There was a problem hiding this comment.
I have comments regarding mise and errors propagation
| version: 2026.10.20 | ||
| - run: mise use --global uv@latest | ||
|
|
||
| - name: Get enhancer secrets |
There was a problem hiding this comment.
If this fails, it will skip the following step.
A fallback in case the AI secrets are not retrieved already exists in the ruling-update-and-notify action. Should we continue on error and let the following action handles the failure?
| version: 2026.10.20 | ||
| - run: mise use --global uv@latest | ||
|
|
||
| - name: Get enhancer secrets |
There was a problem hiding this comment.
Same here about failure propagations
| uses: jdx/mise-action@d5574b52816a478f9d4e6529a3f6ff17a8a36785 # v5.2.8 | ||
| with: | ||
| enable-cache: true | ||
| version: 2026.10.20 | ||
| - run: mise use --global uv@latest |
There was a problem hiding this comment.
why do we changes the way mise is installed?
There was a problem hiding this comment.
I reverted that change
| uses: jdx/mise-action@d5574b52816a478f9d4e6529a3f6ff17a8a36785 # v5.2.8 | ||
| with: | ||
| enable-cache: true | ||
| version: 2026.10.20 | ||
| - run: mise use --global uv@latest |
There was a problem hiding this comment.
why do we changes the way mise is installed?
- Drop redundant setup-uv steps whose cache save fails when uv is unused - Enable the DSPy enhancer only when Vault secrets were retrieved - Build the plugin from the PR head SHA used by ruling-qa and the update job Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bd220b8 to
bf1198c
Compare
Co-authored-by: Romain Brenguier <11854194+romainbrenguier@users.noreply.github.com>
Code Review ✅ Approved 🔴 High risk 8 closed / 8 findingsGranting OIDC access to retrieve Portkey and Artifactory credentials in ruling workflows expands a sensitive secret boundary and could expose them to compromised workflow code. Enables AI-enhanced ruling diff reviews in the standalone diff-comment and ruling update notification workflows, wiring the Portkey key and Repox token from Vault, setting the ✅ 8 closed✅ Cross-Repo: S106 regression would break sonarlint-intellij standalone medium test
✅ Cross-Repo: S106 regression would break sonarlint-vscode Java ITS diagnostics
✅ Cross-Repo: S106 regression would break sonarlint-eclipse connected-mode ITs
✅ Bug: ruling-qa still runs on the merge ref while the update job uses head SHA
✅ Bug: setup-uv cache save fails the notify job whenever the ruling passes
...and 3 more closed from earlier reviews Verification Rules 2/3 met PRs 1 inspectedRules 1 failed 2 passed 2 not applicable
Functional validation No results Broader impact PRs 1 inspectedCross-PR 1 PR inspected 0 open impacts
Auto-approval Not enabledFor more verification details, 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
The repository metadata and ruling source submodule are public and available in each workflow checkout.
Verification
git diff --checksonar analyze agentic --depth DEEP --file .github/workflows/build.yml --file .github/workflows/ruling-diff-comment.yml(no issues)Agent workflow
Tool link: https://github.com/SonarSource/languages-experimental-tooling/tree/romain/my-tickets/personal/romain-brenguier
PR created using
uv run create_with_claude.py AP-1498.txtPR updated using
uv run update_with_claude.py --prompt "Implement the action plan described in the document Make a dramatic change to one existing rule to exercise ruling changes. Mark the commit as being for test only.." -a "Make a dramatic change to one existing rule to exercise ruling changes. Mark the commit as being for test only." -g "codex"Summary by Gitar
SystemOutOrErrUsageCheckso theSystem.out/System.errprint check no longer reports issues directly fromvisitMemberSelectExpressionSystemOutOrErrUsageCheckTestto expect no issues and removedNoncompliantmarkers fromSystemOutOrErrUsageCheckSamplejava-S1481.sarifandjava-S1854.sarifforjava-time-examplesetup-uvwithjdx/mise-actionin both ruling workflows, pinninguvthrough miseactions/checkoutto the PR head SHA in thebuild.ymljobsThis will update automatically on new commits.
PR updated using
uv run update_with_claude.py --prompt "Implement the action plan described in the document The secret used in the PR is wrong, it should be development/kv/data/portkey/code-quality/ruling-test-unification. Fix it.." -a "The secret used in the PR is wrong, it should be development/kv/data/portkey/code-quality/ruling-test-unification. Fix it." -g "codex"PR updated using `uv run update_with_claude.py --prompt "Implement the action plan described in the document Also make some arbitrary changes to some existing ruling expectation sarif files (moving a couple issues, a couple of lines higher), to exercise the ruling diff. Mark the commit as for test only.." -a "Also make some arbitrary changes to some existing ruling expectation sarif files (moving a couple issues, a couple of lines higher), to exercise the ruling diff. Mark the commit as for test...
PR updated using `uv run update_with_claude.py --prompt "Implement the action plan described in the document Fix this, and at the same occasion, use mise to install uv instead of the special uv action:
Run SonarSource/core-languages-tooling-public/ruling-diff-comment@master
Generate and post ruling diff comment
0s
Run enhancer_args=()
Using CPython 3.12.3 interpreter at: /usr/bin/python3
Creating virtual environment at: /home/runner/work/_actions/SonarSource/core-languages-tooling-public/ma...
PR updated using
uv run update_with_claude.py --prompt "Rebase on origin/master, fixing conflicts" -a "None" -g "claude"PR updated using
uv run update_with_claude.py --prompt "Implement the action plan described in the document Fix: Run SonarSource/core-languages-tooling-public/ruling-diff-comment@master Generate and post ruling diff comment 0s Run enhancer_args=() Using CPython 3.12.3 interpreter at: /usr/bin/python3 Creating virtual environment at: /home/runner/work/_actions/SonarSource/core-languages-tooling-public/master/ruling-diff-comment/.venv error: Failed to downloadjiter==0.18.0`cause: Fai...
PR updated using
uv run update_with_claude.py --prompt "Implement the action plan described in the document The dspy model to use should be gpt-6-luna. Also fetch and rebase on origin/master. Drop the commit that introduced arbitrary sarif changes.." -a "The dspy model to use should be gpt-6-luna. Also fetch and rebase on origin/master. Drop the commit that introduced arbitrary sarif changes." -g "codex"Addressed review comments in pr_report_6550.md using
uv run address_reviews.py pr_report_6550.mdPR updated using
uv run update_with_claude.py --prompt "Implement the action plan described in the document Code Review: Enables AI-enhanced ruling diff reviews by wiring the Portkey key and Repox token from Vault, setting thegpt-6-lunamodel, and granting OIDC permission to the ruling jobs. Changes are requested before merge: theInstall uvsetup-uv cache save will fail the notify job whenever the ruling passes,DSPY_MODEL` still forces an unauthenticated Repox install when Vault fails, ...PR updated using
uv run update_with_claude.py --prompt "Rebase on origin/master, fixing conflicts" -a "None" -g "claude"