Skip to content

Fix(sonarqube): Adopt tox-run-action v1.0.0 - #192

Merged
ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-191
Nov 3, 2026
Merged

ModeSevenIndustrialSolutions merged 1 commit into
lfreleng-actions:mainfrom
lfreleng-bot-forks:code-monkey/issue-191

Conversation

@lf-releng-code-monkey-bot

@lf-releng-code-monkey-bot lf-releng-code-monkey-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Closes #191

Authored by an AI agent; human review required
Command Exit
bash tests/tox-python-steps.sh 0
prek run --files .github/workflows/sonarqube-cloud.yaml .github/workflows/workflow-tests.yaml README.md tests/tox-python-steps.sh 0
zizmor --persona auditor --offline .github/workflows/sonarqube-cloud.yaml .github/workflows/workflow-tests.yaml 0
aislop scan --base dfc8bc2cd4b78c87b9168d3ff459786398e99ec8 --json (diagnostics: []) 0
prek run --hook-stage commit-msg --commit-msg-filename <HEAD message> (gitlint) 0
git log --raw --format=%h dfc8bc2cd4b78c87b9168d3ff459786398e99ec8..HEAD (no 100755/120000/160000, no mode changes) 0

The github-code-monkey-bot workflow opened this pull request.
Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds; a maintainer must act on any finding that remains after that, and reviews every round before merge.

Round 1 of revision, on its base.


Moves the SonarQube lane's build_type: tox build from tox-run-action v0.2.0 to v1.0.0 (1d68abdb…, the tag's commit), and keeps callers on Python older than 3.11 working, since v1.0.0 runs tox only on 3.11 or newer.

What it does

  • Resolve tox Python runs actions/setup-python with the caller's python_version / python_version_file for every tox build. With both inputs empty, setup-python reads a .python-version at the workspace root (as tox-run-action's own setup-python does), and without one sets no version.
  • Plan tox Python: below 3.11, hands tox-run-action <caller> then 3.13 (tox runs on the last), sets TOX_OVERRIDE=testenv.default_base_python=python<major>.<minor>, and warns in the log and step summary. On 3.11 or newer, or with nothing resolved, the action gets the caller's inputs unchanged.
  • Validate tox inputs (validate job) rejects tox_envs / tox_parallel values that v1.0.0 would reject, before the scan, naming the lane's inputs.
  • README and input descriptions document the Python handling and the stricter inputs. Coverage still lands under path_prefix (Sonar's projectBaseDir).

This round

Copilot found that with both Python inputs empty the resolve step was skipped, while tox-run-action's setup-python still read a root .python-version; at 3.10 v1.0.0 failed with unsupported-python. I checked this against tox-run-action v1.0.0's action.yaml. The resolve step now runs for every tox build. The harness asserts that, and the tox-python matrix has a new leg, 3.10 through a root .python-version with both inputs empty.

Tests

  • tests/tox-python-steps.sh runs the validation and plan steps, lifted from the workflow, against generated inputs, and checks that the test job wires the steps the same way the lane does (73 cases).
  • workflow-tests.yaml job tox-python (ubuntu-24.04) runs the real steps against tests/fixtures/tox-python. Its legs are: 3.10 via python_version, 3.10 via python_version_file, 3.10 via a root .python-version, and 3.12 with no split. The fixture's environment fails unless it runs on the expected Python. Sonar itself is not run, because it needs credentials.

Checks run locally

bash tests/tox-python-steps.sh, prek run --files on the changed files (yamllint, shellcheck, actionlint, zizmor, markdownlint, reuse, codespell and others), zizmor --persona auditor, gitlint on the commit message, and an aislop scan against the base. All of them passed.

For reviewers

  • Tox builds with no Python input now run setup-python twice (once here, once inside the action). With no root .python-version, both runs log setup-python's "neither input supplied" warning.
  • The new matrix leg has only run in CI, not locally.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Empty Python inputs skip resolution even when tox discovers Python 3.10 via a root .python-version, causing build failure and potentially allowing analysis to proceed without fresh coverage.

1 open issue
What changed in this PR

Updates the SonarQube tox build lane to tox-run-action v1.0.0, adding Python-version handling intended to preserve older-Python callers while meeting tox’s Python 3.11 minimum.

Changes:

  • Adds early tox input validation and separates tox’s runtime from older test interpreters.
  • Adds shell checks and a three-leg integration matrix for Python resolution and interpreter selection.
  • Documents Python compatibility, stricter inputs, and coverage-path behavior.
File Description
tests/​tox-python-steps.sh Checks input validation, Python planning, and workflow wiring.
tests/​fixtures/​tox-python/​tox.ini Defines a fixture environment without a Python factor.
tests/​fixtures/​tox-python/​check_python.py Verifies the fixture’s actual Python version.
README.md Documents tox runtime requirements and input behavior.
.github/​workflows/​workflow-tests.yaml Adds shell checks and Python integration-test legs.
.github/​workflows/​sonarqube-cloud.yaml Updates the action pin and adds validation and Python planning.

Review effort: Balanced

Comment thread .github/workflows/sonarqube-cloud.yaml Resolved
Move the tox build to tox-run-action v1.0.0. That release runs tox
only on Python 3.11 or newer, so a caller asking for 3.10 or older
would break on a bare pin bump, and with build_permit_fail set the
analysis would quietly lose the tox build's coverage.

Resolve the caller's Python with setup-python first, for every tox
build, so a python_version_file counts too, and so does a
.python-version at the workspace root, which setup-python reads when
neither input is set. Below 3.11, hand tox-run-action the caller's
Python first and 3.13 last, so tox runs on 3.13, and set
TOX_OVERRIDE=testenv.default_base_python=python<major>.<minor> so
environments without a Python factor keep the caller's Python. Warn
in the log and the step summary when that happens. On 3.11 and newer,
or when nothing names a version, the action is called as before.

Validate tox_envs and tox_parallel in the validate job against the
action's stricter v1 rules, so a bad value fails before the scan
with a message naming the lane's input.

Test the validation and the plan in tests/tox-python-steps.sh, and
run the steps for real against a fixture project in a new matrix
job of workflow-tests.yaml, on ubuntu-24.04, with legs for 3.10
through python_version, 3.10 through python_version_file, 3.10
through a root .python-version with neither input set, and 3.12.

Review round 1: Copilot found that with both Python inputs empty the
resolve step was skipped, while tox-run-action's own setup-python
still read a root .python-version; at 3.10 the action then failed
with unsupported-python. The resolve step now runs for every tox
build, the harness asserts that, and a new matrix leg covers it.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues require changes before approval.

No open issues 🎉

Review effort: Balanced

@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions merged commit 529c543 into lfreleng-actions:main Nov 3, 2026
16 checks passed
@ModeSevenIndustrialSolutions
ModeSevenIndustrialSolutions deleted the code-monkey/issue-191 branch November 3, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix(sonarqube): Adopt tox-run-action v1.0.0

2 participants