Commit 177712f
authored
fix(publish): surface vsce/ovsx errors under bash -e (#26)
## Why
The `0.2.2` publish run on main failed with no diagnostic output. All
four `vsce publish` matrix entries exited with code 1, but the only
thing the logs showed between `##[group]vsce publish attempt 1/5` and
`##[error]Process completed with exit code 1.` was *nothing* — vsce's
actual error message vanished.
Root cause: GitHub runs the script as `/usr/bin/bash -e {0}`. The
`retry_publish` function captures command output with:
```bash
output=$("$@" 2>&1)
rc=$?
echo "$output"
```
Under `set -e`, a failing command substitution `output=$(cmd)`
terminates the script *before* the next line. So when vsce returned
non-zero, bash killed the script at the assignment line — never echoed
`$output`, never reached the retry classification, never hit the
endgroup. The script just exited with code 1 carrying nothing useful.
The previous single-target version of this workflow had the same bug
latent; it never triggered because vsce always succeeded historically.
Switching to the multi-target matrix exposed a real vsce failure and the
latent bug ate the diagnostic.
## Fix
Replace the bare assignment with an explicit `if/else`, which `set -e`
is documented to handle correctly:
```bash
if output=$("$@" 2>&1); then rc=0; else rc=$?; fi
echo "$output"
```
Applied to both retry functions (vsce and ovsx).
## Recovery state
- **VS Code Marketplace:** still on `0.2.0`. `0.2.2` never landed (vsce
publish silently failed for all 4 targets).
- **Open VSX:** has `0.2.2` for all 4 targets (the ovsx publishes
succeeded).
- **GitHub:** no `vscode-extension-v0.2.2` tag (finalize was skipped
because publish failed).
## No version bump
`0.2.2` is still missing from the Marketplace, so the `prepare` gate
will let a re-run proceed. The ovsx side will hit "already exists" →
idempotent success in the retry function. The vsce side will either
publish for real this time, or fail with an actual error message we can
act on.
If vsce errors with a real message after this, expect a follow-up PR to
address whatever it actually is (auth scope, validation, manifest
mismatch, rate limit, etc.).
## Test plan
- [x] YAML parses; both retry functions updated
- [ ] After merge: push to main triggers re-run; verify vsce output is
now visible in the logs whether it succeeds or fails
- [ ] If vsce succeeds: all 4 platform builds appear on Marketplace
under `0.2.2`, finalize runs, tag + release created
- [ ] If vsce fails: open follow-up with the actual error1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
243 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
| |||
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
305 | | - | |
306 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
307 | 315 | | |
308 | 316 | | |
309 | 317 | | |
| |||
0 commit comments