Skip to content

Add fat-jar smoke test to CI pipeline - #173

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/java-llama-macos-sync-446z1f
Aug 14, 2026
Merged

Add fat-jar smoke test to CI pipeline#173
bernardladenthin merged 1 commit into
mainfrom
claude/java-llama-macos-sync-446z1f

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Added .github/smoke-fatjar-cli.sh, a cross-repo shared script that smoke-tests the fat jar by actually launching it with java -jar and verifying exit code 0 plus a success marker in output
  • Integrated smoke-fatjar job into the publish workflow, gating both snapshot and release publication on successful fat-jar execution
  • Updated CLAUDE.md to document the smoke-test strategy and why config_Plan.json with the mock provider is the appropriate test case

Rationale

The fat jar is a GitHub Release asset, but unit tests run off target/classes and never touch the assembled artifact. An unrunnable uber jar—missing Main-Class, shade-mangled resources, absent SLF4J binding—can be built and GPG-signed without detection. The smoke test catches these issues by executing the actual published artifact before release, implementing the cross-repo policy documented in workspace/policies/fat-jar-release-assets.md: "no release asset is attached that CI has not run."

The test uses config_Plan.json with the mock generation provider, which requires no GGUF model, GPU, or network—the cheapest possible real launch of the CLI. The Plan command cannot fail for configuration reasons and completes deterministically, making it ideal for smoke testing.

Test plan

  • CI is green on this branch (smoke-fatjar job runs and passes)
  • Docs updated (CLAUDE.md section added explaining the smoke-test strategy)

Related issues / PRs

Implements the cross-repo fat-jar release asset policy from workspace/policies/fat-jar-release-assets.md.

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes

https://claude.ai/code/session_01Tzo7Yi8SXP6WxhqZXXbsco

The srcmorph-cli fat jar is a GitHub-Release asset, built and GPG-signed on the publish
path — and never once launched. Nothing else in the build touches it either: unit tests,
PIT, SpotBugs and ArchUnit all run off target/classes, and `mvn package` only asserts that
the assembly plugin wrote a file. So a missing Main-Class, a shade-mangled resource or an
absent SLF4J binding would ship signed and unrunnable. Signing proves who built it, not
that it works. java-llama.cpp shipped a corrupt native library through three releases for
exactly this reason.

The new smoke-fatjar job (needs: [build], in both publish jobs' needs) downloads
plugin-jars and runs the CLI from examples/ against config_Plan.json, asserting exit 0 plus
`Main#run end.` — the exit code alone is satisfied by a JVM that starts and does nothing.
`Plan` with the mock provider needs no GGUF, no GPU and no network.

.github/smoke-fatjar-cli.sh is kept byte-identical with BitcoinAddressFinder (both CLIs
derive from the same cli.Main pattern and log the same marker); sync any edit to both copies
and to the checksum table in workspace/crossrepostatus.md. The rule and the per-repo
assertion table live in workspace/policies/fat-jar-release-assets.md.

Deliberately not `All` over a real source tree: the example configs are tuned for a small
demo tree, so All against this repo's own sources fails by design (19 files exceed the demo
model's context window with onOversize=fail) — non-deterministic, not more thorough.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tzo7Yi8SXP6WxhqZXXbsco
@bernardladenthin
bernardladenthin merged commit 7dca841 into main Aug 14, 2026
9 of 13 checks passed
@bernardladenthin
bernardladenthin deleted the claude/java-llama-macos-sync-446z1f branch August 14, 2026 07:08
@claude

claude Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Complete

No bugs, security issues, or architectural problems found.

Summary: This PR successfully adds a critical smoke test for the fat jar artifact, addressing a real gap where unit tests run off target/classes and never touch the assembled uber jar. An unrunnable artifact (missing Main-Class, shade-mangled resources, absent SLF4J binding) could ship and be GPG-signed without detection.

Key Strengths:

  • Smart test configuration using config_Plan.json with mock provider (deterministic, no GGUF/GPU/network)
  • Well-documented rationale explaining why Plan is preferred over All
  • Robust error handling (validates exactly one jar match, timeout guards hangs, logs failures)
  • Proper gating: both publish-snapshot and publish-release jobs depend on success
  • Cross-repo consistency (byte-identical with BitcoinAddressFinder)

Quality: The shell script uses set -euo pipefail, validates directories exist, handles timeouts (600s), and requires both exit code 0 AND success marker in output. This is production-ready.

Ready to merge.

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants