|
| 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 |
0 commit comments