8000 ci(inkless): fix Gradle caching, add PR cancellation, and shard tests by jeqo · Pull Request #923 · aiven/inkless · GitHub
[go: up one dir, main page]

Skip to content

ci(inkless): fix Gradle caching, add PR cancellation, and shard tests - #923

Merged
gqmelo merged 2 commits into
mainfrom
jeqo/ci-tier1-optimizations
Dec 2, 2026
Merged

gqmelo merged 2 commits into
mainfrom
jeqo/ci-tier1-optimizations

Conversation

@jeqo
@jeqo jeqo commented Dec 1, 2026 •
Copy link
Copy Markdown
Contributor

Inkless CI wall-clock p50 grew from 30 minutes to over 50 minutes because validate runs JOOQ code generation before setup-gradle (leaving ~/.gradle non-empty and blocking cache restoration), PR runs write to the 10 GB repository cache pool via undefined inputs.* flags, and test runs seven Gradle invocations serially on two forks. Because Inkless CI result aggregates all required jobs under one check name, splitting jooq-check and sharding test across parallel runners keeps branch rules intact while cutting wall-clock time.

Commits

  • ci(inkless): fix Gradle caching, add PR cancellation, and shard tests
  • ci(inkless): pin inklessTag in validate and test for build-cache stability

See the commit messages for the reasoning behind each step.

Workflow changes

  • Adds a parallel Verify JOOQ classes (jooq-check) job and includes it in Inkless CI result.
  • Splits test into four shards per Java version (storage-inkless, core-switch, core-consolidation, and catch-all core-other-and-kafka) and scopes JUnit/thread-dump/build-scan artifacts by ${{ matrix.java }}-${{ matrix.shard }}.
  • Adds PR concurrency cancellation, drops the redundant ready_for_review trigger, and restricts Gradle cache writes to main.

Test plan

  • Verified -PexcludeTests and multi-project per-task --tests filtering locally on :clients:test and :server:test to confirm excluded classes skip execution while remaining classes and modules run in one invocation.
  • Verified Inkless CI on this PR: all 12 jobs pass (4 shards × 2 JDKs, validate, jooq-check, inkless-version-tag, and Inkless CI result).

@jeqo
jeqo added this pull request to stack #925 December 1, 2026 15:20
@jeqo
jeqo requested a balanced review from Copilot December 1, 2026 15:20
Inkless CI wall-clock p50 grew from 30 minutes to over 50 minutes because
two issues compounded each other:

- `validate` ran `generateJooqClasses` before `setup-gradle`, creating
  `~/.gradle` first and causing `setup-gradle` to skip cache restoration
  (0.16% build-cache hit rate). It also omitted `-PcommitId`, busting
  downstream build-cache keys on every commit, and both `validate` and
  `test` passed undefined `inputs.gradle-cache-*` values so every PR wrote
  1-2 GB into the 10 GB repository cache pool.
- `test` ran seven `./gradlew` invocations serially with
  `-PmaxParallelForks=2`, and all heavy cluster test classes serialized on
  one fork while the other fork sat idle.

Fix both and eliminate redundant runs:

- Add `concurrency` cancellation for pull requests so superseding pushes
  stop in-flight runs.
- Drop `ready_for_review` from `pull_request` types and remove the unused
  `is-draft` step: draft PRs already run the full workflow, so switching
  a PR to ready re-ran the same SHA.
- Move JOOQ generation and verification into a parallel `jooq-check` job
  (added to `Inkless CI result`'s `needs`) so `validate` starts with an
  empty `~/.gradle` and restores caches cleanly.
- Set `gradle-cache-read-only: ${{ github.ref != 'refs/heads/main' }}` and
  pass `-PcommitId=xxxxxxxxxxxxxxxx` in `validate`.
- Add `-PexcludeTests` support in `build.gradle` and split `test` into
  four parallel shards per Java version (`storage-inkless`, `core-switch`,
  `core-consolidation`, and catch-all `core-other-and-kafka`), raising
  default `-PmaxParallelForks` to 3 and dropping the duplicate
  `:storage:inkless:integrationTest` call.

Assisted-by: Gemini 4 Neon
@jeqo
jeqo force-pushed the jeqo/ci-tier1-optimizations branch from bd272ba to 32b409f Compare December 1, 2026 15:23
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The workflow leaves inklessTag commit-dependent, invalidating version-file and downstream runtime-classpath cache keys on every commit; both jobs need a stable inklessTag alongside commitId.

No open issues 🎉

What changed in this PR

This PR targets longer Inkless CI runtimes by improving Gradle cache reuse, canceling superseded pull-request runs, and distributing tests across parallel jobs.

Changes:

  • Move JOOQ verification into a separate required job and restrict Gradle cache writes to main.
  • Split tests into four shards per Java version, with shard-specific artifacts and configurable test exclusions.
  • Cancel superseded PR runs and remove the duplicate integration-test invocation.
File Description
build.gradle Add excludeTests support for catch-all test shards.
.github/​workflows/​inkless.yml Update caching, isolate JOOQ verification, add PR cancellation, and shard tests.

Review effort: Balanced

@jeqo
jeqo requested a balanced review from Copilot December 1, 2026 16:09
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the CI caching and test-sharding changes.

No open issues 🎉

Review effort: Balanced

…ility

`determineInklessTag()` falls back to `git describe --tags --match
inkless-* --always --dirty`, which changes on every commit and feeds
`inputs.property "inklessTag"` on every `createVersionFile` task. Pass
`-PinklessTag=unknown` alongside `-PcommitId=xxxxxxxxxxxxxxxx` in both
`validate` and `test` so version files and downstream JARs keep stable
cache keys across commits.

Assisted-by: Gemini 4 Neon
@jeqo
jeqo marked this pull request as ready for review December 2, 2026 08:12
@jeqo
jeqo requested a review from gqmelo December 2, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0