Skip to content

Commit caedee1

Browse files
authored
Merge pull request #244 from cloudflare/nightly
Release: Nightly -> Main
2 parents f7cc7ea + 0ad9a42 commit caedee1

Some content is hidden

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

62 files changed

+5581
-1261
lines changed

.github/workflows/claude-issue-triage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
166166
### STAGE 3: Solution Proposal (CONDITIONAL)${{ steps.analyze.outputs.severity == 'high' && '\n\n**⚠️ REQUIRED** - Critical issue, must propose fix' || '\n\n**OPTIONAL** - Propose fix if solution is clear and straightforward' }}
167167
168-
${{ steps.analyze.outputs.severity == 'high' && '**You MUST propose a fix for this critical issue:**' || '**Propose a fix only if:**\n- Root cause is clear\n- Fix is straightforward (< 50 lines changed)\n- You\'re confident it won\'t introduce regressions' }}
168+
${{ steps.analyze.outputs.severity == 'high' && '**You MUST propose a fix for this critical issue:**' || '**Propose a fix only if:**\n- Root cause is clear\n- Fix is straightforward (< 50 lines changed)\n- You''re confident it won''t introduce regressions' }}
169169
170170
#### 3.1 Design the Fix
171171
@@ -249,7 +249,7 @@ jobs:
249249
250250
**Comment Structure** (adapt based on investigation depth):
251251
252-
${{ steps.analyze.outputs.should_investigate == 'true' && '**For investigated issues:**\n\n```markdown\n## Investigation Results\n\nThanks for reporting this, @${{ github.event.issue.user.login }}! I\'ve performed a thorough analysis.\n\n### Classification\n- **Type:** [bug/feature/etc]\n- **Severity:** [P0-critical/P1-high/etc]\n- **Component:** [worker/ui/etc]\n\n### Root Cause Analysis\n[Detailed explanation of what\'s causing the issue]\n\n**Location:** `path/to/file.ts:123`\n\n**Introduced in:** PR #XXX (if found) or Commit ABC123\n\n### Proposed Solution\n[Explain the fix approach]\n\n### Status\n- ✅ PR #XXX created with proposed fix (if applicable)\n- ⏳ Requires manual review and testing\n- 📋 Added to backlog for team review (if no PR)\n\n### Next Steps\n[What happens next - PR review, team discussion, etc.]\n```' || '**For standard triage:**\n\n```markdown\nThanks for reporting this, @${{ github.event.issue.user.login }}!\n\n### Classification\n- **Labels:** [list applied labels]\n- **Priority:** [explanation of priority]\n\n[Context-specific response based on issue type]\n\n### Next Steps\nThe team will review this and provide updates.\n```' }}
252+
${{ steps.analyze.outputs.should_investigate == 'true' && '**For investigated issues:**\n\n```markdown\n## Investigation Results\n\nThanks for reporting this, @${{ github.event.issue.user.login }}! I''ve performed a thorough analysis.\n\n### Classification\n- **Type:** [bug/feature/etc]\n- **Severity:** [P0-critical/P1-high/etc]\n- **Component:** [worker/ui/etc]\n\n### Root Cause Analysis\n[Detailed explanation of what''s causing the issue]\n\n**Location:** `path/to/file.ts:123`\n\n**Introduced in:** PR #XXX (if found) or Commit ABC123\n\n### Proposed Solution\n[Explain the fix approach]\n\n### Status\n- ✅ PR #XXX created with proposed fix (if applicable)\n- ⏳ Requires manual review and testing\n- 📋 Added to backlog for team review (if no PR)\n\n### Next Steps\n[What happens next - PR review, team discussion, etc.]\n```' || '**For standard triage:**\n\n```markdown\nThanks for reporting this, @${{ github.event.issue.user.login }}!\n\n### Classification\n- **Labels:** [list applied labels]\n- **Priority:** [explanation of priority]\n\n[Context-specific response based on issue type]\n\n### Next Steps\nThe team will review this and provide updates.\n```' }}
253253
254254
---
255255

