You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
actions: read # Required for Claude to read CI results
24
+
steps:
25
+
- name: Checkout repository
26
+
uses: actions/checkout@v4
27
+
with:
28
+
fetch-depth: 1
29
+
30
+
- name: Set up Python 3.10
31
+
uses: actions/setup-python@v5
32
+
with:
33
+
python-version: '3.10'
34
+
35
+
# Install UV package manager
36
+
- name: Install UV
37
+
uses: astral-sh/setup-uv@v7
38
+
39
+
- name: Set analysis prompt
40
+
id: analysis-prompt
41
+
run: |
42
+
cat >> $GITHUB_OUTPUT << 'EOF'
43
+
PROMPT<<PROMPT_END
44
+
You're a test failure analysis assistant for Py-Key-Value, a Python framework for interacting with Key-Value stores.
45
+
46
+
# Your Task
47
+
A GitHub Actions workflow has failed. Your job is to:
48
+
1. Analyze the test failure(s) to understand what went wrong
49
+
2. Identify the root cause of the failure(s)
50
+
3. Suggest a clear, actionable solution to fix the failure(s)
51
+
52
+
# Getting Started
53
+
1. Call the generate_agents_md tool to get a high-level summary of the project
54
+
2. Get the pull request associated with this workflow run from the GitHub repository: ${{ github.repository }}
55
+
- The workflow run ID is: ${{ github.event.workflow_run.id }}
56
+
- The workflow run was triggered by: ${{ github.event.workflow_run.event }}
57
+
- Use GitHub MCP tools to get PR details and workflow run information
58
+
3. Use the GitHub MCP tools to fetch job logs and failure information:
59
+
- Use get_workflow_run to get details about the failed workflow
60
+
- Use list_workflow_jobs to see which jobs failed
61
+
- Use get_job_logs with failed_only=true to get logs for failed jobs
62
+
- Use summarize_run_log_failures to get an AI summary of what failed
63
+
4. Analyze the failures to understand the root cause
64
+
5. Search the codebase for relevant files, tests, and implementations
65
+
66
+
# Your Response
67
+
Post a comment on the pull request with your analysis. Your comment should include:
68
+
69
+
## Test Failure Analysis
70
+
71
+
**Summary**: A brief 1-2 sentence summary of what failed.
72
+
73
+
**Root Cause**: A clear explanation of why the tests failed, based on your analysis of the logs and code.
74
+
75
+
**Suggested Solution**: Specific, actionable steps to fix the failure(s). Include:
76
+
- Which files need to be modified
77
+
- What changes are needed
78
+
- Why these changes will fix the issue
79
+
80
+
<details>
81
+
<summary>Detailed Analysis</summary>
82
+
83
+
Include here:
84
+
- Relevant log excerpts showing the failure
85
+
- Code snippets that are causing the issue
86
+
- Any related issues or PRs that might be relevant
87
+
</details>
88
+
89
+
<details>
90
+
<summary>Related Files</summary>
91
+
92
+
List files that are relevant to the failure with brief explanations of their relevance.
93
+
</details>
94
+
95
+
# Important Guidelines
96
+
- Be concise and actionable - developers want to quickly understand and fix the issue
97
+
- Focus on facts from the logs and code, not speculation
98
+
- If you can't determine the root cause, say so clearly
99
+
- Provide specific file names, line numbers, and code references when possible
100
+
- You can run make commands (e.g., `make lint`, `make typecheck`, `make sync`) to build, test, or lint the code
101
+
- You can also run git commands (e.g., `git status`, `git log`, `git diff`) to inspect the repository
102
+
- You can use WebSearch and WebFetch to research errors, stack traces, or related issues
103
+
- For bash commands, you are limited to make and git commands only
104
+
105
+
# CRITICAL: Loop Detection
106
+
**IMPORTANT**: Before posting your analysis, check the PR comments to detect if there's a loop where:
107
+
- CodeRabbit or another bot triggered this workflow
108
+
- Your previous analysis triggered CodeRabbit or another bot
109
+
- This created a repeating cycle of bot comments
110
+
111
+
If you detect such a loop (e.g., you see multiple similar bot comments or your own previous analysis comments):
112
+
1. **DO NOT** post another analysis comment
113
+
2. Instead, post a brief comment stating: "Loop detected: Multiple automated analysis comments found. Stopping to prevent further automated comments. Please review the existing analysis comments."
114
+
3. Exit immediately without further action
115
+
116
+
# Problems Encountered
117
+
If you encounter any problems during your analysis (e.g., unable to fetch logs, tools not working), document them clearly so the team knows what limitations you faced.
0 commit comments