Repository navigation
Commit dc2f1cd
authored
fix: don't crash when posting the CI link comment fails (#707)
pushStarted() posts a "CI: <url>" (or "V8 CI:" / "Lite-CI:") comment
on the pull request when Jenkins reports a pending build, but called
createPrComment() without awaiting it or attaching a rejection handler.
createPrComment() logs the error and rethrows it, so any GitHub API
failure while commenting (5xx, rate limiting, locked PR, timeout)
turned into an unhandled promise rejection. server.js treats those as
fatal and exits the process, taking down the bot because of a
best-effort comment.
Route the three comment calls through a small postCiComment() helper
that swallows the already-logged rejection, so the commit status update
and the rest of the bot keep working.
Add a unit test which makes the comment endpoint return 500 and asserts
that the status is still created and no unhandled rejection is raised;
it fails without this change.
Fixes: #704
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>1 parent 5fdf35d commit dc2f1cd
2 files changed
Lines changed: 34 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
0 commit comments