Skip to content

feat: resolve codeflash-runtime from Maven Central - #1817

Merged
mashraf-222 merged 3 commits into
omni-javafrom
feat/mvn-central-runtime-resolution
Mar 12, 2026
Merged

mashraf-222 merged 3 commits into
omni-javafrom
feat/mvn-central-runtime-resolution

Conversation

@mashraf-222

@mashraf-222 mashraf-222 commented Mar 11, 2026

Copy link
Copy Markdown

Summary

  • Maven Central is now the primary resolution path for the codeflash-runtime JAR
  • GitHub Releases download as a production fallback when Maven Central is unreachable
  • Removed bundled JAR from PyPI wheel to save ~15MB
  • Removed dead dev-build fallback from the resolution chain

Problems fixed

The codeflash-runtime JAR was bundled inside the Python package and installed to the local Maven repo via install:install-file. This added ~15MB to the PyPI wheel and required a manual install step. Now that the JAR is published to Maven Central, Maven can resolve it automatically.

The previous fallback (looking for the JAR in codeflash-java-runtime/target/) only worked from a source checkout — it was dead code for production pip users.

Resolution chain

  1. ~/.m2 cache — instant, works after any previous successful resolution
  2. Maven Central — primary path, mvn dependency:resolve downloads to ~/.m2
  3. GitHub Releases download — production fallback, downloads to ~/.cache/codeflash/ then installs to ~/.m2. Activates once a release tagged runtime-v1.0.0 is published with the JAR as an asset.

Changes

codeflash/languages/java/build_tools.py

  • Added download_from_github_releases() — downloads the JAR from GitHub Releases to ~/.cache/codeflash/, caches it for subsequent runs, returns None gracefully if no release exists yet
  • Uncommented resolve_from_maven_central() — calls mvn dependency:resolve to download the JAR from Maven Central

codeflash/languages/java/test_runner.py

  • _find_runtime_jar(): removed bundled resources/ JAR lookup (no longer shipped with wheel), kept m2 cache and dev build paths (still used by build_jacoco_agent_arg() and generate_jacoco_report())
  • _ensure_codeflash_runtime(): restructured to Maven Central then GitHub Releases fallback. Removed dead dev-build fallback.

pyproject.toml

  • Enabled wheel exclusion for codeflash/languages/java/resources/codeflash-runtime-*.jar

Testing

E2E validation with empty ~/.m2 cache to exercise the full resolution chain:

  1. Fibonacci (--no-pr): Maven Central resolution succeeded (Resolved codeflash-runtime 1.0.0 from Maven Central). Optimization found (memoization), 29 correctness tests passed.
  2. Aerospike encodedLength: Used m2 cache from Fibonacci run. Pipeline completed without errors, correctness tests passed.

mohamedashrraf222 and others added 3 commits March 11, 2026 23:12
Maven Central is now the primary resolution path for the codeflash-runtime
JAR. Falls back to local dev build install for development workflows.
Excludes the bundled JAR from the PyPI wheel to save ~15MB.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a download_from_github_releases() fallback between Maven Central
and the dev-build-only local path. This gives pip users a working
fallback when Maven Central is unreachable. Downloads to ~/.cache/codeflash/
and caches for subsequent runs.

Resolution chain is now:
1. ~/.m2 cache (instant)
2. Maven Central (primary)
3. GitHub Releases download (production fallback)
4. Dev build directory (development only)

The GitHub Releases fallback will activate once a release tagged
'runtime-v1.0.0' is published with the JAR as an asset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dev build fallback (codeflash-java-runtime/target/) in
_ensure_codeflash_runtime() was dead code for production users
since that directory only exists in source checkouts. The resolution
chain is now:

1. ~/.m2 cache (instant)
2. Maven Central (primary)
3. GitHub Releases download (production fallback)

_find_runtime_jar() is kept for build_jacoco_agent_arg() and
generate_jacoco_report() which need to locate the JAR by path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mashraf-222
mashraf-222 merged commit d75ccd0 into omni-java Mar 12, 2026
27 of 29 checks passed
@mashraf-222
mashraf-222 deleted the feat/mvn-central-runtime-resolution branch March 12, 2026 02:15
mashraf-222 pushed a commit that referenced this pull request Apr 6, 2026
…tion

Gradle projects and the tracer flow could not resolve codeflash-runtime
when no local JAR was cached — the bundled JAR was removed in PR #1817
but the download fallback was only added to MavenStrategy. This adds a
direct HTTP download from Maven Central (no mvn binary required) as a
fallback in GradleStrategy.ensure_runtime() and find_agent_jar().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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