CI: run SonarCloud analysis on PRs (Clean-as-You-Code) to catch new S3415 and similar regressions
メンテナーはふだん 1 日以内に返信
@milamberspace がすでに取り組んでいます。
2026年7月10日 から。
評価
この issue はまだ評価されていません。
説明
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).
- 主要言語
- Java
- スター
- 9.6k
- フォーク
- 2.3k
- 平均マージ
- 20時間 42分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/jmeter のほかの issue
-
[Bug] Typo in assertion property name: "Asserion.test_strings" missing 't'対応中かも @waterWang が 58 日前に担当しました。 オープンdefect to-triage
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
apache/jmeter#6751 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
RandomDate ignores inclusive end date and throws when start == end対応中かも @weillercarvalho が 334 日前に担当しました。 オープンdefect to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/jmeter#6609 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
invalid wontfix
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/jmeter#5770 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
NullPointerException when a `DeserializationProblemHandler` returns `null` for `byte[]` (single value unwrapped) and `char[]` elements対応中かも @Marti2203 が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 88/100
FasterXML/jackson-databind#6300 ·
メンテナーはふだん 1 日以内に返信
-
content good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
cpinitiative/usaco-guide#6699 ·
メンテナーはふだん 1 日以内に返信
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)オープンtype: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
carlos-emr/carlos#4933 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/rocketmq-dashboard#6925 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Vakore/ZappierGames#147 ·