Commit 2f3169e
committed
Make grant minting idempotent too; centralize the trigger-name string
Gates mintRepoGrant on a new hasRepoGrant port, checked independently
of hasWebhookTrigger, so a retry after a failure between the two steps
mints only whichever one the failed attempt didn't finish rather than
re-minting a grant that already exists. apps/hub's hasRepoGrant binds
to a read against the same grant table mintRepoGrant inserts into.
Also pulls the "<repo> pull-request-opened" trigger-name convention
into one exported webhookTriggerName helper, used by both the create
and the lookup in apps/hub, so they read the same string by
construction instead of by two hand-kept copies of it.
Documents, rather than changes, that a trigger is never disabled or
deleted on GitHub disconnect: re-adding a repo after a reconnect finds
its old trigger still live and is skipped, not re-created.
Fixes CL-7134.1 parent 8d72904 commit 2f3169e
4 files changed
Lines changed: 62 additions & 11 deletions
File tree
- apps/hub/src
- packages/workflow-catalog/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
2172 | 2173 | | |
2173 | 2174 | | |
2174 | 2175 | | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
2175 | 2187 | | |
2176 | 2188 | | |
2177 | 2189 | | |
| |||
2207 | 2219 | | |
2208 | 2220 | | |
2209 | 2221 | | |
2210 | | - | |
| 2222 | + | |
2211 | 2223 | | |
2212 | 2224 | | |
2213 | 2225 | | |
| |||
2217 | 2229 | | |
2218 | 2230 | | |
2219 | 2231 | | |
2220 | | - | |
| 2232 | + | |
2221 | 2233 | | |
2222 | 2234 | | |
2223 | 2235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
281 | 286 | | |
282 | 287 | | |
283 | 288 | | |
| 289 | + | |
284 | 290 | | |
285 | 291 | | |
286 | 292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
11 | 22 | | |
12 | 23 | | |
13 | 24 | | |
| |||
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
36 | 51 | | |
37 | 52 | | |
38 | 53 | | |
| |||
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
63 | 82 | | |
64 | 83 | | |
65 | 84 | | |
| |||
79 | 98 | | |
80 | 99 | | |
81 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
82 | 104 | | |
83 | 105 | | |
84 | 106 | | |
85 | | - | |
86 | 107 | | |
87 | 108 | | |
88 | 109 | | |
| |||
91 | 112 | | |
92 | 113 | | |
93 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
0 commit comments