Skip to content

SONARJAVA-7339 Parse with the SemSitter translator behind the feature flag - #6553

Draft
rombirli wants to merge 4 commits into
rombirli/semsitter-frontend-switchfrom
rombirli/semsitter-frontend-translator
Draft

rombirli wants to merge 4 commits into
rombirli/semsitter-frontend-switchfrom
rombirli/semsitter-frontend-translator

Conversation

@rombirli

@rombirli rombirli commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #6547.

Summary

  • Translate a SemSitter document into the Sonar Java tree when the feature flag is on: symbols, types, and warnings
  • Keep enum constant constructors and annotation values as ECJ gives them
  • Own an unresolved method with the unknown type, so checks that read its members do not crash

The flag stays off by default. The recorded server answers the translator tests replay are #6555, not this PR. The PVF-only flag flip and the bundled server stay on #6548 and are thrown away after the smoke test.

Test plan

  • java-frontend-semsitter module tests
  • Confirm ECJ remains the parser when the flag is off and no executable is set

@hashicorp-vault-sonar-prod

Copy link
Copy Markdown
Contributor

SONARJAVA-7339

@rombirli
rombirli force-pushed the rombirli/semsitter-frontend-translator branch from d59faf2 to db28867 Compare November 23, 2026 07:42
@rombirli
rombirli removed this pull request from stack #6554 November 23, 2026 07:43
@rombirli
rombirli added this pull request to stack #6556 November 23, 2026 07:43
@rombirli
rombirli marked this pull request as draft November 23, 2026 07:45
@gitar-bot gitar-bot Bot mentioned this pull request Nov 25, 2026
2 tasks done
…ature flag

The translator turns the SemSitter documents into the Java tree the checks run on. The flag keeps the default frontend until it turns on.
…ound trip

JSema now keeps the Fact and Symbol messages of the document and reads them
with their getters. The member facts of a types answer are converted to a
Fact once, so applyFact and fillMethod read one shape. DocumentFacts is gone.

A symbol type fact that is not a TypeRef used to throw ClassCastException
and is now ignored. The server always sends a TypeRef there.
@rombirli
rombirli force-pushed the rombirli/semsitter-frontend-translator branch from ae4a758 to 0ed2568 Compare November 25, 2026 19:06
@gitar-bot

gitar-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
CI failed: The ruling update job failed because the upstream ruling-qa job was cancelled, so no artifacts were downloaded. The analyzer attributes this to infrastructure cascade rather than the PR changes (related_to_pr=no), with high confidence.

Overview

The ruling update job failed because the upstream ruling-qa job was cancelled, so no artifacts were downloaded. The analyzer attributes this to infrastructure cascade rather than the PR changes (related_to_pr=no), with high confidence.

Failures

Ruling Update and Notify failed: no ruling artifacts downloaded after upstream ruling-qa cancellation

  • Type: infrastructure
  • Affected jobs: 139444524564
  • Related to change: no
  • Confidence: high
  • Root cause: The log explicitly reports Ruling QA result: cancelled; the update action then finds 0 artifacts and fails during Sync ruling artifacts with No artifacts were downloaded. This is a cascading CI failure from the cancelled upstream job, not evidence of a ruling mismatch. The PR changes add a SemSitter translator, but the supplied evidence does not connect those changes to the upstream cancellation.
  • Suggested fix: Rerun the ruling-qa jobs and ensure they complete and upload their actual_* artifacts before running the update job. If cancellation is expected, update the workflow to skip artifact synchronization when ruling-qa is cancelled.

Summary

  • Change-related failures: 0
  • Infrastructure/flaky failures: 1
  • Recommended action: Rerun the ruling-qa jobs and ensure they complete and upload their actual_* artifacts before running the update job. If cancellation is expected, update the workflow to skip artifact synchronization when ruling-qa is cancelled.
Code Review ✅ Approved 🟡 Medium risk

The new SemSitter translator replaces parsing and semantic-model construction when enabled, so translation gaps could alter analysis results across Java files.

Routes SemSitter document translation into the Sonar Java tree behind a feature flag that stays off by default, covering symbols, types, and warnings, with enum constant constructors and annotation values kept as ECJ provides them and unresolved methods given the unknown type as owner. No issues found.

Verification Rules 3/3 met Repos 1 inspected · PRs 1 inspected

Functional validation No results

Rules 3 passed 2 not applicable

✅ Internal artifact registries
✅ Release secrets usage
✅ Repository license compliance

Broader impact Repos 1 inspected PRs 1 inspected
Cross-repo 1 repository inspected 0 open impacts

SonarSource/sonar-java-symbolic-execution Inspected

Cross-PR 1 PR inspected 0 open impacts

PR 6555: SONARJAVA-7339 Record SemSitter server answers for the translator tests Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

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

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

@sonarqube-next

Copy link
Copy Markdown
Contributor

Quality Gate failed Quality Gate failed

Failed conditions
304 New issues
14.1% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE SonarQube for IDE

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 7 days with no activity. If there is no activity in the next 7 days it will be closed automatically

@github-actions github-actions Bot added the stale label Dec 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant