Skip to content

AP-1544 Add mise tasks for SonarJava checks - #6596

Draft
erwan-leforestier-sonarsource wants to merge 2 commits into
ap/AP-1522from
ap/AP-1544
Draft

erwan-leforestier-sonarsource wants to merge 2 commits into
ap/AP-1522from
ap/AP-1544

Conversation

@erwan-leforestier-sonarsource

@erwan-leforestier-sonarsource erwan-leforestier-sonarsource commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of https://sonarsource.atlassian.net/browse/AP-1544

  • Add mise tasks for SonarJava checks.

Summary by Gitar

  • Mise task wrappers:
    • Added mise.toml tasks backed by scripts/mise/tasks.py and changed.py for build, unit, sanity, licensing, Plugin QA, ruling and changed-module checks
    • Added scripts/mise/doctor.py to report task prerequisites read-only without printing credentials
  • CI workflow:
    • Replaced inline build.yml Maven and Vault steps with mise run calls for ruling, Plugin QA, sanity and licensing
  • Ruling and Plugin QA:
    • Moved ruling profile selection to surefire ${ruling.test} and per-run performance measurement folders
    • Centralized licensed Orchestrator setup and GITHUB_TOKEN override in TestUtils
  • Coverage:
    • Added jacoco.skip profile and property so test:unit skips JaCoCo by default
  • Docs:
    • Updated docs/systems/build.md and licenses.md for the new mise workflow

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

AP-1544

@gitar-bot

gitar-bot Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
CI failed: The documentation check fails on an origin/master reference in docs/systems/build.md that the checker treats as an unresolvable repository path. It is unclear whether this PR introduced that reference, since the supplied diff does not show the docs edit.

Overview

The documentation check fails on an origin/master reference in docs/systems/build.md that the checker treats as an unresolvable repository path. It is unclear whether this PR introduced that reference, since the supplied diff does not show the docs edit.

Failures

Docs checker rejects origin/master reference in docs/systems/build.md (relationship to PR unclear)

  • Type: tooling
  • Affected jobs: 140576729193
  • Related to change: unclear
  • Confidence: high
  • Root cause: The failure occurs in .github/scripts/check_docs.py: it reports origin/master in docs/systems/build.md as an unknown repository path and recommends using a literal repository-root path. The PR adds origin/master as the default MISE_CHANGE_BASE in scripts/mise/doctor.py, and docs/systems/build.md is listed as changed, but the supplied diff does not show the documentation edit, so it is unclear whether the PR introduced the offending reference or how it is formatted.
  • Suggested fix: If origin/master is being documented as a branch name, format or phrase it so the docs checker does not treat it as a repository path; if it is intended to be a path, replace it with a valid repository-root path. Rerun python .github/scripts/check_docs.py to verify.

Summary

  • Change-related failures: 0
  • Infrastructure/flaky failures: 0
  • Recommended action: If origin/master is being documented as a branch name, format or phrase it so the docs checker does not treat it as a repository path; if it is intended to be a path, replace it with a valid repository-root path. Rerun python .github/scripts/check_docs.py to verify.
Code Review ⚠️ Changes requested 🟡 Medium risk 0 closed / 2 findings

Replacing inline CI commands with mise wrappers changes check execution and credential propagation; wrapper mismatches could omit validation or disrupt QA runs.

Adds mise tasks for SonarJava build, unit, sanity, licensing, Plugin QA, ruling and changed-module checks, with build.yml switched to mise run calls and a read-only doctor prerequisite check. Changes requested before merge: the ci task passes the ruling profile inside the task name, so mise run ci fails at the ruling stage and never runs either profile. The Windows-only ruling step in build.yml also keeps a dead non-Windows parallel branch that should be removed.

⚠️ Bug: ci task passes ruling profile inside the task name, so lookup fails

📄 mise.toml:62-64 📄 docs/systems/build.md:43

The ci run array uses { task = "ruling without-sonarqube-project" } and { task = "ruling only-sonarqube-project" }. In mise's run-array syntax, task is only a task name and arguments go in a separate args field (mise task configuration). mise therefore looks up a task literally called ruling without-sonarqube-project. No such task exists, so mise run ci fails once it reaches the ruling stage and never runs either ruling profile. That contradicts the task description and the claim in docs/systems/build.md that ci runs both Linux ruling profiles. Fix: put the task name and the profile in separate fields.

Pass the ruling profile through the `args` field
run = [{ task = "check" }, { task = "its:plugin" }, { task = "ruling", args = ["without-sonarqube-project"] }, { task = "ruling", args = ["only-sonarqube-project"] }]
💡 Quality: Windows-only ruling step still has dead non-Windows parallel branch

📄 .github/workflows/build.yml:151-165 📄 scripts/mise/tasks.py:73-75

This PR adds if: runner.os == 'Windows' to the original Run ruling tests step, so the step now runs only on Windows. Inside it, if [[ "${RUNNER_OS}" != "Windows" ]]; then extra_args+=(-Dparallel=methods ...) can never be true. Linux parallelism has moved into tasks.py (integration() adds -Dparallel=methods when CI is set), so this branch and its comment are leftovers that misdescribe what the step does. Fix: delete the branch and the extra_args array from the Windows step.

Remove the unreachable branch
run: |
  cd its/ruling
  # Nested Maven builds share ~/.m2; Windows denies concurrent writes to *.lastUpdated, so no parallel run here.
  mvn "-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL" "-Dorchestrator.home=$ORCHESTRATOR_HOME" package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false
