Commit graph

218 commits

Author SHA1 Message Date
Kevin Turcios
c613fda5de Merge main, resolve prek conflict (keep shared workflow) 2026-04-23 05:27:38 -05:00
Kevin Turcios
8fe6b8fd56 fix(ci): skip e2e tests on Dependabot PRs
Dependabot PRs can't access repo secrets, so e2e tests always fail
with missing CODEFLASH_API_KEY. Skip all three e2e job groups
(Python, JS, Java) when the actor is dependabot[bot]. The gate job
already accepts skipped jobs.
2026-04-23 05:20:46 -05:00
Kevin Turcios
25ba54e3e7
Merge pull request #2101 from codeflash-ai/dependabot/github_actions/actions/cache-5
chore(deps): bump actions/cache from 4 to 5
2026-04-23 05:19:45 -05:00
Kevin Turcios
bf8a1e469e
Merge pull request #2100 from codeflash-ai/dependabot/github_actions/actions/upload-artifact-7
chore(deps): bump actions/upload-artifact from 4 to 7
2026-04-23 05:19:43 -05:00
Kevin Turcios
c0b728beff
Merge pull request #2099 from codeflash-ai/dependabot/github_actions/softprops/action-gh-release-3
chore(deps): bump softprops/action-gh-release from 2 to 3
2026-04-23 05:19:40 -05:00
Kevin Turcios
2c3e0f66e0
Merge pull request #2098 from codeflash-ai/dependabot/github_actions/astral-sh/setup-uv-8.1.0
chore(deps): bump astral-sh/setup-uv from 8.0.0 to 8.1.0
2026-04-23 05:19:37 -05:00
Kevin Turcios
f39b953af0
Merge pull request #2097 from codeflash-ai/dependabot/github_actions/actions/github-script-9
chore(deps): bump actions/github-script from 7 to 9
2026-04-23 05:19:35 -05:00
Kevin Turcios
9a2a3f734d chore: mark js-esm-async e2e as allowed failure
The async optimization e2e is LLM-quality dependent — the optimizer
struggles to produce correct candidates for Promise.all patterns,
causing consistent failures unrelated to code correctness. Mark it
continue-on-error so it doesn't block the gate job.
2026-04-23 05:11:51 -05:00
Kevin Turcios
92c8727495 fix: only skip linked-issue check for org members, not collaborators 2026-04-23 05:05:12 -05:00
Kevin Turcios
b2858dc328 chore: skip linked-issue check for org members
Use github.event.pull_request.author_association to bypass the
linked-issue requirement for MEMBER and COLLABORATOR authors.
External contributors still must reference an issue or discussion.
2026-04-23 05:01:02 -05:00
Kevin Turcios
c4bc18e233 ci: use shared workflows for change detection, prek, and gate job
Replace inline determine-changes, prek, and required-checks-passed
jobs with reusable workflows and composite actions from
codeflash-ai/github-workflows. This reduces CI maintenance burden
by centralizing common CI logic.
2026-04-23 04:35:15 -05:00
dependabot[bot]
86e11dbb38
chore(deps): bump actions/cache from 4 to 5
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 09:15:47 +00:00
dependabot[bot]
a396c62160
chore(deps): bump actions/upload-artifact from 4 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 09:15:43 +00:00
dependabot[bot]
647eb4ba17
chore(deps): bump softprops/action-gh-release from 2 to 3
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 09:15:40 +00:00
dependabot[bot]
740c61a679
chore(deps): bump astral-sh/setup-uv from 8.0.0 to 8.1.0
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 8.0.0 to 8.1.0.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v8.0.0...v8.1.0)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 8.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 09:15:37 +00:00
dependabot[bot]
2b5eef8d20
chore(deps): bump actions/github-script from 7 to 9
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 9.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 09:15:32 +00:00
Kevin Turcios
d6d40ed431 Gitignore code_to_optimize lockfiles, re-enable Dependabot updates
- Add code_to_optimize/**/package-lock.json to .gitignore
- Re-enable Dependabot version updates with limit of 5 PRs per ecosystem
- Keep code_to_optimize/ ignore comment in dependabot.yml
2026-04-23 04:13:23 -05:00
Kevin Turcios
8956fdac22
Merge pull request #2094 from codeflash-ai/test/coverage-infrastructure
test: set up coverage infrastructure in CI
2026-04-23 03:18:57 -05:00
Kevin Turcios
14ca2c897d
Merge pull request #2093 from codeflash-ai/chore/require-linked-issue-on-prs
chore: require PRs to link an issue or discussion
2026-04-23 03:08:29 -05:00
Kevin Turcios
0232d84a7d fix: exclude test_tracer.py from coverage run and lower floor to 58%
pytest-cov's trace function conflicts with the Tracer class under test,
causing it to self-disable in CI. Linux also reports ~1% lower coverage
than macOS due to platform-specific branches.
2026-04-23 03:04:49 -05:00
Kevin Turcios
9d9e7cd0ee chore: add CODEOWNERS based on git history
Assigns per-directory code ownership to current org members based on
full commit history analysis, so PRs automatically request reviews from
the right people.
2026-04-23 02:55:05 -05:00
Kevin Turcios
2c79e50d68 test: set up coverage infrastructure in CI
- Add pytest-cov to dev dependencies
- Add .coveragerc with branch coverage, 60% floor (current baseline),
  and source/omit configuration
- Add coverage CI job (ubuntu/py3.13) that runs pytest with --cov,
  enforces the floor, and uploads coverage.xml as an artifact
- Wire coverage into the required-checks-passed gate

Closes #2080
2026-04-23 02:30:46 -05:00
Kevin Turcios
972d88c108 chore: require PRs to link an issue or discussion
- Add PR template with required linked issue/discussion section
- Add check-linked-issue CI job that validates PR body contains a
  reference (#123, Closes/Fixes/Relates, GitHub URL, or CF-# ticket)
- Wire into required-checks-passed gate so it blocks merge
- Update CONTRIBUTING.md with the policy and motivation
2026-04-23 02:27:49 -05:00
Kevin Turcios
0cb67c1a17 fix: add --no-pr to codeflash optimize workflow to prevent CI-opened PRs 2026-04-10 15:12:48 -05:00
Kevin Turcios
40f16b565a ci: add standalone Java E2E workflow for isolated testing 2026-04-10 13:09:36 -05:00
Kevin Turcios
cb87763a2d fix: skip environment approval gate for trusted users on workflow_dispatch 2026-04-10 12:58:54 -05:00
Kevin Turcios
ecf4e63eca perf: reduce Java E2E looping time to 5s and cache runtime JAR build
Make TOTAL_LOOPING_TIME configurable via CODEFLASH_LOOPING_TIME env var
(defaults to 10s). Set to 5s in Java E2E CI jobs to cut verification
time per candidate. Also cache the codeflash-runtime JAR keyed on
source hash to skip mvn install when unchanged.
2026-04-10 09:02:45 -05:00
Kevin Turcios
21f61ec93d ci: add java_tracer_e2e fixture path to e2e_java change detection
The fixture directory wasn't in the path filter, so changes to
Workload.java didn't trigger the java E2E tests.
2026-04-10 03:08:03 -05:00
Kevin Turcios
72a41a5665
Merge pull request #2055 from codeflash-ai/perf/defer-cli-imports
perf: defer cli.py imports for 7.7x faster --help
2026-04-10 01:59:57 -05:00
Kevin Turcios
79d47e0fae chore: delete disabled codeflash.yaml workflow
JS ESM integration test — disabled and superseded by ci.yaml's e2e-js matrix.
2026-04-10 01:51:52 -05:00
Kevin Turcios
992e91abc7 fix: prevent ruff auto-format from rewriting version.py placeholders
uv-dynamic-versioning rewrites version.py on every `uv run`, so the
ruff auto-format job was inadvertently committing dev version strings.
Restore version.py files after formatting and revert the ones already
changed on this branch.
2026-04-09 23:21:25 -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
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
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
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
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
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
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
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
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