Skip to content

Commit 9868c38

Browse files
committed
debugging
1 parent 80b1057 commit 9868c38

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CodeFlash
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- '**' # Trigger for all paths
7+
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
optimize:
16+
name: Optimize new Python code
17+
# Dynamically determine if environment is needed only when workflow files change and contributor is external
18+
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' || '' }}
19+
if: ${{ github.actor != 'codeflash-ai[bot]' }}
20+
runs-on: ubuntu-latest
21+
env:
22+
CODEFLASH_AIS_SERVER: prod
23+
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
24+
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
25+
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
26+
COLUMNS: 110
27+
steps:
28+
- name: 🛎️ Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ github.event.pull_request.head.ref }}
32+
repository: ${{ github.event.pull_request.head.repo.full_name }}
33+
fetch-depth: 0
34+
35+
36+
- name: 🐍 Set up Python 3.11 for CLI
37+
uses: astral-sh/setup-uv@v5
38+
with:
39+
python-version: 3.11.6
40+
41+
- name: 📦 Install dependencies (CLI)
42+
run: |
43+
uv tool install poetry
44+
uv venv
45+
source .venv/bin/activate
46+
poetry install --with dev
47+
48+
- name: ⚡️Codeflash Optimization
49+
id: optimize_code
50+
run: |
51+
source .venv/bin/activate
52+
poetry run codeflash --benchmark

codeflash/discovery/functions_to_optimize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ def get_functions_to_optimize(
201201
functions, test_cfg.tests_root, ignore_paths, project_root, module_root
202202
)
203203
logger.info(f"Found {functions_count} function{'s' if functions_count > 1 else ''} to optimize")
204+
logger.info(f"{filtered_modified_functions}")
204205
return filtered_modified_functions, functions_count
205206

206207

0 commit comments

Comments
 (0)