Repository navigation
Fix(sonarqube): Adopt tox-run-action v1.0.0 - #192
Merged
ModeSevenIndustrialSolutions merged 1 commit intoNov 3, 2026
Merged
ModeSevenIndustrialSolutions merged 1 commit into
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
There was a problem hiding this comment.
🟡 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
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>
lf-releng-code-monkey-bot
Bot
force-pushed
the
code-monkey/issue-191
branch
from
November 3, 2026 02:30
79850dd to
c736f16
Compare
ModeSevenIndustrialSolutions
approved these changes
Nov 3, 2026
ModeSevenIndustrialSolutions
merged commit Nov 3, 2026
529c543
into
lfreleng-actions:main
16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #191
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLIdfc8bc2cd4b78c87b9168d3ff459786398e99ec8bash tests/tox-python-steps.shprek run --files .github/workflows/sonarqube-cloud.yaml .github/workflows/workflow-tests.yaml README.md tests/tox-python-steps.shzizmor --persona auditor --offline .github/workflows/sonarqube-cloud.yaml .github/workflows/workflow-tests.yamlaislop scan --base dfc8bc2cd4b78c87b9168d3ff459786398e99ec8 --json (diagnostics: [])prek run --hook-stage commit-msg --commit-msg-filename <HEAD message> (gitlint)git log --raw --format=%h dfc8bc2cd4b78c87b9168d3ff459786398e99ec8..HEAD (no 100755/120000/160000, no mode changes)The
github-code-monkey-botworkflow 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: toxbuild fromtox-run-actionv0.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
actions/setup-pythonwith the caller'spython_version/python_version_filefor every tox build. With both inputs empty, setup-python reads a.python-versionat the workspace root (as tox-run-action's own setup-python does), and without one sets no version.<caller>then3.13(tox runs on the last), setsTOX_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.tox_envs/tox_parallelvalues that v1.0.0 would reject, before the scan, naming the lane's inputs.path_prefix(Sonar'sprojectBaseDir).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 withunsupported-python. I checked this against tox-run-action v1.0.0'saction.yaml. The resolve step now runs for every tox build. The harness asserts that, and thetox-pythonmatrix has a new leg, 3.10 through a root.python-versionwith both inputs empty.Tests
tests/tox-python-steps.shruns 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.yamljobtox-python(ubuntu-24.04) runs the real steps againsttests/fixtures/tox-python. Its legs are: 3.10 viapython_version, 3.10 viapython_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 --fileson the changed files (yamllint, shellcheck, actionlint, zizmor, markdownlint, reuse, codespell and others),zizmor --persona auditor, gitlint on the commit message, and anaislopscan against the base. All of them passed.For reviewers
.python-version, both runs log setup-python's "neither input supplied" warning.