Commit 4dee64d
authored
feat(workflow): generate diff-accurate upgrade-deps PR descriptions via Claude (#1402)
Previously the `Upgrade Upstream Dependencies` workflow shipped a
generic
template commit message and PR body (see #1401) that didn't reflect what
actually changed. This PR rewires the workflow so the commit and PR
description are generated from the real diff on every run.
## What's new
### Diff-accurate descriptions
- `.github/scripts/upgrade-deps.mjs` records old → new for every dep it
touches (including rolldown/vite tag + short SHA) and writes
`versions.json`, `commit-message.txt`, and `pr-body.md` to
`$UPGRADE_DEPS_META_DIR` (in `$RUNNER_TEMP`, so they aren't committed).
- `.github/workflows/upgrade-deps.yml`:
- New `Set up metadata directory` step exports `UPGRADE_DEPS_META_DIR`
via `$GITHUB_ENV`.
- New `Enhance PR description with Claude` step reads the baseline
files plus `git diff` and overwrites them with a Summary, a
dependency table, a Code-changes list, and a Build-status block.
- New `Read generated PR content` step exposes the files as multi-line
step outputs (with a trailing-newline guard so the heredoc
terminator always lands on its own line).
- `peter-evans/create-pull-request` now consumes those outputs instead
of a static template body.
- If the enhancement step fails, `continue-on-error: true` keeps the
workflow going and the baseline content from the Node script ships
instead of a generic message.
### Tightened `Check upgrade dependencies` prompt
- Single authoritative checklist: Background → Fixups (in order) →
Final validation → Commit rule. The previous prompt had three
overlapping sections describing the same checks.
- Final validation requires BOTH `just build` AND
`pnpm bootstrap-cli:ci && pnpm test` to pass, plus a manual snap-test
diff inspection (because `pnpm test` always exits 0 even on snapshot
drift, so the agent has to look at the diff itself).
- New `Running long commands` rule forbids backgrounding (`&`, `nohup`,
`disown`, …) and polling (`ps`, `pgrep`, `sleep` loops, repeated `ls`
on build artifacts). Run 24545325671 spent 30+ minutes spinning in a
`ps aux | grep "just build"` loop before this rule landed.
### Safety bounds on the Claude session
- `--max-turns 200` caps total tool calls so a runaway agent can't
consume an entire job budget.
- `timeout-minutes: 180` on the step is a belt-and-suspenders cap on
wall-clock time.
- Both `anthropics/claude-code-action` pins bumped to v1.0.99
(Claude Code 2.1.112).
### Script hygiene
- `getLatestTag` uses `?per_page=1` and the rolldown + vite fetches run
in parallel via `Promise.all`.
- `updatePnpmWorkspace` is now a single-pass `String.replace` callback
with one capture group per pattern (avoids the foot-gun where the
replace callback's positional `suffix` arg silently received the match
offset and corrupted versions). Throws explicitly if a pattern goes
stale instead of silently recording a no-op change.
- `updateCorePackage` early-exits when `@vitejs/devtools` isn't present,
skipping the no-op JSON rewrite.1 parent ee4e19d commit 4dee64d
2 files changed
Lines changed: 347 additions & 87 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
5 | 24 | | |
6 | 25 | | |
7 | | - | |
8 | | - | |
| 26 | + | |
| 27 | + | |
9 | 28 | | |
10 | 29 | | |
11 | 30 | | |
| |||
18 | 37 | | |
19 | 38 | | |
20 | 39 | | |
21 | | - | |
22 | | - | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | | - | |
25 | | - | |
| 43 | + | |
| 44 | + | |
26 | 45 | | |
27 | 46 | | |
28 | 47 | | |
| |||
45 | 64 | | |
46 | 65 | | |
47 | 66 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
| |||
60 | 84 | | |
61 | 85 | | |
62 | 86 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
89 | 132 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
95 | 147 | | |
96 | 148 | | |
97 | 149 | | |
| |||
128 | 180 | | |
129 | 181 | | |
130 | 182 | | |
131 | | - | |
132 | | - | |
133 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
134 | 186 | | |
| 187 | + | |
| 188 | + | |
135 | 189 | | |
136 | 190 | | |
137 | 191 | | |
138 | 192 | | |
139 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
140 | 270 | | |
141 | 271 | | |
142 | 272 | | |
| |||
181 | 311 | | |
182 | 312 | | |
183 | 313 | | |
| 314 | + | |
| 315 | + | |
184 | 316 | | |
0 commit comments