CI: run SonarCloud analysis on PRs (Clean-as-You-Code) to catch new S3415 and similar regressions
I maintainer di solito rispondono entro 1 giorno
@milamberspace ci sta già lavorando.
Dal 10/7/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Context
#6718 fixed ~90 occurrences of SonarQube rule java:S3415 ("assertion arguments passed in the wrong order" — assertEquals(actual, expected) instead of assertEquals(expected, actual)) across the test suite.
These accumulated because SonarCloud analysis currently runs out-of-band — a nightly report to https://sonarcloud.io/dashboard?id=JMeter via the org.sonarqube Gradle plugin — not as a per-PR check. So nothing flags a new violation when a PR introduces one.
Opening this per the discussion on #6718 (@vlsi asked whether we can add something to avoid re-introducing this type of error).
Options (rough order of effort)
1. Add SonarCloud PR analysis to the GitHub Actions CI (preferred).
The org.sonarqube plugin is already wired (org apache, project JMeter); the missing piece is a sonar step on the PR workflow plus SonarCloud's "Clean as You Code" quality gate, which fails a PR that introduces a new violation. This directly targets S3415 (and every other Sonar rule) at review time. S3415 is heuristic (name-based — it fires when a literal/constant sits in the "actual" slot), so it catches the common cases, not 100%.
2. Error Prone ArgumentSelectionDefectChecker.
Error Prone already runs in CI (the "Error Prone (JDK 21)" job), so this is the cheapest to trial. It can flag swapped variables whose names don't match the expected / actual parameters, but is unreliable for literals. Evaluate signal vs. noise before promoting it to an error.
3. AssertJ migration (largest, most durable).
assertThat(actual).isEqualTo(expected) removes the ambiguity by construction — there's no "which arg is expected?" left to get wrong. A big, separate effort, but it eliminates the whole class of bug instead of policing it.
Notes
- SonarCloud PR analysis needs a
SONAR_TOKEN(orgapache) available to the workflow — coordinate with ASF Infra / the existing nightly setup, and mind that PR analysis from forks needs apull_request_target-style flow or the token exposed safely. - Related PR: #6718 (the fix that surfaced this).
- Lingua principale
- Java
- Stelle
- 9.6k
- Fork
- 2.3k
- Merge medio
- 19h 29m
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/jmeter
-
[Bug] Typo in assertion property name: "Asserion.test_strings" missing 't'Forse già presa @waterWang l’ha presa 56 giorni fa. Apertadefect to-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
apache/jmeter#6751 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement to-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
RandomDate ignores inclusive end date and throws when start == endForse già presa @weillercarvalho l’ha presa 333 giorni fa. Apertadefect to-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/jmeter#6609 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
documentation to-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
invalid wontfix
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
apache/jmeter#5770 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/jmeter
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
scylladb/scylla-cdc-source-connector#350 ·
I maintainer di solito rispondono entro 1 giorno
-
agent:working documentation enhancement go:build lane:needs-decision
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sanne/incus-spawn#1435 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area:shuffle bug priority:high requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/datafusion-comet#7062 ·
I maintainer di solito rispondono entro 1 giorno
-
wait for review
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
AnikethTS/ChangeRadar#22 ·
I maintainer di solito rispondono entro 1 giorno