--no-pr is a top-level codeflash flag, not an optimize subcommand flag.
Placing it after optimize caused it to be passed to the JVM as an
unrecognized option.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Walk up parent directories when looking for mvnw wrapper, fixing
multi-module projects where mvnw is in the root but optimizer runs
from a submodule
- Respect user's --no-pr flag in Java tracer path instead of hardcoding
no_pr=True, allowing PR creation from tracer-based optimizations
- Add --no-pr to e2e tracer test script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Zero-config Java support (auto-detection from build files, codeflash.toml
elimination) is handled separately in cf-java-zero-config-strategy. This
commit strips those changes, keeping only bug fixes:
- JFR parser, ReplayHelper, instrumentation, replay tests
- Multi-module test root resolution
- JUnit 4/5 test framework detection
- add_help=False for optimize subparser
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use print(flush=True) instead of logging.info for subprocess output so
CI logs show progress in real-time instead of buffering until completion.
Also set PYTHONUNBUFFERED=1 for the subprocess.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Trigger on any codeflash/** or tests/** changes (not just java subset)
- Validate replay test files are discovered per-function
- Already validates: replay test generation, global discovery count,
optimization success, and minimum speedup percentage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Java projects no longer need a standalone config file. Codeflash reads
config from pom.xml <properties> or gradle.properties, and auto-detects
source/test roots from build tool conventions.
Changes:
- Add parse_java_project_config() to read codeflash.* properties from
pom.xml and gradle.properties
- Add multi-module Maven scanning: parses each module's pom.xml for
<sourceDirectory> and <testSourceDirectory>, picks module with most
Java files as source root, identifies test modules by name
- Route Java projects through build-file detection in config_parser.py
before falling back to pyproject.toml
- Detect Java language from pom.xml/build.gradle presence (no config needed)
- Fix project_root for multi-module projects (was resolving to sub-module)
- Fix JFR parser / separators (JVM uses com/example, normalized to com.example)
- Fix graceful timeout (SIGTERM before SIGKILL for JFR dump + shutdown hooks)
- Remove isRecording() check from TracingTransformer (was preventing class
instrumentation for classes loaded during serialization)
- Delete all codeflash.toml files from fixtures and code_to_optimize
- Add 33 config detection tests
- Update docs for zero-config Java setup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Git doesn't track empty directories, so src/test/java must be created
before process_pyproject_config validates tests-root exists.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use `uv run -m codeflash.main` instead of direct file path
- Remove redundant --no-pr (already hardcoded in _run_java_tracer)
- Clean up leftover replay tests between retry attempts
- Add error logging for subprocess output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Take omni-main-java's fix for E2E test runner path resolution —
uses os.path.relpath from __file__ instead of hardcoded relative path.
Also adds codeflash.toml detection for Java projects.
- Use os.path.relpath for main.py path in e2e tests
- Remove pass_fail_only kwarg from JS/Java function optimizers
- Fix Java e2e test to use JavaFunctionOptimizer for code context
- Detect codeflash.toml in e2e test runner (not just pyproject.toml)
- Use os.path.relpath for main.py path (works for any cwd depth)
- Remove pass_fail_only kwarg from JS/Java compare_test_results fallback
(main removed this parameter from equivalence.compare_test_results)
Updates inject_profiling_into_existing_test calls to include test_string
parameter. Takes main's test refactoring for multi-file code replacement
and codeflash capture.
Log "Discovered N existing unit test files" after counting tests, and
"Instrumented N existing unit test files" after injecting profiling.
Python E2E harness matches "Discovered", JS harness matches "Instrumented".
The optimized code removes `import time`, shifting all function lines
up by 1. Update expected_lines from [10-20] to [9-19] to match.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>