Repository navigation
Fix the Sonar quality gate failures in CI - #198
Open
anderslindho wants to merge 8 commits into
Open
anderslindho wants to merge 8 commits into
anderslindho wants to merge 8 commits into
Conversation
The integration and container jobs resolved their dependencies at install time, so a new upstream release could change what we test against without any change here. Sonar flags each of these installs, and they are most of why the quality gate fails. `requirements-ci-py39.txt` is now generated from `requirements-ci-py39.in`, so regenerate it rather than edit it.
A tag can be moved after we have reviewed what it points at, and the Docker actions run with a token that can push our images. Sonar raises each tag pin as a security hotspot.
Automatic analysis only reads `.sonarcloud.properties` at the repository root, so `server/sonar-project.properties` was ignored. Sonar analysed the code as Python 3.10 and newer, and could not tell the tests from the code.
Neither workflow writes to the repository, so their token should not be able to. Without `permissions`, it gets the repository default, which can include write access.
`*` does not match `/`, so a push to a branch such as `ci/foo` was not tested until a pull request was opened.
Nobody will update commit SHA pins by hand. Python packages are left out. Dependabot only checks them against Python 3.10 and newer, so it proposes versions we cannot install.
We still test on 3.6 and keep it working, even though `requires-python` starts at 3.7.
anderslindho
force-pushed
the
ci/sonar-security
branch
from
November 27, 2026 10:07
f42ca10 to
af9de2e
Compare
pip only checks hashes when the file has them. With the flag, the install fails instead if the file is ever regenerated without them.
|
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.



The Sonar quality gate fails on the security rating and on unreviewed security hotspots. All of it comes from how CI installs dependencies and pins actions, not from the recCeiver code.
The integration and container jobs now install from a hashed lockfile, like the unit job already did, and third-party actions are pinned to commit SHAs. Dependabot keeps those pins up to date. It covers GitHub Actions only, because it checks Python packages against 3.10 and newer (#194).
Sonar never read server/sonar-project.properties, because automatic analysis only reads .sonarcloud.properties at the repository root. The settings now live there, with the Python versions we test (3.6 to 3.14) and server/tests marked as tests. This removes both analysis warnings.
Two smaller CI fixes are included. The workflow token is read-only, and server.yml now runs on pushes to branches with a slash in the name.
Some findings cannot be fixed in code and will be accepted in Sonar: building recceiver and pyCFClient from source in CI (see #197), and the missing lock file for pyproject.toml, since one lock file cannot cover every Python version we support.