CI: run SonarCloud analysis on PRs (Clean-as-You-Code) to catch new S3415 and similar regressions
Maintainer thường phản hồi trong vòng 1 ngày
@milamberspace đang làm issue này rồi.
Từ ngày 10/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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).
- Ngôn ngữ chính
- Java
- Star
- 9.6k
- Fork
- 2.3k
- Merge trung bình
- 18 giờ 33 phút
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/jmeter
-
[Bug] Typo in assertion property name: "Asserion.test_strings" missing 't'Có thể đã có người làm @waterWang đã nhận 49 ngày trước. Đang mởdefect to-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
apache/jmeter#6751 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
RandomDate ignores inclusive end date and throws when start == endCó thể đã có người làm @weillercarvalho đã nhận 326 ngày trước. Đang mởdefect to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
apache/jmeter#6609 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
invalid wontfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
apache/jmeter#5770 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/jmeter
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
floci-io/floci#5369 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sqlcipher/sqlcipher-android#97 · 1 bình luận ·
-
bug IIIF interoperability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Netcracker/qubership-integration-platform#1046 ·
Maintainer thường phản hồi trong vòng 2 ngày