.github/workflows/claude-reviews.yml

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,6 @@ jobs:
4545
env:
4646
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4747

48-
- name: Minimize Old Review Comments
49-
run: |
50-
echo "Collapsing previous review comments from github-actions[bot]..."
51-
52-
# Get all comments from github-actions[bot] on this PR
53-
OLD_REVIEWS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
54-
--jq '[.[] | select(.user.login == "github-actions[bot]") | select(.body | contains("## Code Review") or contains("🔒 **CRITICAL PATH SECURITY REVIEW**") or contains("## 🔍 Code Quality & Security Review")) | .id]')
55-
56-
if [ -n "$OLD_REVIEWS" ] && [ "$OLD_REVIEWS" != "[]" ]; then
57-
echo "Found old review comments to collapse"
58-
echo "$OLD_REVIEWS" | jq -r '.[]' | while read comment_id; do
59-
echo "Collapsing comment $comment_id"
60-
gh api repos/${{ github.repository }}/issues/comments/$comment_id -X PATCH \
61-
-f body="<details><summary>🔒 Previous review (outdated)</summary>
62-
63-
This review has been superseded by a newer review.
64-
</details>" || echo "Failed to collapse comment $comment_id"
65-
done
66-
echo "✓ Old comments collapsed"
67-
else
68-
echo "No old review comments found"
69-
fi
70-
env:
71-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72-
continue-on-error: true
73-
7448
- name: Run Comprehensive Review
7549
uses: anthropics/claude-code-action@v1
7650
with:
@@ -137,16 +111,8 @@ jobs:
137111
[Overall assessment with approval/disapproval reasoning]
138112
```
139113
140-
5. Post review (MANDATORY FINAL STEP - use single efficient command)
114+
5. Post review (MANDATORY FINAL STEP)
141115
```bash
142-
# Post new review (collapse old ones first if any exist)
143-
OLD_IDS=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '[.[] | select(.user.login == "github-actions[bot]") | select(.body | startswith("## Code & Security Review")) | .id] | @csv' | tr -d '"')
144-
if [ -n "$OLD_IDS" ]; then
145-
for id in ${OLD_IDS//,/ }; do
146-
gh api -X PATCH repos/${{ github.repository }}/issues/comments/$id -f body="<details><summary>Outdated</summary></details>" &
147-
done
148-
wait
149-
fi
150116
gh pr comment ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --body "YOUR_REVIEW_HERE"
151117
```
152118
@@ -180,3 +146,42 @@ jobs:
180146
--allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh search:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr edit:*),Bash(gh api:*)"
181147
--max-turns ${{ steps.critical_paths.outputs.is_critical == 'true' && '90' || '65' }}
182148
--model claude-sonnet-4-5-20250929
149+
150+
- name: Intelligent Comment Cleanup
151+
uses: anthropics/claude-code-action@v1
152+
if: always()
153+
with:
154+
github_token: ${{ secrets.GITHUB_TOKEN }}
155+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
156+
prompt: |
157+
Clean up stale bot comments on PR #${{ github.event.pull_request.number }}.
158+
159+
**Task:**
160+
1. Fetch all comments on this PR
161+
2. Identify bot comments (users ending in [bot]) that are stale/outdated:
162+
- Old reviews superseded by newer ones
163+
- Old PR description suggestions
164+
- Previously collapsed/outdated markers
165+
- Progress/status comments from previous workflow runs
166+
3. Keep only the most recent comment per category per bot
167+
4. DELETE all stale comments (do not collapse)
168+
169+
**Get all comments:**
170+
```bash
171+
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments --jq '.[] | {id, user: .user.login, body, created_at}'
172+
```
173+
174+
**Delete a comment:**
175+
```bash
176+
gh api repos/${{ github.repository }}/issues/comments/COMMENT_ID -X DELETE
177+
```
178+
179+
Be intelligent:
180+
- Preserve the newest useful comment in each category
181+
- Delete everything else that's redundant or stale
182+
- If unsure, keep the comment (conservative approach)
183+
184+
claude_args: |
185+
--allowed-tools "Bash(gh api repos/*/issues/*/comments:*),Bash(gh api repos/*/issues/comments/*:*)"
186+
--max-turns 8
187+
--model claude-haiku-4-5-20251001

.husky/commit-msg

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
bunx commitlint --edit $1
1+
# Add common bun installation paths to PATH
2+
export PATH="/opt/homebrew/bin:$HOME/.bun/bin:$PATH"
3+
4+
# Run commitlint if bunx is available
5+
if command -v bunx >/dev/null 2>&1; then
6+
bunx commitlint --edit $1
7+
else
8+
echo "⚠️ bunx not found in PATH, skipping commitlint"
9+
exit 0
10+
fi

.husky/pre-commit

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
bun test
1+
# Add common bun installation paths to PATH
2+
export PATH="/opt/homebrew/bin:$HOME/.bun/bin:$PATH"
3+
4+
# Run tests with bun
5+
if command -v bun >/dev/null 2>&1; then
6+
bun test
7+
else
8+
echo "⚠️ bun not found in PATH, skipping tests"
9+
exit 0
10+
fi

SandboxDockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# FROM docker.io/cloudflare/sandbox:0.1.3
2-
FROM docker.io/cloudflare/sandbox:0.4.14
2+
FROM docker.io/cloudflare/sandbox:0.5.6
33

44
ARG TARGETARCH
55
RUN apt-get update && \
@@ -52,7 +52,6 @@ RUN chmod 755 /workspace/data
5252
# Set environment variable to indicate Docker container environment
5353
ENV CONTAINER_ENV=docker
5454
ENV VITE_LOGGER_TYPE=json
55-
5655
# # Set environment variable to indicate Docker container environment
5756
# ENV CONTAINER_ENV=docker
5857

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"@ashishkumar472/cf-git": "1.0.5",
88
"@cloudflare/containers": "^0.0.28",
9-
"@cloudflare/sandbox": "0.4.14",
9+
"@cloudflare/sandbox": "^0.5.6",
1010
"@noble/ciphers": "^1.3.0",
1111
"@octokit/rest": "^22.0.1",
1212
"@radix-ui/react-accordion": "^1.2.12",
@@ -230,7 +230,7 @@
230230

231231
"@cloudflare/kv-asset-handler": ["@cloudflare/kv-asset-handler@0.4.0", "", { "dependencies": { "mime": "^3.0.0" } }, "sha512-+tv3z+SPp+gqTIcImN9o0hqE9xyfQjI1XD9pL6NuKjua9B1y7mNYv0S9cP+QEbA4ppVgGZEmKOvHX5G5Ei1CVA=="],
232232

233-
"@cloudflare/sandbox": ["@cloudflare/sandbox@0.4.14", "", { "dependencies": { "@cloudflare/containers": "^0.0.30" } }, "sha512-sI8yEqUd/vukhwSHGi93xau7xEtbP+OD/8xnjGbXr2iIGnAV+05VhLVIfJmwuU3VE8R96dnBJtEucEE5ZtXhcQ=="],
233+
"@cloudflare/sandbox": ["@cloudflare/sandbox@0.5.6", "", { "dependencies": { "@cloudflare/containers": "^0.0.30" }, "peerDependencies": { "@openai/agents": "^0.3.3" }, "optionalPeers": ["@openai/agents"] }, "sha512-N4mdUY5lVWQHQcAZnTecJne95uSyf7KVPbJGMr3G6jS7oyphriw6Hxa5I/HlDUdMWjaTBgeOuDEb4m3wo2IyOg=="],
234234

235235
"@cloudflare/unenv-preset": ["@cloudflare/unenv-preset@2.7.8", "", { "peerDependencies": { "unenv": "2.0.0-rc.21", "workerd": "^1.20250927.0" }, "optionalPeers": ["workerd"] }, "sha512-Ky929MfHh+qPhwCapYrRPwPVHtA2Ioex/DbGZyskGyNRDe9Ru3WThYZivyNVaPy5ergQSgMs9OKrM9Ajtz9F6w=="],
236236

0 commit comments

Comments
 (0)