Skip to content

Commit 1333c8f

Browse files
committed
Merge remote-tracking branch 'origin/main' into cf-600
2 parents 431ef0a + d4dd33b commit 1333c8f

File tree

69 files changed

+5357
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5357
-113
lines changed

.github/workflows/codeflash-optimize.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
- name: 🛎️ Checkout
2929
uses: actions/checkout@v4
3030
with:
31+
ref: ${{ github.event.pull_request.head.ref }}
32+
repository: ${{ github.event.pull_request.head.repo.full_name }}
3133
fetch-depth: 0
3234
- name: Validate PR
3335
run: |
@@ -68,4 +70,4 @@ jobs:
6870
id: optimize_code
6971
run: |
7072
source .venv/bin/activate
71-
poetry run codeflash
73+
poetry run codeflash --benchmark
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: end-to-end-test
2+
3+
on:
4+
# Use pull_request_target for everything to ensure access to secrets
5+
pull_request_target:
6+
paths:
7+
- '**' # Trigger for all paths
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
benchmark-bubble-sort-optimization:
13+
# Dynamically determine if environment is needed only when workflow files change and contributor is external
14+
environment: ${{ (github.event_name == 'workflow_dispatch' || (contains(toJSON(github.event.pull_request.files.*.filename), '.github/workflows/') && github.event.pull_request.user.login != 'misrasaurabh1' && github.event.pull_request.user.login != 'KRRT7')) && 'external-trusted-contributors' || '' }}
15+
16+
runs-on: ubuntu-latest
17+
env:
18+
CODEFLASH_AIS_SERVER: prod
19+
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
20+
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
21+
COLUMNS: 110
22+
MAX_RETRIES: 3
23+
RETRY_DELAY: 5
24+
EXPECTED_IMPROVEMENT_PCT: 5
25+
CODEFLASH_END_TO_END: 1
26+
steps:
27+
- name: 🛎️ Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
ref: ${{ github.event.pull_request.head.ref }}
31+
repository: ${{ github.event.pull_request.head.repo.full_name }}
32+
fetch-depth: 0
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Validate PR
36+
run: |
37+
# Check for any workflow changes
38+
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.event.pull_request.head.sha }}" | grep -q "^.github/workflows/"; then
39+
echo "⚠️ Workflow changes detected."
40+
41+
# Get the PR author
42+
AUTHOR="${{ github.event.pull_request.user.login }}"
43+
echo "PR Author: $AUTHOR"
44+
45+
# Allowlist check
46+
if [[ "$AUTHOR" == "misrasaurabh1" || "$AUTHOR" == "KRRT7" ]]; then
47+
echo "✅ Authorized user ($AUTHOR). Proceeding."
48+
elif [[ "${{ github.event.pull_request.state }}" == "open" ]]; then
49+
echo "✅ PR triggered by 'pull_request_target' and is open. Assuming protection rules are in place. Proceeding."
50+
else
51+
echo "⛔ Unauthorized user ($AUTHOR) attempting to modify workflows. Exiting."
52+
exit 1
53+
fi
54+
else
55+
echo "✅ No workflow file changes detected. Proceeding."
56+
fi
57+
58+
- name: Set up Python 3.11 for CLI
59+
uses: astral-sh/setup-uv@v5
60+
with:
61+
python-version: 3.11.6
62+
63+
- name: Install dependencies (CLI)
64+
run: |
65+
uv tool install poetry
66+
uv venv
67+
source .venv/bin/activate
68+
poetry install --with dev
69+
70+
- name: Run Codeflash to optimize code
71+
id: optimize_code_with_benchmarks
72+
run: |
73+
source .venv/bin/activate
74+
poetry run python tests/scripts/end_to_end_test_benchmark_sort.py