🤖 Prompt for agents
Code Review: Adds mise tasks for SonarJava build, unit, sanity, licensing, Plugin QA, ruling and changed-module checks, with `build.yml` switched to `mise run` calls and a read-only `doctor` prerequisite check. Changes requested before merge: the `ci` task passes the ruling profile inside the task name, so `mise run ci` fails at the ruling stage and never runs either profile. The Windows-only ruling step in `build.yml` also keeps a dead non-Windows parallel branch that should be removed.

1. ⚠️ Bug: `ci` task passes ruling profile inside the task name, so lookup fails
   Files: mise.toml:62-64, docs/systems/build.md:43

   The `ci` run array uses `{ task = "ruling without-sonarqube-project" }` and `{ task = "ruling only-sonarqube-project" }`. In mise's run-array syntax, `task` is only a task name and arguments go in a separate `args` field ([mise task configuration](https://mise.jdx.dev/tasks/task-configuration.html)). mise therefore looks up a task literally called `ruling without-sonarqube-project`. No such task exists, so `mise run ci` fails once it reaches the ruling stage and never runs either ruling profile. That contradicts the task description and the claim in `docs/systems/build.md` that `ci` runs both Linux ruling profiles. Fix: put the task name and the profile in separate fields.

   Fix (Pass the ruling profile through the `args` field):
   run = [{ task = "check" }, { task = "its:plugin" }, { task = "ruling", args = ["without-sonarqube-project"] }, { task = "ruling", args = ["only-sonarqube-project"] }]

2. 💡 Quality: Windows-only ruling step still has dead non-Windows parallel branch
   Files: .github/workflows/build.yml:151-165, scripts/mise/tasks.py:73-75

   This PR adds `if: runner.os == 'Windows'` to the original `Run ruling tests` step, so the step now runs only on Windows. Inside it, `if [[ "${RUNNER_OS}" != "Windows" ]]; then extra_args+=(-Dparallel=methods ...)` can never be true. Linux parallelism has moved into `tasks.py` (`integration()` adds `-Dparallel=methods` when `CI` is set), so this branch and its comment are leftovers that misdescribe what the step does. Fix: delete the branch and the `extra_args` array from the Windows step.

   Fix (Remove the unreachable branch):
   run: |
     cd its/ruling
     # Nested Maven builds share ~/.m2; Windows denies concurrent writes to *.lastUpdated, so no parallel run here.
     mvn "-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL" "-Dorchestrator.home=$ORCHESTRATOR_HOME" package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false

Verification Rules 2/2 met Knowledge ✅ 1 PRs 2 inspected

Functional validation No results

Rules 2 passed 9 not applicable

✅ Approved GitHub Actions runners
✅ Internal artifact registries

Knowledge ✅ 1 expectation met

Expectation met Ruling tests: JDK 21, submodule sources, not run locally expectation met

Broader impact PRs 2 inspected
Cross-PR 2 PRs inspected 0 open impacts

PR 6541: SONARJAVA-7339 Add the SemSitter front-end module with its protobuf data model Inspected
PR 6568: JAVA-7394 Add the SemSitter frontend module and its protocol client 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.
Unblock → Override a blocking verdict and allow merging.

Comment with these commands to change the behavior for this request:

Auto-apply Compact Unblock
gitar auto-apply:on         
gitar display:verbose         
gitar unblock         

Was this helpful? React with 👍 / 👎 | Gitar

Comment thread mise.toml
Comment on lines +62 to +64
[tasks.ci]
description = "Run check, Plugin QA and both Linux ruling profiles locally"
run = [{ task = "check" }, { task = "its:plugin" }, { task = "ruling without-sonarqube-project" }, { task = "ruling only-sonarqube-project" }]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Bug: ci task passes ruling profile inside the task name, so lookup fails

The ci run array uses { task = "ruling without-sonarqube-project" } and { task = "ruling only-sonarqube-project" }. In mise's run-array syntax, task is only a task name and arguments go in a separate args field (mise task configuration). mise therefore looks up a task literally called ruling without-sonarqube-project. No such task exists, so mise run ci fails once it reaches the ruling stage and never runs either ruling profile. That contradicts the task description and the claim in docs/systems/build.md that ci runs both Linux ruling profiles. Fix: put the task name and the profile in separate fields.

Pass the ruling profile through the args field:

run = [{ task = "check" }, { task = "its:plugin" }, { task = "ruling", args = ["without-sonarqube-project"] }, { task = "ruling", args = ["only-sonarqube-project"] }]
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

RULING_PROFILE: ${{ matrix.item.profile }}
SQ_VERSION: ${{ matrix.item.sq_version }}
run: mise run ruling "$RULING_PROFILE" --sq-version "$SQ_VERSION"
- name: Run ruling tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Quality: Windows-only ruling step still has dead non-Windows parallel branch

This PR adds if: runner.os == 'Windows' to the original Run ruling tests step, so the step now runs only on Windows. Inside it, if [[ "${RUNNER_OS}" != "Windows" ]]; then extra_args+=(-Dparallel=methods ...) can never be true. Linux parallelism has moved into tasks.py (integration() adds -Dparallel=methods when CI is set), so this branch and its comment are leftovers that misdescribe what the step does. Fix: delete the branch and the extra_args array from the Windows step.

Remove the unreachable branch:

run: |
  cd its/ruling
  # Nested Maven builds share ~/.m2; Windows denies concurrent writes to *.lastUpdated, so no parallel run here.
  mvn "-Dorchestrator.configUrl=$ORCHESTRATOR_CONFIG_URL" "-Dorchestrator.home=$ORCHESTRATOR_HOME" package ${MAVEN_OUTPUT_ARGS} "-Pit-ruling,${{ matrix.item.profile }}" -Dsonar.runtimeVersion=${{ matrix.item.sq_version }} -Dmaven.test.redirectTestOutputToFile=false
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@sonarqube-next

Copy link
Copy Markdown
Contributor

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant