Commit graph

7976 commits

Author SHA1 Message Date
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
Kevin Turcios
46e4035b05 ci: bump astral-sh/setup-uv from v6 to v8.0.0
v8 uses immutable releases (no major/minor tags) for supply chain
security. Pinning to exact version tag per upstream recommendation.
2026-04-09 05:16:10 -05:00
Kevin Turcios
116a6741a0
Merge pull request #2042 from codeflash-ai/ci/scope-workflow-triggers
ci: scope workflow triggers to skip docs-only changes
2026-04-09 05:09:16 -05:00
Kevin Turcios
07e4566271 ci: remove self-references from workflow path filters
Editing a workflow YAML file should not trigger that same workflow
to run. Removes .github/workflows/<file> from its own paths filter
in mypy.yml, prek.yaml, and unit-tests.yaml.
2026-04-09 05:08:19 -05:00
Kevin Turcios
e2e8557958 ci: remove self-reference from codeflash-optimize paths
Editing the workflow config shouldn't trigger a full optimization run.
2026-04-09 05:04:32 -05:00
Kevin Turcios
b38cfd2186 ci: scope workflow triggers to relevant paths
- codeflash-optimize.yaml: replace paths: ['**'] wildcard with targeted filters
- mypy.yml: add path filters (was firing on every PR/push including docs)
- prek.yaml: add path filters (was firing on every PR)
- unit-tests.yaml: add path filters (was firing on every PR/push)

Docs-only, README, experiment, and LICENSE changes no longer trigger
these workflows. Saves ~20 workflow runs per docs-only PR.
2026-04-09 04:59:24 -05:00
Kevin Turcios
56841683c3
Merge pull request #2036 from codeflash-ai/perf/defer-main-imports
perf: defer module-level imports in main.py into main()
2026-04-09 04:54:09 -05:00
Kevin Turcios
0bbe22288c
Merge pull request #2035 from codeflash-ai/perf/defer-telemetry-imports
perf: defer posthog, sentry_sdk, and requests imports in telemetry
2026-04-09 04:54:06 -05:00
Kevin Turcios
07bd44db28
perf: add --version fast-path to skip full import chain
perf: add --version fast-path to skip full import chain
2026-04-09 04:50:14 -05:00
Kevin Turcios
6f3f88498a perf: defer module-level imports in main.py into main()
Move cli, console, env_utils, checkpoint, config_parser, and
version_check imports from module level into main(). These imports
trigger the full dependency chain (cfapi, models, PrComment, libcst,
requests, Rich) costing ~500ms on every CLI invocation — even for
simple commands that dont need most of these modules.

Also moves paneled_text import into print_codeflash_banner() and
passes process_pyproject_config as parameter to _handle_config_loading
to avoid a module-level reference.
2026-04-09 09:40:07 +00:00
Kevin Turcios
fd7e2c01a2 perf: add --version fast-path to skip full import chain
When the user runs `codeflash --version`, read the version string
and exit immediately without importing cli, telemetry, models, or
any other heavy modules. This mirrors the pattern used in pip where
`pip --version` was optimized from 138ms to 20ms (7x).

Before: 524ms (imports cli.py -> cfapi -> models -> libcst -> ...)
After:  ~16ms (imports only codeflash.version)
2026-04-09 09:40:07 +00:00
Kevin Turcios
161ab34f3b
Merge pull request #2041 from codeflash-ai/ci/disable-dependabot
ci: temporarily disable Dependabot PRs
2026-04-09 04:38:43 -05:00
Kevin Turcios
9af6ce8064 ci: temporarily disable Dependabot PRs
Sets open-pull-requests-limit: 0 on all ecosystems. Existing open
Dependabot PRs are unaffected — this only prevents new ones.

Re-enable by removing the open-pull-requests-limit lines.
2026-04-09 04:38:12 -05:00
Kevin Turcios
d4876edefe
Merge pull request #2039 from codeflash-ai/ci/disable-pr-review
ci: temporarily disable automatic PR review job
2026-04-09 04:33:46 -05:00
Kevin Turcios
507319066a ci: temporarily disable automatic PR review job
Adds `false &&` guard to the pr-review job condition. The job will
be skipped on all triggers until this is reverted. The @claude mention
job is unaffected.
2026-04-09 04:33:11 -05:00
Kevin Turcios
2cd23f9191 perf: defer posthog, sentry_sdk, and requests imports in telemetry
Move heavy third-party imports (posthog, sentry_sdk, and their
integrations) from module level into the functions that use them.
These imports cost ~350ms combined but are only needed when
telemetry is actually initialized, not on every CLI invocation.

- posthog_cf.py: defer `from posthog import Posthog` into
  initialize_posthog(), defer cfapi/console/lsp imports into ph()
- sentry.py: defer `import sentry_sdk` and integrations into
  init_sentry()
2026-04-09 09:16:37 +00:00
HeshamHM28
f5777947c6 Merge remote-tracking branch 'origin/main' into cf-java-void-optimization 2026-04-09 08:15:53 +00:00