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
|
||||
exit 2
|
||||
;;
|
||||
awk)
|
||||
echo "BLOCKED: Use the Grep tool or Read tool instead of \`awk\`." >&2
|
||||
exit 2
|
||||
;;
|
||||
sed)
|
||||
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
|
||||
|
|
|
|||
|
|
@ -40,10 +40,8 @@ STATE="${STATE}- libcst for code transforms, ast for read-only analysis\n"
|
|||
|
||||
[ -z "$STATE" ] && exit 0
|
||||
|
||||
cat <<EOF
|
||||
{
|
||||
"systemMessage": "PRESERVE the following session state through compaction:\n$(echo -e "$STATE" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')"
|
||||
}
|
||||
EOF
|
||||
EXPANDED=$(printf '%b' "$STATE")
|
||||
jq -n --arg msg "PRESERVE the following session state through compaction:
|
||||
$EXPANDED" '{"systemMessage": $msg}'
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -42,16 +42,6 @@
|
|||
"timeout": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"matcher": "Edit",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/require-read.sh",
|
||||
"timeout": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PostToolUse": [
|
||||
|
|
@ -92,5 +82,8 @@
|
|||
"type": "command",
|
||||
"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:
|
||||
PR_BODY: ${{ github.event.pull_request.body }}
|
||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
|
||||
run: |
|
||||
# Skip for bots (dependabot, renovate, github-actions)
|
||||
if [[ "$PR_AUTHOR" == *"[bot]"* || "$PR_AUTHOR" == "dependabot" ]]; then
|
||||
|
|
@ -43,6 +44,12 @@ jobs:
|
|||
exit 0
|
||||
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
|
||||
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."
|
||||
|
|
@ -185,7 +192,7 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
enable-cache: true
|
||||
|
|
@ -218,7 +225,7 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: "3.13"
|
||||
enable-cache: true
|
||||
|
|
@ -234,7 +241,7 @@ jobs:
|
|||
|
||||
- name: Upload coverage report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: coverage-report
|
||||
path: coverage.xml
|
||||
|
|
@ -254,7 +261,7 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
|
|
@ -281,7 +288,7 @@ jobs:
|
|||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
fetch-depth: 0
|
||||
- uses: astral-sh/setup-uv@v8.0.0
|
||||
- uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
|
|
@ -315,6 +322,7 @@ jobs:
|
|||
if: >-
|
||||
needs.determine-changes.outputs.e2e == 'true'
|
||||
&& github.event_name != 'push'
|
||||
&& github.actor != 'dependabot[bot]'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -374,7 +382,7 @@ jobs:
|
|||
pr_state: ${{ github.event.pull_request.state }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: 3.11.6
|
||||
enable-cache: true
|
||||
|
|
@ -418,6 +426,7 @@ jobs:
|
|||
if: >-
|
||||
needs.determine-changes.outputs.e2e_js == 'true'
|
||||
&& github.event_name != 'push'
|
||||
&& github.actor != 'dependabot[bot]'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -430,10 +439,12 @@ jobs:
|
|||
script: end_to_end_test_js_esm_async.py
|
||||
js_project_dir: code_to_optimize/js/code_to_optimize_js_esm
|
||||
expected_improvement: 10
|
||||
allow_failure: true
|
||||
- name: js-ts-class
|
||||
script: end_to_end_test_js_ts_class.py
|
||||
js_project_dir: code_to_optimize/js/code_to_optimize_ts
|
||||
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' || '' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
|
|
@ -482,7 +493,7 @@ jobs:
|
|||
npm install
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: 3.11.6
|
||||
enable-cache: true
|
||||
|
|
@ -499,6 +510,7 @@ jobs:
|
|||
if: >-
|
||||
needs.determine-changes.outputs.e2e_java == 'true'
|
||||
&& github.event_name != 'push'
|
||||
&& github.actor != 'dependabot[bot]'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -551,7 +563,7 @@ jobs:
|
|||
cache: maven
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: 3.11.6
|
||||
enable-cache: true
|
||||
|
|
@ -561,7 +573,7 @@ jobs:
|
|||
|
||||
- name: Cache codeflash-runtime JAR
|
||||
id: runtime-jar-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.m2/repository/io/codeflash
|
||||
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 }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
|
|
@ -319,7 +319,7 @@ jobs:
|
|||
ref: ${{ steps.pr-ref.outputs.ref }}
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
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
|
||||
|
||||
- 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:
|
||||
python-version: 3.11.6
|
||||
enable-cache: true
|
||||
|
|
|
|||
4
.github/workflows/java-e2e.yaml
vendored
4
.github/workflows/java-e2e.yaml
vendored
|
|
@ -41,7 +41,7 @@ jobs:
|
|||
cache: maven
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.0.0
|
||||
uses: astral-sh/setup-uv@v8.1.0
|
||||
with:
|
||||
python-version: 3.11.6
|
||||
enable-cache: true
|
||||
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
|
||||
- name: Cache codeflash-runtime JAR
|
||||
id: runtime-jar-cache
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: ~/.m2/repository/io/codeflash
|
||||
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
|
||||
steps:
|
||||
- name: Label PR with workflow changes
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
const labelName = 'workflow-modified';
|
||||
|
|
|
|||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
|
|
@ -110,7 +110,7 @@ jobs:
|
|||
|
||||
- name: Install uv
|
||||
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:
|
||||
enable-cache: true
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ jobs:
|
|||
|
||||
- name: Create GitHub Release
|
||||
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:
|
||||
tag_name: ${{ steps.extract_version.outputs.tag }}
|
||||
name: ${{ matrix.release_name_prefix }} ${{ steps.extract_version.outputs.tag }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue