Commit graph

7839 commits

Author SHA1 Message Date
Kevin Turcios
7351d0f0ba
Merge pull request #2051 from codeflash-ai/fix/ts-e2e-test-data-size
Increase TS E2E test data size to fix flaky js-ts-class
2026-04-09 22:26:38 -05:00
Kevin Turcios
8ca0f8d2cc Fix JS line profiler empty output file causing JSONDecodeError
The profiler's save() was called every 100 hit() calls. With O(n²)
algorithms this produced hundreds of thousands of writeFileSync calls,
each truncating the file to 0 bytes before writing. If the subprocess
timed out (SIGKILL), the file was left at 0 bytes → JSONDecodeError.

Fixes:
- Move require('fs')/require('path') to module scope (not inside save())
- Reduce save-every-N from 100 → 10,000 hits (100x fewer syscalls)
- Pre-create output file with {} before running Jest (safety net)
- Handle empty files gracefully in parse_results
- Fix misleading "file not found" warning → "file empty or no timing data"
2026-04-09 22:26:23 -05:00
github-actions[bot]
23d9e73bfa style: auto-format with ruff 2026-04-09 22:26:23 -05:00
Kevin Turcios
b7bcd0fe2e ci: add code_to_optimize/js/ to e2e_js path filter
The change detection for JS E2E tests was missing the test fixture
directory, so PRs that only modify JS test data (like this one) were
skipped. Java already had its equivalent path included.
2026-04-09 22:26:19 -05:00
Kevin Turcios
a73ccca426 Increase test data size for TS findDuplicates benchmark
The js-ts-class E2E test was flaky because n=100 is too small for
the O(n²)→O(n) optimization to overcome Map/Set per-operation overhead.
At n=100, the LLM correctly generates a Map-based O(n) solution but it
benchmarks as slower (-10.6%) due to constant factor dominance.

Bump to n=10,000 so the algorithmic improvement produces measurable
speedup, making the 30% E2E threshold reliably achievable.
2026-04-09 22:26:19 -05:00
Kevin Turcios
477dfa246e
Merge pull request #2049 from codeflash-ai/ci/cleanup-test-markers
Clean up Java test skip markers
2026-04-09 22:26:10 -05:00
github-actions[bot]
41841325e2 style: auto-format with ruff 2026-04-10 03:23:38 +00:00
Kevin Turcios
da536db8a2 Clean up Java test skip markers
- Remove dead `import shutil` from test_comparator.py
- Rename `requires_java` → `requires_java_runtime` for consistency with test_run_and_parse.py
- Remove redundant `@requires_java_runtime` on test_behavior_return_value_correctness (class already has it)
2026-04-09 22:22:39 -05:00
Kevin Turcios
e73492f414
Merge pull request #2053 from codeflash-ai/fix/ci-windows-shell
fix(ci): add shell: bash to conditional install step for Windows
2026-04-09 22:22:29 -05:00
Kevin Turcios
5b6318fcbb fix(ci): add shell: bash to conditional install step for Windows
The bash [[ ]] syntax fails on Windows runners which default to
PowerShell. Explicitly setting shell: bash fixes the ParserError.
2026-04-09 22:22:11 -05:00
Kevin Turcios
145043fdb3
Merge pull request #2052 from codeflash-ai/ci/workflow-upgrades-and-fixes
ci: upgrade action versions, add uv cache, fix broken paths, DRY publish
2026-04-09 22:10:58 -05:00
Kevin Turcios
7c4d98c6e7 ci: restore uv venv --seed in claude.yml
uv venv --seed makes pip available in the venv, which the
Claude Code action may need.
2026-04-09 22:08:59 -05:00
Kevin Turcios
be4c459d01 ci: upgrade action versions, add uv cache, fix broken paths, DRY publish
- Bump actions/checkout v4/v5 → v6, setup-node v4 → v6, setup-java v4 → v5,
  prek-action v1 → v2, github-script v6 → v7, aws-credentials v4 → v6,
  claude-code-action v1.0.89 → v1
