Skip to content

Commit ba795ca

Browse files
jeremyederclaude
andauthored
chore: improve lychee link checker retry handling (#216)
* chore: improve lychee link checker retry handling - Increase max_retries from 3 to 5 for better transient error handling - Reduce retry_wait_time from 30s to 2s for faster retries - Remove implementation-status exclusions (file was removed) - Total retry time: 10s (5 × 2s) vs previous 90s (3 × 30s) More attempts, faster response, better handling of transient failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]> * fix: simplify PR review workflow and remove duplicate trigger - Remove pull_request trigger (doesn't have secret access) - Keep only pull_request_target (has secret access) - Remove broken output parsing (claude-code-action doesn't support custom outputs) - Simplify to just run /review-agentready command - Fixes duplicate workflow runs and ANTHROPIC_API_KEY missing errors The workflow was running twice - once without secrets (failing) and once with secrets (succeeding). Now runs once with secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.5 <[email protected]>
1 parent f3b56c1 commit ba795ca

File tree

2 files changed

+8
-118
lines changed

2 files changed

+8
-118
lines changed
Lines changed: 6 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: PR Review + Auto-Fix Criticals
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
64
pull_request_target:
75
types: [opened, synchronize, reopened]
86

@@ -15,9 +13,6 @@ jobs:
1513
review:
1614
name: Code Review
1715
runs-on: ubuntu-latest
18-
outputs:
19-
has_criticals: ${{ steps.review.outputs.has_criticals }}
20-
review_id: ${{ steps.review.outputs.review_id }}
2116
steps:
2217
- name: Minimize old Claude review comments
2318
uses: actions/github-script@v8
@@ -42,7 +37,6 @@ jobs:
4237
}
4338
4439
- name: Run AgentReady Code Review
45-
id: review
4640
uses: anthropics/claude-code-action@v1
4741
with:
4842
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
@@ -51,112 +45,10 @@ jobs:
5145
prompt: |
5246
Run the /review-agentready command on this pull request.
5347
54-
After the review completes, create a JSON output file at `.review-results.json` with this structure:
55-
```json
56-
{
57-
"has_criticals": true/false,
58-
"critical_count": N,
59-
"findings": [
60-
{
61-
"description": "...",
62-
"confidence": 90-100,
63-
"file_path": "...",
64-
"line_start": N,
65-
"line_end": M,
66-
"remediation_command": "..."
67-
}
68-
]
69-
}
70-
```
71-
72-
Then set outputs:
73-
- has_criticals: "true" if any findings have confidence ≥90
74-
- review_id: unique identifier for this review (timestamp)
75-
76-
- name: Upload review results
77-
uses: actions/upload-artifact@v5
78-
with:
79-
name: review-results
80-
path: .review-results.json
81-
retention-days: 1
82-
83-
auto-fix-criticals:
84-
name: Auto-Fix Critical Issues
85-
runs-on: ubuntu-latest
86-
needs: review
87-
if: needs.review.outputs.has_criticals == 'true'
88-
steps:
89-
- name: Download review results
90-
uses: actions/download-artifact@v6
91-
with:
92-
name: review-results
93-
94-
- name: Auto-fix critical issues
95-
uses: anthropics/claude-code-action@v1
96-
with:
97-
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
98-
github_token: ${{ secrets.GITHUB_TOKEN }}
99-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
100-
prompt: |
101-
Read the review results from `.review-results.json`.
102-
103-
For each finding with confidence ≥90 (critical/blocker):
104-
105-
1. **Analyze the issue** - Read the file and understand the problem
106-
2. **Apply the fix** - Make the minimal change to resolve the issue
107-
3. **Run tests** - Verify the fix doesn't break anything
108-
4. **Commit** - Use conventional commits format:
109-
```
110-
fix(assessors): resolve TOCTOU in file scanner
111-
112-
- Added proper file locking before read operations
113-
- Prevents race condition in concurrent assessments
48+
Provide a comprehensive code review focusing on:
49+
- AgentReady attribute compliance
50+
- Security issues
51+
- Code quality
52+
- Best practices
11453
115-
Resolves critical issue #1 from code review
116-
117-
🤖 Generated with [Claude Code](https://claude.com/claude-code)
118-
119-
Co-Authored-By: Claude <[email protected]>
120-
```
121-
122-
5. **Update review comment** - Add "✅ Fixed in [commit sha]" to the original review
123-
124-
IMPORTANT:
125-
- Fix issues one at a time, commit after each
126-
- Run linters after each fix: black, isort, ruff
127-
- Run tests after each fix: pytest
128-
- If a fix causes test failures, revert and skip to next issue
129-
- Push all commits to the PR branch when done
130-
- Do NOT push to main branch directly
131-
132-
After all fixes:
133-
- Update the original review comment with fix status
134-
- Add a summary comment listing all fixes applied
135-
- Push the changes to the PR branch
136-
137-
- name: Update PR with fix summary
138-
uses: actions/github-script@v8
139-
with:
140-
script: |
141-
const fs = require('fs');
142-
const results = JSON.parse(fs.readFileSync('.review-results.json', 'utf8'));
143-
144-
const fixedCount = results.findings.filter(f => f.confidence >= 90).length;
145-
146-
const body = `### ✅ Auto-Fix Complete
147-
148-
Applied fixes for ${fixedCount} critical issues.
149-
150-
**Next Steps**:
151-
1. Review the automated fixes in the commit history
152-
2. Run \`agentready assess .\` locally to verify score improvement
153-
3. Continue your work on a clean PR
154-
155-
🤖 Automated by Claude Code`;
156-
157-
await github.rest.issues.createComment({
158-
owner: context.repo.owner,
159-
repo: context.repo.repo,
160-
issue_number: context.issue.number,
161-
body: body
162-
});
54+
Post the review as a comment on this PR.

lychee.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ accept = [200, 206, 301, 302, 308, 429]
1515
timeout = 20
1616

1717
# Number of retries for failed requests
18-
max_retries = 3
18+
max_retries = 5
1919

2020
# Retry wait time (in seconds)
21-
retry_wait_time = 30
21+
retry_wait_time = 2
2222

2323
# Exclude patterns (regex)
2424
exclude = [
@@ -35,10 +35,8 @@ exclude = [
3535
# Relative URLs for Jekyll site (will be checked once deployed)
3636
".*/agentready/demos/.*",
3737
".*/agentready/tbench.*",
38-
".*/agentready/implementation-status.*",
3938
".*/demos/.*",
4039
".*/tbench.*",
41-
".*/implementation-status.*",
4240

4341
# Jinja2/Liquid template variables
4442
"\\{\\{.*\\}\\}",

0 commit comments

Comments
 (0)