Commit a59a72a
committed
Merge #6758: feat: enhance conflict prediction workflow with PR comments
538d88d fix: add UTF-8 encoding to file open operation (pasta)
e0515b9 fix: use dynamic repository reference and update checkout action (pasta)
2758785 cleanup: remove debug logging now that issues are resolved (pasta)
8b3c439 fix: improve conflict detection by checking for partial text or X icon (pasta)
5a853f2 debug: add more diagnostics for response text analysis (pasta)
a7be4bb debug: add more detailed logging for merge check failures (pasta)
75c21e6 fix: make repository configurable using GITHUB_REPOSITORY env var (pasta)
4668cb7 fix: handle missing PR data gracefully in conflict checker (pasta)
3180c2d feat: enhance conflict prediction workflow with PR comments (pasta)
Pull request description:
## Summary
This PR enhances the conflict prediction workflow to automatically post comments on pull requests when potential merge conflicts are detected with other open PRs.
## Changes
### 1. Enhanced Python Script (`handle_potential_conflicts.py`)
- Added GitHub Actions output functionality to pass conflict data to the workflow
- Made repository configurable using `GITHUB_REPOSITORY` environment variable (supports testing on forks)
- Improved error handling to gracefully skip PRs that fail to fetch
- Fixed conflict detection to work with current GitHub HTML responses
- Added formatted markdown output for PR comments
### 2. Updated Workflow (`predict-conflicts.yml`)
- Added PR comment posting using `mshick/add-pr-comment@v2`
- Comments are updateable (sticky) using `message-id` to prevent duplicates
- Shows list of conflicting PRs with links when conflicts exist
- Removes/updates comment when conflicts are resolved
- Maintains original failure behavior
### 3. Bug Fixes
- Fixed KeyError when PR API responses don't have expected fields
- Improved HTML response parsing for merge conflict detection
- Added support for partial text matching ("Can't automatic") and icon detection ("octicon octicon-x")
## Example Comment Output
When conflicts are detected:
```
## File tree
2 files changed
+156
-21
lines changed- .github/workflows
2 files changed
+156
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
29 | 72 | | |
30 | 73 | | |
31 | 74 | | |
32 | 75 | | |
33 | 76 | | |
34 | 77 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 78 | + | |
39 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
40 | 93 | | |
41 | 94 | | |
42 | | - | |
43 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
44 | 107 | | |
45 | 108 | | |
46 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
47 | 116 | | |
48 | | - | |
49 | 117 | | |
50 | | - | |
51 | 118 | | |
52 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
53 | 129 | | |
54 | | - | |
55 | 130 | | |
56 | | - | |
57 | | - | |
| 131 | + | |
| 132 | + | |
58 | 133 | | |
59 | 134 | | |
60 | | - | |
61 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
62 | 148 | | |
63 | 149 | | |
64 | | - | |
65 | 150 | | |
66 | 151 | | |
67 | | - | |
| 152 | + | |
| 153 | + | |
68 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
69 | 177 | | |
70 | | - | |
| 178 | + | |
71 | 179 | | |
72 | | - | |
| 180 | + | |
73 | 181 | | |
74 | | - | |
75 | 182 | | |
76 | 183 | | |
77 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
0 commit comments