- Add enable-cache: true to all astral-sh/setup-uv steps
- Remove redundant uv venv --seed (uv sync creates venvs automatically)
- Merge double uv sync steps in unit-tests into single conditional
- Fix codeflash.yaml: broken path filter and working-directory
- Consolidate duplicate publish jobs into a single matrix job
- Remove generate_release_notes overridden by manual body
2026-04-09 22:06:41 -05:00
Kevin Turcios
153097b9a3
Merge pull request #2015 from codeflash-ai/fix/gradle-maven-central-dependency
fix: improve multi-module Gradle detection for dynamic settings.gradle.kts
2026-04-09 19:17:01 -05:00
github-actions[bot]
a6ea56bf50 style: auto-format with ruff 2026-04-09 23:44:22 +00:00
Kevin Turcios
2dba3e3849
Merge branch 'main' into fix/gradle-maven-central-dependency 2026-04-09 18:43:25 -05:00
github-actions[bot]
11201fe7c6 style: auto-format with ruff 2026-04-09 23:43:15 +00:00
Kevin Turcios
8e60f2526f
Merge pull request #2050 from codeflash-ai/ci/optimize-caching-and-cleanup
Optimize CI: npm cache, Maven consolidation, remove duplicate workflow
2026-04-09 18:43:14 -05:00
Kevin Turcios
44c1bcf458 ci: retrigger CI 2026-04-09 18:42:16 -05:00
Kevin Turcios
e2eb677d18 Optimize CI caching and remove duplicate Java workflow
- Delete standalone java-e2e-tests.yml (duplicate of ci.yaml e2e-java)
- Add npm cache to e2e-js jobs via setup-node cache option
- Consolidate Maven build: mvn clean package + install → single mvn install
- Add .github/workflows/ci.yaml and .github/actions/** to push paths
  so CI validates its own changes when merged to main
2026-04-09 18:40:22 -05:00
github-actions[bot]
64790d5b60 style: auto-format with ruff 2026-04-09 23:13:50 +00:00
Kevin Turcios
3f53309847
Merge branch 'main' into fix/gradle-maven-central-dependency 2026-04-09 18:13:18 -05:00
Kevin Turcios
61f468ab7a
ci: batch CI improvements — paths, validate-pr action, test skips, fetch-depth
ci: consolidate improvements — paths, validate-pr action, fetch-depth, continue-on-error
2026-04-09 18:12:05 -05:00
Kevin Turcios
65b117c8b8 revert: restore version.py (remove CI trigger) 2026-04-09 18:11:43 -05:00
github-actions[bot]
a957a0e6c9 style: auto-format with ruff 2026-04-09 21:02:29 +00:00
Kevin Turcios
5ff38597ef test: skip all Java integration test classes when JAR missing
Apply @requires_java_runtime to TestJavaRunAndParseBehavior and
TestJavaRunAndParsePerformance at the class level. The performance
test was failing on Windows with a flaky 10ms timing assertion
(10.515ms actual, 5% tolerance) — pre-existing issue masked by
continue-on-error.
2026-04-09 16:01:53 -05:00
github-actions[bot]
72cf0e1654 style: auto-format with ruff 2026-04-09 20:47:47 +00:00
Kevin Turcios
78372bfbfb test: skip test_behavior_return_value_correctness when JAR missing
Same fix as test_comparator.py — uses _find_comparator_jar() to skip
when the codeflash-runtime JAR isn't built. Fixes Windows unit-tests
which don't have Java pre-installed (unlike Linux runners).
2026-04-09 15:47:10 -05:00
Mohamed Ashraf
32bb1cb8da Merge remote-tracking branch 'origin/main' into fix/gradle-maven-central-dependency 2026-04-09 17:52:56 +00:00
github-actions[bot]
15811c8c03 style: auto-format with ruff 2026-04-09 17:20:24 +00:00
Kevin Turcios
e5a18feb61 test: fix requires_java to check for runtime JAR, not just binaries
Ubuntu runners have Java/Maven pre-installed, so checking for java/mvn
binaries doesn't skip. The actual dependency is the codeflash-runtime
JAR which must be built from codeflash-java-runtime/ via Maven.
2026-04-09 12:19:16 -05:00
github-actions[bot]
241fd2d59c style: auto-format with ruff 2026-04-09 17:08:10 +00:00
Kevin Turcios
be446cd8de test: skip Java comparator tests when Maven is unavailable
The requires_java marker only checked for java binary but the tests
also need mvn to build the codeflash-runtime JAR. These 13 tests
were silently failing in unit-tests (masked by continue-on-error).
2026-04-09 12:06:26 -05:00
github-actions[bot]
9a86e09460 style: auto-format with ruff 2026-04-09 17:03:22 +00:00
Kevin Turcios
619ef3de34 ci: trigger test run (will revert) 2026-04-09 12:02:44 -05:00
Kevin Turcios
d97f372f43 ci: narrow paths, extract validate-pr, remove continue-on-error
- Remove codeflash-java-runtime/ from unit_tests change detection
- Narrow e2e flag from codeflash/ to explicit Python subdirs (excludes java/, javascript/)
- Narrow tests/ in e2e_java/e2e_js to specific test scripts
- Extract duplicated Validate PR step into composite action
- Use fetch-depth: 1 for unit-tests and type-check (no git history needed)
- Remove continue-on-error: true from unit-tests (was masking real failures)
- Change git add -A to git add -u in prek auto-fix (won't stage untracked files)
2026-04-09 12:00:17 -05:00
Kevin Turcios
82249efb4f ci: remove pyproject.toml/uv.lock from Java/JS E2E triggers 2026-04-09 11:52:33 -05:00
Kevin Turcios
8bcfbb3d81 ci: scope Java/JS E2Es to language-specific paths
Expand e2e_java and e2e_js change detection to include shared pipeline
code (optimization/, verification/, languages/base.py) but decouple
from the broad e2e flag. A change to codeflash/version.py now only
triggers Python E2Es, not Java/JS E2Es.
2026-04-09 11:52:16 -05:00
Kevin Turcios
3d50ac5aae ci: auto-fix formatting in prek job
Run ruff check --fix and ruff format before prek validation.
If files were modified, commit and push the fixes automatically.
2026-04-09 11:48:19 -05:00
Kevin Turcios
39eef53657 ci: remove unnecessary JDK/Maven setup from unit-tests
Only 5 of 3,943 unit tests need Java, and they already have
skip_if_maven_not_available() guards. Java execution is validated
by the e2e-java job. Saves ~30-60s per matrix entry (7 entries).
2026-04-09 11:41:20 -05:00
Kevin Turcios
4863ec3617 ci: remove matrix name override to fix skipped check display
When matrix jobs are skipped, `${{ matrix.name }}` is never expanded,
showing literal "matrix.name" in the checks UI. Removing the `name:`
field lets GitHub use the job ID when skipped and auto-expand matrix
values when running.
2026-04-09 11:34:19 -05:00
Kevin Turcios
f658fc5ebc
Merge pull request #2046 from codeflash-ai/ci/matrix-e2e-refactor
ci: refactor 14 E2E jobs into 3 matrix jobs
2026-04-09 11:33:15 -05:00
Kevin Turcios
19927fad07 ci: refactor 14 E2E jobs into 3 matrix jobs (1094 → 521 lines)
Consolidate individual E2E workflow jobs into matrix strategy:
- 9 Python E2Es → 1 `e2e-python` matrix job
- 3 JS E2Es → 1 `e2e-js` matrix job
- 2 Java E2Es + new void-optimization → 1 `e2e-java` matrix job

Also absorbs standalone `e2e-java-void-optimization.yaml` into ci.yaml,
fixing its mutable `@v6` tag to `@v8.0.0` in the process.

Gate job now references 6 needs instead of 17.
2026-04-09 11:31:47 -05:00
Kevin Turcios
6f63ce0d60
Merge pull request #2044 from codeflash-ai/ci/skip-irrelevant-checks
ci: consolidate required checks into single gate workflow
2026-04-09 11:07:54 -05:00
Mohamed Ashraf
ebd72acb18 merge: resolve conflict with main in test_build_tools.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 15:07:17 +00:00
Hesham Mohamed
602cb68239
Merge pull request #1980 from codeflash-ai/cf-java-void-optimization
feat: support void method optimization in Java pipeline
2026-04-09 16:24:29 +02:00
Kevin Turcios
d941f3645f ci: consolidate remaining 10 workflows into ci.yaml
Add all non-required-check E2E workflows and prek lint to the
consolidated ci.yaml:

- 4 standard Python E2Es (async, benchmark, coverage, init)
- 3 JS E2Es (cjs-function, esm-async, ts-class)
- 2 Java E2Es (fibonacci-nogit, tracer)
- prek lint

New change detection outputs:
- e2e_js: triggers JS E2Es when packages/ changes
- e2e_java: triggers Java E2Es when java runtime/fixtures change

Total: 17 jobs + determine-changes + gate = 19 jobs in one file.
Down from 22 workflow files to 7 (remaining are non-test: claude,
codeflash self-optimize, label-workflow-changes, publish, java-e2e).

Additional savings per irrelevant PR: ~$0.80 (10 jobs x ~$0.08).
Total per skipped PR: ~$1.85.
2026-04-09 06:35:55 -05:00
Kevin Turcios
7e40e944b1 ci: remove self-reference from change detection paths
ci.yaml was in all three check_paths calls, so creating/modifying
the workflow itself triggered all test jobs. Workflow-only PRs
should skip tests — the gate job still validates the pattern.
2026-04-09 05:47:02 -05:00
Kevin Turcios
5877864fc8 ci: consolidate required checks into single ci.yaml with gate job
Replace 7 individual required-check workflows (unit-tests, mypy,
5 E2E tests) with a single ci.yaml following the astral-sh/ruff
gate pattern:

- determine-changes job uses native git diff (no third-party deps)
- Each test job skipped at job level when paths don't match
- Single required-checks-passed gate job accepts success + skipped
- E2E security preserved: environment gating, author allowlists

This fixes the long-standing issue where workflow-level path filters
leave required checks "Pending" on PRs that don't touch code paths,
blocking merge without admin override.

Estimated savings: ~$1.05/skipped PR ($0.64 unit-tests + $0.01
type-check + $0.40 E2E), ~$50-100/yr in compute, plus eliminating
all admin-merge workarounds.
2026-04-09 05:43:16 -05:00
Kevin Turcios
cf595236a4
Merge pull request #2043 from codeflash-ai/deps/setup-uv-v8
ci: bump astral-sh/setup-uv from v6 to v8.0.0
2026-04-09 05:18:12 -05:00