.github/workflows/end-to-end-test-bubblesort-pytest-no-git.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
EXPECTED_IMPROVEMENT_PCT: 300
2525
CODEFLASH_END_TO_END: 1
2626
steps:
27-
- uses: actions/checkout@v4
27+
- name: 🛎️ Checkout
28+
uses: actions/checkout@v4
2829
with:
30+
ref: ${{ github.event.pull_request.head.ref }}
31+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2932
fetch-depth: 0
3033
token: ${{ secrets.GITHUB_TOKEN }}
3134
- name: Validate PR

.github/workflows/end-to-end-test-bubblesort-unittest.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
EXPECTED_IMPROVEMENT_PCT: 300
2525
CODEFLASH_END_TO_END: 1
2626
steps:
27-
- uses: actions/checkout@v4
27+
- name: 🛎️ Checkout
28+
uses: actions/checkout@v4
2829
with:
30+
ref: ${{ github.event.pull_request.head.ref }}
31+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2932
fetch-depth: 0
3033
token: ${{ secrets.GITHUB_TOKEN }}
3134
- name: Validate PR

.github/workflows/end-to-end-test-coverage.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ jobs:
2222
RETRY_DELAY: 5
2323
CODEFLASH_END_TO_END: 1
2424
steps:
25-
- uses: actions/checkout@v4
25+
- name: 🛎️ Checkout
26+
uses: actions/checkout@v4
2627
with:
28+
ref: ${{ github.event.pull_request.head.ref }}
29+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2730
fetch-depth: 0
2831
token: ${{ secrets.GITHUB_TOKEN }}
2932
- name: Validate PR

.github/workflows/end-to-end-test-futurehouse.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ jobs:
2424
EXPECTED_IMPROVEMENT_PCT: 10
2525
CODEFLASH_END_TO_END: 1
2626
steps:
27-
- uses: actions/checkout@v4
27+
- name: 🛎️ Checkout
28+
uses: actions/checkout@v4
2829
with:
30+
ref: ${{ github.event.pull_request.head.ref }}
31+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2932
fetch-depth: 0
3033
token: ${{ secrets.GITHUB_TOKEN }}
3134
- name: Validate PR

.github/workflows/end-to-end-test-init-optim.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
EXPECTED_IMPROVEMENT_PCT: 300
2424
CODEFLASH_END_TO_END: 1
2525
steps:
26-
- uses: actions/checkout@v4
26+
- name: 🛎️ Checkout
27+
uses: actions/checkout@v4
2728
with:
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2831
fetch-depth: 0
2932
token: ${{ secrets.GITHUB_TOKEN }}
3033
- name: Validate PR

.github/workflows/end-to-end-test-tracer-replay.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
EXPECTED_IMPROVEMENT_PCT: 10
2424
CODEFLASH_END_TO_END: 1
2525
steps:
26-
- uses: actions/checkout@v4
26+
- name: 🛎️ Checkout
27+
uses: actions/checkout@v4
2728
with:
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2831
fetch-depth: 0
2932
token: ${{ secrets.GITHUB_TOKEN }}
3033
- name: Validate PR

.github/workflows/end-to-end-topological-sort-test.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ jobs:
2323
EXPECTED_IMPROVEMENT_PCT: 5
2424
CODEFLASH_END_TO_END: 1
2525
steps:
26-
- uses: actions/checkout@v4
26+
- name: 🛎️ Checkout
27+
uses: actions/checkout@v4
2728
with:
29+
ref: ${{ github.event.pull_request.head.ref }}
30+
repository: ${{ github.event.pull_request.head.repo.full_name }}
2831
fetch-depth: 0
2932
token: ${{ secrets.GITHUB_TOKEN }}
3033
- name: Debug Environment Decision

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: uvx poetry install --with dev
3333

3434
- name: Unit tests
35-
run: uvx poetry run pytest tests/ --cov --cov-report=xml
35+
run: uvx poetry run pytest tests/ --cov --cov-report=xml --benchmark-skip -m "not ci_skip"
3636

3737
- name: Upload coverage reports to Codecov
3838
uses: codecov/codecov-action@v5

0 commit comments

Comments
 (0)