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
Removed test-oncall-analysis.yml and made analyze-and-notify.yml
dual-purpose:
1. Called by integration-tests.yml when tests actually fail
2. Triggered by PR label 'test-oncall-workflow' for testing
Changes:
- Added pull_request trigger with label filter
- Set workflow parameters based on trigger type
- workflow_call: uses inputs from caller
- pull_request: uses test values (no artifacts expected)
- Outputs parameters from analyze-failures for notify job
- Removed separate test workflow
- Updated TESTING_ONCALL.md documentation
Testing with label:
- No fake artifacts created
- Claude analyzes empty test-artifacts/ directory
- Generates appropriate report (likely "no failures found")
- Posts to Slack with [TEST] prefix
This simplifies the workflow structure while still allowing
easy testing via PR labels.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
✅ **Slack notification**: Webhook delivers message to correct channel
37
-
✅ **Report generation**: analysis-report.md is created and included in Slack
28
+
**If you test on a PR without test failures:**
29
+
30
+
Claude will analyze the empty `test-artifacts/` directory and should generate a report saying:
31
+
```markdown
32
+
**🤖 AI Analysis [TEST MODE]**
33
+
34
+
**Root Cause**: No test failures found in artifacts directory.
35
+
36
+
**Evidence**:
37
+
• test-artifacts/ directory is empty or contains no JUnit XML files
38
+
• No failed tests to analyze
38
39
39
-
⚠️ **What it doesn't validate**: The quality of Claude's analysis on real collector test failures (since it uses synthetic data)
40
+
**Recommendations**:
41
+
• This is a test run with no actual test failures
42
+
• The workflow is functioning correctly
43
+
```
40
44
41
-
## Expected Slack Message
45
+
**Slack message:**
46
+
```
47
+
[TEST] Integration Tests failed
42
48
43
-
You should receive a Slack message in #team-acs-collector-oncall with [TEST] prefix containing Claude's analysis of the synthetic test failures. The content will vary based on what Claude finds when analyzing the fake error messages.
49
+
**This is a test of the oncall analysis workflow - please ignore**
50
+
51
+
[Claude's report about no failures found]
52
+
```
53
+
54
+
## To Test with Real Failures
55
+
56
+
Trigger the workflow on an actual test failure:
57
+
1. Wait for integration tests to fail naturally, OR
58
+
2. Intentionally break a test and push to a branch
59
+
3. The workflow will run automatically with real artifacts
60
+
4. Check Slack for analysis with actual root cause
44
61
45
62
## Cleanup
46
63
47
-
After testing, you can:
64
+
After testing:
48
65
- Remove the `test-oncall-workflow` label from the PR
49
-
- Delete the test workflow run from Actions
50
-
- The Slack message will remain for reference
66
+
- The Slack [TEST] message will remain for reference
51
67
52
68
## Troubleshooting
53
69
54
-
If the test fails:
70
+
**No workflow run triggered:**
71
+
- Check that `.github/workflows/analyze-and-notify.yml` exists in the PR branch
72
+
- New workflows require merge to main before PR triggers work
73
+
74
+
**No Slack notification:**
75
+
- Check `SLACK_COLLECTOR_ONCALL_WEBHOOK` secret is set
76
+
- Verify webhook URL is valid
55
77
56
-
1.**No Slack message**: Check that `SLACK_COLLECTOR_ONCALL_WEBHOOK` secret is set
57
-
2.**No analysis report**: Check the "Analyze test failures with Claude" step logs
58
-
3.**Action not found**: Make sure this PR includes `.github/workflows/test-oncall-analysis.yml`
78
+
**Claude fails:**
79
+
- Check analyze-failures job logs for errors
80
+
- Verify `GCP_CLAUDE_SERVICE_ACCOUNT_KEY` and `GCP_CLAUDE_PROJECT_ID` secrets are set
81
+
- See "Troubleshooting" section in `.github/scripts/README.md`
${{ needs.analyze-failures.outputs.is_test == 'true' && '**This is a test of the oncall analysis workflow - please ignore**' || '@acs-collector-oncall' }}
0 commit comments