mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
Merge branch 'main' into dependabot/npm_and_yarn/packages/codeflash/better-sqlite3-12.9.0
This commit is contained in:
commit
e78c92b70c
10 changed files with 42 additions and 34 deletions
|
|
@ -24,6 +24,10 @@ case "$FIRST_CMD" in
|
||||||
echo "BLOCKED: Use the Read tool instead of \`$FIRST_CMD\`. Read provides line numbers and supports images/PDFs." >&2
|
echo "BLOCKED: Use the Read tool instead of \`$FIRST_CMD\`. Read provides line numbers and supports images/PDFs." >&2
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
;;
|
||||||
|
awk)
|
||||||
|
echo "BLOCKED: Use the Grep tool or Read tool instead of \`awk\`." >&2
|
||||||
|
exit 2
|
||||||
|
;;
|
||||||
sed)
|
sed)
|
||||||
if echo "$COMMAND" | grep -qE '(^|[[:space:]])sed[[:space:]]+-i'; then
|
if echo "$COMMAND" | grep -qE '(^|[[:space:]])sed[[:space:]]+-i'; then
|
||||||
echo "BLOCKED: Use the Edit tool instead of \`sed -i\`. Edit tracks changes properly." >&2
|
echo "BLOCKED: Use the Edit tool instead of \`sed -i\`. Edit tracks changes properly." >&2
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,8 @@ STATE="${STATE}- libcst for code transforms, ast for read-only analysis\n"
|
||||||
|
|
||||||
[ -z "$STATE" ] && exit 0
|
[ -z "$STATE" ] && exit 0
|
||||||
|
|
||||||
cat <<EOF
|
EXPANDED=$(printf '%b' "$STATE")
|
||||||
{
|
jq -n --arg msg "PRESERVE the following session state through compaction:
|
||||||
"systemMessage": "PRESERVE the following session state through compaction:\n$(echo -e "$STATE" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')"
|
$EXPANDED" '{"systemMessage": $msg}'
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null |
|
||||||
|
|
||||||
[ -z "$FILE_PATH" ] && exit 0
|
[ -z "$FILE_PATH" ] && exit 0
|
||||||
|
|
||||||
echo "$FILE_PATH" >> "$CLAUDE_PROJECT_DIR/.claude/.read-tracker"
|
TRACKER="$CLAUDE_PROJECT_DIR/.claude/.read-tracker"
|
||||||
|
grep -qxF "$FILE_PATH" "$TRACKER" 2>/dev/null || echo "$FILE_PATH" >> "$TRACKER"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,6 @@
|
||||||
"timeout": 5
|
"timeout": 5
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
"matcher": "Edit",
|
|
||||||
"hooks": [
|
|
||||||
{
|
|
||||||
"type": "command",
|
|
||||||
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/require-read.sh",
|
|
||||||
"timeout": 5
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"PostToolUse": [
|
"PostToolUse": [
|
||||||
|
|
@ -92,5 +82,8 @@
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/status-line.sh"
|
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/status-line.sh"
|
||||||
},
|
},
|
||||||
"enableAllProjectMcpServers": true
|
"enableAllProjectMcpServers": true,
|
||||||
|
"env": {
|
||||||
|
"ENABLE_LSP_TOOL": "1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
30
.github/workflows/ci.yaml
vendored
30
.github/workflows/ci.yaml
vendored
|
|
@ -36,6 +36,7 @@ jobs:
|
||||||
env:
|
env:
|
||||||
PR_BODY: ${{ github.event.pull_request.body }}
|
PR_BODY: ${{ github.event.pull_request.body }}
|
||||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||||
|
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
|
||||||
run: |
|
run: |
|
||||||
# Skip for bots (dependabot, renovate, github-actions)
|
# Skip for bots (dependabot, renovate, github-actions)
|
||||||
if [[ "$PR_AUTHOR" == *"[bot]"* || "$PR_AUTHOR" == "dependabot" ]]; then
|
if [[ "$PR_AUTHOR" == *"[bot]"* || "$PR_AUTHOR" == "dependabot" ]]; then
|
||||||
|
|
@ -43,6 +44,12 @@ jobs:
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Skip for org members
|
||||||
|
if [[ "$AUTHOR_ASSOCIATION" == "MEMBER" ]]; then
|
||||||
|
echo "Org member ($PR_AUTHOR) — skipping linked issue check."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$PR_BODY" ]; then
|
if [ -z "$PR_BODY" ]; then
|
||||||
echo "::error::PR body is empty. Every PR must link an issue or discussion."
|
echo "::error::PR body is empty. Every PR must link an issue or discussion."
|
||||||
echo "Use 'Closes #<number>', 'Fixes #<number>', 'Relates to #<number>', or include a discussion URL."
|
echo "Use 'Closes #<number>', 'Fixes #<number>', 'Relates to #<number>', or include a discussion URL."
|
||||||
|
|
@ -185,7 +192,7 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -218,7 +225,7 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.13"
|
python-version: "3.13"
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -234,7 +241,7 @@ jobs:
|
||||||
|
|
||||||
- name: Upload coverage report
|
- name: Upload coverage report
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: coverage-report
|
name: coverage-report
|
||||||
path: coverage.xml
|
path: coverage.xml
|
||||||
|
|
@ -254,7 +261,7 @@ jobs:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
@ -281,7 +288,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: astral-sh/setup-uv@v8.0.0
|
- uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
@ -315,6 +322,7 @@ jobs:
|
||||||
if: >-
|
if: >-
|
||||||
needs.determine-changes.outputs.e2e == 'true'
|
needs.determine-changes.outputs.e2e == 'true'
|
||||||
&& github.event_name != 'push'
|
&& github.event_name != 'push'
|
||||||
|
&& github.actor != 'dependabot[bot]'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -374,7 +382,7 @@ jobs:
|
||||||
pr_state: ${{ github.event.pull_request.state }}
|
pr_state: ${{ github.event.pull_request.state }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.6
|
python-version: 3.11.6
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -418,6 +426,7 @@ jobs:
|
||||||
if: >-
|
if: >-
|
||||||
needs.determine-changes.outputs.e2e_js == 'true'
|
needs.determine-changes.outputs.e2e_js == 'true'
|
||||||
&& github.event_name != 'push'
|
&& github.event_name != 'push'
|
||||||
|
&& github.actor != 'dependabot[bot]'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -430,10 +439,12 @@ jobs:
|
||||||
script: end_to_end_test_js_esm_async.py
|
script: end_to_end_test_js_esm_async.py
|
||||||
js_project_dir: code_to_optimize/js/code_to_optimize_js_esm
|
js_project_dir: code_to_optimize/js/code_to_optimize_js_esm
|
||||||
expected_improvement: 10
|
expected_improvement: 10
|
||||||
|
allow_failure: true
|
||||||
- name: js-ts-class
|
- name: js-ts-class
|
||||||
script: end_to_end_test_js_ts_class.py
|
script: end_to_end_test_js_ts_class.py
|
||||||
js_project_dir: code_to_optimize/js/code_to_optimize_ts
|
js_project_dir: code_to_optimize/js/code_to_optimize_ts
|
||||||
expected_improvement: 30
|
expected_improvement: 30
|
||||||
|
continue-on-error: ${{ matrix.allow_failure || false }}
|
||||||
environment: ${{ ((github.event_name == 'workflow_dispatch' && github.actor != 'misrasaurabh1' && github.actor != 'KRRT7') || (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' || '' }}
|
environment: ${{ ((github.event_name == 'workflow_dispatch' && github.actor != 'misrasaurabh1' && github.actor != 'KRRT7') || (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' || '' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
|
|
@ -482,7 +493,7 @@ jobs:
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.6
|
python-version: 3.11.6
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -499,6 +510,7 @@ jobs:
|
||||||
if: >-
|
if: >-
|
||||||
needs.determine-changes.outputs.e2e_java == 'true'
|
needs.determine-changes.outputs.e2e_java == 'true'
|
||||||
&& github.event_name != 'push'
|
&& github.event_name != 'push'
|
||||||
|
&& github.actor != 'dependabot[bot]'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
@ -551,7 +563,7 @@ jobs:
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.6
|
python-version: 3.11.6
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -561,7 +573,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache codeflash-runtime JAR
|
- name: Cache codeflash-runtime JAR
|
||||||
id: runtime-jar-cache
|
id: runtime-jar-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository/io/codeflash
|
path: ~/.m2/repository/io/codeflash
|
||||||
key: codeflash-runtime-${{ hashFiles('codeflash-java-runtime/pom.xml', 'codeflash-java-runtime/src/**') }}
|
key: codeflash-runtime-${{ hashFiles('codeflash-java-runtime/pom.xml', 'codeflash-java-runtime/src/**') }}
|
||||||
|
|
|
||||||
4
.github/workflows/claude.yml
vendored
4
.github/workflows/claude.yml
vendored
|
|
@ -57,7 +57,7 @@ jobs:
|
||||||
ref: ${{ github.event.pull_request.head.ref || github.ref }}
|
ref: ${{ github.event.pull_request.head.ref || github.ref }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
@ -319,7 +319,7 @@ jobs:
|
||||||
ref: ${{ steps.pr-ref.outputs.ref }}
|
ref: ${{ steps.pr-ref.outputs.ref }}
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/codeflash-optimize.yaml
vendored
2
.github/workflows/codeflash-optimize.yaml
vendored
|
|
@ -31,7 +31,7 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: 🐍 Set up Python 3.11 for CLI
|
- name: 🐍 Set up Python 3.11 for CLI
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.6
|
python-version: 3.11.6
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
|
||||||
4
.github/workflows/java-e2e.yaml
vendored
4
.github/workflows/java-e2e.yaml
vendored
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
cache: maven
|
cache: maven
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.11.6
|
python-version: 3.11.6
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
@ -51,7 +51,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache codeflash-runtime JAR
|
- name: Cache codeflash-runtime JAR
|
||||||
id: runtime-jar-cache
|
id: runtime-jar-cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository/io/codeflash
|
path: ~/.m2/repository/io/codeflash
|
||||||
key: codeflash-runtime-${{ hashFiles('codeflash-java-runtime/pom.xml', 'codeflash-java-runtime/src/**') }}
|
key: codeflash-runtime-${{ hashFiles('codeflash-java-runtime/pom.xml', 'codeflash-java-runtime/src/**') }}
|
||||||
|
|
|
||||||
2
.github/workflows/label-workflow-changes.yml
vendored
2
.github/workflows/label-workflow-changes.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- name: Label PR with workflow changes
|
- name: Label PR with workflow changes
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v9
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const labelName = 'workflow-modified';
|
const labelName = 'workflow-modified';
|
||||||
|
|
|
||||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
|
@ -110,7 +110,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
if: steps.should_run.outputs.run == 'true' && steps.check_tag.outputs.exists == 'false'
|
if: steps.should_run.outputs.run == 'true' && steps.check_tag.outputs.exists == 'false'
|
||||||
uses: astral-sh/setup-uv@v8.0.0
|
uses: astral-sh/setup-uv@v8.1.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ jobs:
|
||||||
|
|
||||||
- name: Create GitHub Release
|
- name: Create GitHub Release
|
||||||
if: steps.should_run.outputs.run == 'true' && steps.check_tag.outputs.exists == 'false'
|
if: steps.should_run.outputs.run == 'true' && steps.check_tag.outputs.exists == 'false'
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.extract_version.outputs.tag }}
|
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||||
name: ${{ matrix.release_name_prefix }} ${{ steps.extract_version.outputs.tag }}
|
name: ${{ matrix.release_name_prefix }} ${{ steps.extract_version.outputs.tag }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue