Commit Graph

40 Commits

Author SHA1 Message Date
dejan2609 a37616a1eb
KAFKA-19664 Support building with Java 25 (LTS release)
notes:
 - spotbugs related Gradle tasks are temporarily disabled for Java 25 (see https://issues.apache.org/jira/browse/BCEL-377)
 - zinc upgrade: 1.10.8 -->> 1.11.0 (Java 25 compatibility): https://github.com/sbt/zinc/releases/tag/v1.11.0
 - Scala version patch update: 2.13.16 -->> 2.13.17 https://contributors.scala-lang.org/t/scala-2-13-17-release-planning/6994/17
 - GitHub Action now supports Java 25
 - mockito version upgrade: 5.14.2 -->> 5.20.0 (in order to resolve test issues)
   - https://issues.apache.org/jira/browse/SOLR-17718
   - https://github.com/mockito/mockito/releases/tag/v5.20.0
2025-10-07 14:19:43 +02:00
Yunchi Pang e1b7699975
MINOR: Bump versions in CI (#20497)
**Summary**

This PR bumps several GitHub Actions and dependencies used in CI
workflows to their latest stable versions. This ensures our CI
environment remains consistent, secure, and aligned with upstream
improvements.

**Changes**

- requests: 2.32.3 → 2.32.4
- actions/checkout: v4 → v5
- actions/setup-python: v5 → v6
- actions/setup-java: v4 → v5
- actions/download-artifact: v4 → v5
- actions/labeler: v5 → v6

related: https://github.com/apache/kafka/pull/19940/files#r2328391161

Reviewers: Ken Huang <s7133700@gmail.com>, TengYao Chi
 <kitingiao@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2025-09-15 10:35:42 +08:00
Stig Døssing 7d2ad18520
KAFKA-19580 Upgrade to spotbugs 4.9.4 (#20333)
Use Java 24 for the spotbugs checks, now that Spotbugs works  on Java
24.

Added some more warning exclusions for warnings that are new to 4.9.4.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-08-10 23:38:15 +08:00
Stig Døssing 25da705178
MINOR: Run CI with Java 24 (#20295)
This commit updates CI to test against Java 24 instead of Java 23 which
is EOL.

Due to Spotbugs not having released version 4.9.4 yet, we can't run
Spotbugs on Java 24. Instead, we are choosing to run Spotbugs, and the
rest of the compile and validate build step, on Java 17 for now.

Once 4.9.4 has released, we will switch to using Java 24 for this.

Exclude spotbugs from the run-tests gradle action. Spotbugs is already
being run once in the build by "compile and validate", there is no
reason  to run it again as part of executing tests.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2025-08-05 21:26:13 +08:00
xijiu a6064e0800
KAFKA-17607: Add CI step to verify LICENSE-binary (#18299)
Add the verify_license.py script to our build to detect missing licenses.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ken Huang <s7133700@gmail.com>, David Arthur <mumrah@gmail.com>
2025-03-07 09:45:23 -05:00
David Arthur da7d56a5cc
MINOR Add a required status check for trunk (#19122)
Add a single job that runs after the whole CI pipeline and make it a
required check before merging a PR. This will prevent us from merging
PRs which have not run through the CI.

Reviewers: Justine Olshan <jolshan@confluent.io>
2025-03-05 14:48:46 -05:00
David Arthur d51817699f
KAFKA-18500 Build PRs at HEAD commit (#18449)
The default checkout behavior for GitHub Actions is to use a special
merge ref which is equivalent to the base branch with the PR merged into
it. While this is crucial for checking compilation issues against trunk,
it significantly diminishes our ability to use any build caching.

This patch changes the JUnit test jobs to checkout the HEAD commit of the PR 
when building. The "Compile and Check" step still checks out the merge commit
so we can keep that level of validation.

Reviewers: Ismael Juma <ismael@juma.me.uk>, Chia-Ping Tsai <chia7712@gmail.com>
2025-03-03 19:02:10 -05:00
David Arthur cb33e98dfc
KAFKA-18748 Run new tests separately in PRs (#18770)
Split the JUnit tests into "new", "flaky", and the remainder. 

On PR builds, "new" tests are anything that do not exist on trunk. They are run with zero tolerance for flakiness. 

On trunk builds, "new" tests are anything added in the last 7 days. They are run with some tolerance for flakiness.

Another change included here is that we will not update the test catalog if any test job fails on a trunk build. We have had difficulty determining if all the tests had or not (due to timeout or failures in upstream Gradle tasks). By requiring green ":test" jobs, we can be sure that the resulting catalog will be valid.

---

The purpose of this change is to discourage contributors from adding flaky tests, but give some leeway for trunk so we have successful builds.

The "quarantinedTest" Gradle target has been consolidated into the regular "test" target. There are now some
runtime properties to control what tests are run.

* kafka.test.catalog.file: path to test catalog
* kafka.test.run.new: include new tests. this selection depends on the age of the loaded test catalog
* kafka.test.run.flaky: include tests marked as `@Flaky` (replaces the `excludeTags 'flaky'` directive)
* kafka.test.verbose: include additional logging from new JUnit classes (enabled by default if re-running GitHub workflow with debug logging enabled)
* maxTestRetries: how many retries to allow via Develocity retry plugin (default 0)
* maxTestRetryFailures: how many failures to allow before stopping retries (default 0)


Thanks to Jun Rao for inspiring the idea.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, Ismael Juma <ismael@juma.me.uk>, Jun Rao <junrao@gmail.com>
2025-02-24 17:08:15 -05:00
Clay Johnson e9e03faf87
KAFKA-18454 Publish build scans to develocity.apache.org (#18539)
This patch includes some maintenance updates for Develocity.

* Publish build scans to develocity.apache.org
* Update Develocity Gradle plugin to to 3.19
* Use `DEVELOCITY_ACCESS_KEY` to authenticate to `develocity.apache.org`

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2025-01-21 13:37:27 -05:00
David Arthur 649cd6b42c
MINOR Fix conditional in Update Test Catalog workflow (#18289)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-24 09:05:37 -05:00
David Arthur af5d6c2578
MINOR Fix some test-catalog issues (#18272)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-12-20 08:42:57 -05:00
Ken Huang 08efe735a4
KAFKA-18241: add docs check to CI (#18183)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>, David Arthur <mumrah@gmail.com>
2024-12-18 13:20:29 -05:00
TengYao Chi 056a76e2b9
KAFKA-17811 Separate modules to use different JDKs (#17522)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-26 23:30:41 +08:00
David Arthur 5f4cbd4aa4
KAFKA-17767 Automatically quarantine new tests [5/n] (#17725)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-19 09:56:36 +08:00
David Arthur 2696a6d7a1
KAFKA-17767 Load test catalog data [3/n] (#17654)
Add a new "load-catalog" job to the workflow. This job will checkout the test-catalog branch at 7 days prior and generate a text file of all the tests that were known at that time. This file is then passed down to the two parallel "test" jobs to be used as a source of data for the quarantined test behavior.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-01 10:38:47 -04:00
David Arthur dd432c0ca1
MINOR: Add links test catalog commits (#17650)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-11-01 00:53:02 +08:00
David Arthur 835f256f70
MINOR: Don't run update-test-catalog on PRs (#17640)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-30 16:57:49 -04:00
David Arthur 68c6c6da86
KAFKA-17767 Store the test catalog in Git [2/n] (2nd attempt) (#17627)
This patch adds a CI job to store our test catalog in an orphaned branch named "test-catalog" within this repo. 
This data will be used to help determine which tests should be quarantined.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-30 13:50:42 -04:00
David Arthur 8c071b02e9
MINOR: Fix JDK versions in CI (#17621)
Our "validate" job was running on JDK 21 while the "test" job was running 11 and 23. This patch updates the validate job to 23 and fixes the test catalog step to only run on JDK 23 (instead of 21)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-29 13:58:38 +08:00
Ken Huang 76a9df47ca
KAFKA-17639 Add Java 23 to CI build matrix (#17409)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-20 23:55:19 +08:00
David Arthur ef6c950b88
KAFKA-17767 Extract test catalog from JUnit output [1/n] (#17397)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-17 14:09:22 +08:00
David Arthur ca42226864
MINOR: clean up GHA names (#17470)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-12 10:33:34 +08:00
David Arthur d66d808172
MINOR: fix some GHA run syntax (#17471)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-12 08:52:55 +08:00
David Arthur d38a90df2b
KAFKA-17672 Run quarantined tests separately (#17329)
Introduce new quarantinedTest that excludes tests tagged with "flaky". Also introduce two new build parameters "maxQuarantineTestRetries" and "maxQuarantineTestRetryFailures".

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-06 14:09:24 +08:00
David Arthur bbbf688f55
KAFKA-17684 Update our java build versions (#17350)
This updates the versions of Java we test on from 8 and 21 to 11 and 21. This also removes unnecessary Check and Compile Java variations.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-10-04 09:46:27 +08:00
Logan Zhu 06d2649e2e
KAFKA-17606: Include Rat errors in GitHub workflow summary (#17280)
Reviewers: David Arthur <mumrah@gmail.com>
2024-10-01 09:47:07 -04:00
David Arthur c969c86739
MINOR Don't run tests for Draft PRs (#17299)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-28 10:09:35 -04:00
David Arthur e3983c2a44
MINOR Fix is-public-fork input type (#17227)
Fix the CI workflow to treat the `is-public-fork` input as a string. 

Also add some docs on composite actions.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-19 14:13:06 -04:00
David Arthur 61a8d6584f
MINOR Always publish build scan in CI Complete workflow (#17195)
This patch bring the PR and trunk builds closer in line. Rather than switching between `--scan` and `--no-scan`,
both scenarios now use `--no-scan` and rely on the CI Complete workflow to publish the scans.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-14 08:48:42 -04:00
David Arthur 420f69abbd
MINOR Add a thread dump on build timeout (#17181)
In the case of a CI timeout, this patch uses jstack to capture thread dumps from the Gradle test workers.
These thread dumps are stored in files which are later archived by the CI workflow.

This patch also increases the compression level to 9 for our "actions/upload-artifact" steps to save a bit of storage space. 

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-13 11:16:50 -04:00
David Arthur 975bc831d1
MINOR Fix trunk build scan (#17152)
Trunk builds are run off of "push" events rather than "pull_request". We were missing some logic in the is-public-fork condition that mistakenly caused some trunk builds to skip the build scan.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-10 10:09:44 -04:00
David Arthur 4d182d12f6
MINOR Add status check for gradle scan (#17140)
Add a commit status check so PRs can easily access the build scan.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-09 15:15:47 -04:00
David Arthur b317624baa
MINOR Enable the GitHub build by default (#17105)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-09 13:58:16 -04:00
David Arthur 049b7cde4c
MINOR Allow PRs to publish build scan (#17123)
Publish Gradle build scans produced by PRs. This is done by using a `workflow_run` action that is triggered when the "CI" workflow completes. It downloads the build scan files from the PR workflow and publishes to ge.apache.org.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-08 17:24:35 -04:00
David Arthur 040ae26472
KAFKA-17479 Fail the whole pipeline if junit step times out [4/n] (#17121)
Fixes an issue where the CI workflow could appear to be successful in the event of a timeout and no failing tests. Instead of using Github Action's timeout, this patch makes use of the linux `timeout` command. This lets us capture the exit code and handle timeouts separately from a failed execution.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-07 15:13:20 -04:00
David Arthur 62379d7d53
KAFKA-17479 Fix ignoreFailures logic in CI workflow [3/n] (#17106)
The ignoreFailures property was removed in #17066 to prevent test failures from being cached. However, this breaks the JUnit report and makes the github workflow less user friendly.

The problem is that we are copying the junit test report files into a new directory (added in #17098) in a Gradle doLast closure. If we don't run with ignoreFailures=true, then this closure will not run and the test failures won't be processed by junit.py.

This patch adds logic to ensure the doLast closure of :test is always run. The user provided -PignoreFailures is still honored for the test tasks so local developer workflows should not be disturbed.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-06 14:47:42 -04:00
David Arthur 84aa5d7a63
KAFKA-17479 Relocate junit XML files [2/n] (#17098)
Recently, we fixed caching for ":jar" and ":test" tasks. A side effect of this is that the test results will be restored as part of the Gradle cache resolution. This means test tasks which are skipped (as a result of FROM-CACHE) will still have test results in their build directory. To avoid incorrectly reporting these results in the job summary, this patch uses a doLast task handler to relocate JUnit XML files into a new directory.

This patch also removes the "continue-on-error" from the JUnit test step which caused timed-out builds to appear successful.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-05 13:50:33 -04:00
David Arthur 0294b1402d
KAFKA-17479 Allow ":jar" tasks to be cached [1/n] (#17066)
For several modules, we include a kafka-version.properties in the Jar file. This file includes the Git SHA of the project at the time of the build. This means that even if no source files change, the :jar task will never be UP-TO-DATE between two git commits. Ultimately, this breaks Gradle caching.

This patch marks all of the createVersionFile tasks as cacheable and also changes our Gradle invocation to override the commit ID to a dummy static value. This will allow the :jar task to be cacheable and reusable between builds.

This patch also configures the trunk build to only write to the build cache and not read from it. This will prevent any cache pollution/corruption from propagating from build to build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-09-04 15:06:11 -04:00
David Arthur 237138e04b
MINOR: fix for opt-in flag for Github build (#17031)
Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-29 23:38:40 +08:00
David Arthur 0123bdcf06
MINOR: Fix GH Gradle caching (#16975)
In order for Gradle to restore the cache, it needs to use the same workflow ID. This PR consolidates trunk and PRs builds to both use the CI build.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
2024-08-24 01:47:09 +08:00