Skip to content

ci: verify the Java SDK under GraalVM native-image#315

Merged
pratyush618 merged 2 commits into
masterfrom
feat/java-graalvm-smoke
Jun 27, 2026
Merged

ci: verify the Java SDK under GraalVM native-image#315
pratyush618 merged 2 commits into
masterfrom
feat/java-graalvm-smoke

Conversation

@pratyush618

@pratyush618 pratyush618 commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

What

P15 (GraalVM): prove the Java SDK builds and runs under GraalVM native-image. The SDK uses JNI + Jackson reflection that native-image can't infer statically, so this adds a CI job that generates the reachability metadata with the tracing agent and verifies it against a real native binary.

How (web-backed library flow)

Per the native-build-tools docs, metadata is collected with the tracing agent and a smoke consumer verifies it:

  • :graalvm-smoke — a non-published subproject with a Smoke main that drives the SDK end to end (open SQLite queue → enqueue → run a worker → getResultregisterPeriodic/listPeriodiclistDead), exercising the JNI dispatch and every Jackson DTO path.
  • CI graalvm jobsetup-graalvm, then -Pagent :graalvm-smoke:run (collect JNI/reflection/resource metadata) → metadataCopynativeCompile --no-fallback → run the native binary, which prints taskito graalvm smoke ok.

The agent/native-image tasks live in the smoke subproject, not the published root — applying the plugin to the root collided with the maven-publish sourcesJar task.

Verification

  • :graalvm-smoke:run is green on the JVM locally (real JNI + Jackson) — proves the smoke logic; only nativeCompile needs the GraalVM toolchain, which runs in CI.
  • Full ./gradlew build green with the new subproject (compile + Spotless + Checkstyle).
  • No local GraalVM toolchain here, so the native-image build itself is verified by this PR's CI run.

Notes / follow-ups

  • Shipping the conditional metadata inside the published SDK jar (so consumers get it automatically) is a follow-up once the generated metadata is reviewed from a green CI run.
  • Maven Central publish (the other half of P15) is a separate, user-gated release action (publish-java.yml already wired).

Summary by CodeRabbit

  • New Features

    • Added a new Java smoke-test build for GraalVM native image support.
    • Included a new native executable check that runs end-to-end in CI.
  • Bug Fixes

    • Improved native-image compatibility by generating and reusing required metadata during the build.
    • Ensured the Java SDK smoke flow validates task execution, persistence, and periodic task handling.
  • Chores

    • Updated project configuration to include the new Java smoke-test module and ignore generated build artifacts.

A non-published consumer that drives the SDK's JNI + Jackson paths; CI builds it into a native image (metadata via the tracing agent) to verify GraalVM compatibility.
@github-actions github-actions Bot added the ci label Jun 27, 2026
@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 11cdc92e-4a19-4578-8cdf-8de0a0ba38c4

📥 Commits

Reviewing files that changed from the base of the PR and between 2a957da and 3f5d74c.

📒 Files selected for processing (5)
  • .github/workflows/ci-java.yml
  • sdks/java/.gitignore
  • sdks/java/graalvm-smoke/build.gradle.kts
  • sdks/java/graalvm-smoke/src/main/java/org/byteveda/taskito/graalvm/Smoke.java
  • sdks/java/settings.gradle.kts

📝 Walkthrough

Walkthrough

Adds a new graalvm-smoke Java subproject with a GraalVM native-image smoke entrypoint, metadata capture for native builds, and a CI job that builds and executes the native binary.

Changes

GraalVM smoke validation

Layer / File(s) Summary
Module registration and build setup
sdks/java/settings.gradle.kts, sdks/java/graalvm-smoke/build.gradle.kts
Adds the graalvm-smoke subproject and configures its plugins, repository, project coordinates, application entry point, formatting, and Checkstyle.
Smoke entrypoint
sdks/java/graalvm-smoke/src/main/java/org/byteveda/taskito/graalvm/Smoke.java
Adds Smoke.main, which creates a temporary SQLite-backed queue, runs an echo task through a worker, checks the stored result, and exercises periodic and dead-job listings.
Native-image metadata pipeline
sdks/java/graalvm-smoke/build.gradle.kts, sdks/java/.gitignore
Configures graalvmNative with --no-fallback, copies tracing-agent metadata into META-INF/native-image/, and ignores the generated metadata directory.
GraalVM CI job
.github/workflows/ci-java.yml
Adds a CI job that installs GraalVM 21, runs the smoke flow with the agent, builds the native image, and executes the resulting binary.

Sequence Diagram(s)

CI native-image flow

sequenceDiagram
  participant GitHubActions
  participant Gradle
  participant metadataCopy
  participant nativeCompile
  participant graalvmSmokeBinary

  GitHubActions->>Gradle: run GraalVM smoke tasks
  Gradle->>metadataCopy: copy tracing-agent metadata into META-INF/native-image
  Gradle->>nativeCompile: build the native image
  GitHubActions->>graalvmSmokeBinary: execute the native binary
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ByteVeda/taskito#304: Modifies the same Java CI workflow that this PR extends with a GraalVM native-image job.

Poem

I hopped through CI with a carrot grin,
A native binary warmed from within.
The queue said “success,” the smoke said “hooray,”
And dead jobs and periodic paths joined the play.
🐰

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding CI verification for the Java SDK with GraalVM native-image.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/java-graalvm-smoke

Comment @coderabbitai help to get the list of available commands.

@pratyush618
pratyush618 merged commit 7bdf707 into master Jun 27, 2026
20 checks passed
@pratyush618
pratyush618 deleted the feat/java-graalvm-smoke branch June 27, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant