Skip to content

Commit 0a67de3

Browse files
Copiloteleanorjboyd
andcommitted
Monitor setup job and add example issue documentation
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
1 parent 5c0e2fe commit 0a67de3

File tree

2 files changed

+112
-2
lines changed

2 files changed

+112
-2
lines changed

.github/workflows/EXAMPLE_ISSUE.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Example: Auto-Generated CI Failure Issue
2+
3+
This document shows what an automatically generated issue will look like when CI fails on the main branch.
4+
5+
## Example Issue 1: Single Job Failure
6+
7+
**Title:** `CI Failure on main: lint`
8+
9+
**Labels:** `ci-failure`, `bug`, `needs-triage`
10+
11+
**Body:**
12+
```markdown
13+
## CI Failure Report
14+
15+
The following jobs failed on the main branch:
16+
- **lint**
17+
18+
**Workflow Run:** https://github.com/microsoft/vscode-python/actions/runs/7234567890
19+
**Commit:** abc123def4567890abcdef1234567890abcdef12
20+
**Commit Message:** Add new feature for environment detection
21+
**Author:** @contributor
22+
23+
Please investigate and fix the failure.
24+
25+
---
26+
*This issue was automatically created by the CI system.*
27+
```
28+
29+
---
30+
31+
## Example Issue 2: Multiple Job Failures
32+
33+
**Title:** `CI Failure on main: lint, tests, smoke-tests`
34+
35+
**Labels:** `ci-failure`, `bug`, `needs-triage`
36+
37+
**Body:**
38+
```markdown
39+
## CI Failure Report
40+
41+
The following jobs failed on the main branch:
42+
- **lint**
43+
- **tests**
44+
- **smoke-tests**
45+
46+
**Workflow Run:** https://github.com/microsoft/vscode-python/actions/runs/7234567890
47+
**Commit:** def456abc7890123def456abc7890123def456ab
48+
**Commit Message:** Update testing infrastructure
49+
**Author:** @maintainer
50+
51+
Please investigate and fix the failure.
52+
53+
---
54+
*This issue was automatically created by the CI system.*
55+
```
56+
57+
---
58+
59+
## Example Comment on Existing Issue
60+
61+
When a second failure occurs within 24 hours, the system adds a comment instead of creating a new issue:
62+
63+
**Comment on existing issue:**
64+
```markdown
65+
## Additional CI Failure
66+
67+
Another CI failure occurred:
68+
- **python-tests**
69+
- **check-types**
70+
71+
**Workflow Run:** https://github.com/microsoft/vscode-python/actions/runs/7234567891
72+
**Commit:** 789ghi012345jkl6789mno012345pqr6789stu01
73+
**Commit Message:** Fix type annotations in discovery module
74+
**Author:** @developer
75+
```
76+
77+
---
78+
79+
## Benefits of This Approach
80+
81+
1. **Immediate Notification**: Issues are created as soon as CI fails on main
82+
2. **Detailed Context**: Each issue includes direct links to failed runs and commit information
83+
3. **No Duplicate Spam**: Multiple failures within 24 hours are consolidated into one issue
84+
4. **Easy Triage**: Automatic labels help maintainers prioritize and categorize
85+
5. **Clear Ownership**: Author mentions ensure the right people are notified
86+
6. **Historical Record**: Issues provide a permanent record of CI stability
87+
88+
## Workflow Integration
89+
90+
```mermaid
91+
graph LR
92+
A[Push to main] --> B[CI runs]
93+
B --> C{All jobs pass?}
94+
C -->|Yes| D[Success ✓]
95+
C -->|No| E[report-failure job]
96+
E --> F{Recent issue exists?}
97+
F -->|Yes| G[Add comment]
98+
F -->|No| H[Create new issue]
99+
G --> I[Notify team]
100+
H --> I
101+
```
102+
103+
## Maintenance
104+
105+
- Issues can be closed once the failure is resolved
106+
- The `ci-failure` label can be used to track CI stability metrics
107+
- Old closed issues serve as documentation for past problems
108+
- Team members can subscribe to the `ci-failure` label for notifications

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,14 +454,15 @@ jobs:
454454
always() &&
455455
github.repository == 'microsoft/vscode-python' &&
456456
github.ref == 'refs/heads/main' &&
457-
(needs.build-vsix.result == 'failure' ||
457+
(needs.setup.result == 'failure' ||
458+
needs.build-vsix.result == 'failure' ||
458459
needs.lint.result == 'failure' ||
459460
needs.check-types.result == 'failure' ||
460461
needs.python-tests.result == 'failure' ||
461462
needs.tests.result == 'failure' ||
462463
needs.smoke-tests.result == 'failure')
463464
runs-on: ubuntu-latest
464-
needs: [build-vsix, lint, check-types, python-tests, tests, smoke-tests]
465+
needs: [setup, build-vsix, lint, check-types, python-tests, tests, smoke-tests]
465466
permissions:
466467
issues: write
467468
steps:
@@ -471,6 +472,7 @@ jobs:
471472
script: |
472473
const failedJobs = [];
473474
const jobs = {
475+
'setup': '${{ needs.setup.result }}',
474476
'build-vsix': '${{ needs.build-vsix.result }}',
475477
'lint': '${{ needs.lint.result }}',
476478
'check-types': '${{ needs.check-types.result }}',

0 commit comments

Comments
 (0)