You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: surface gh-pages publish errors via callback (#205) (#206)
fix: surface gh-pages publish errors via callback
gh-pages@6 silently absorbs errors via its internal .then(_, onRejected)
handler that catches rejections and calls the user callback without
rethrowing — which converts the rejection into a fulfilment. The result:
git failures (notably HTTPS auth errors during clone) leave publish()'s
returned Promise in a resolved state, so angular-cli-ghpages printed its
"Successfully published" banner and exited 0 even when nothing was
pushed.
The v3.0.0 refactor removed a 2019 callback wrapper under the assumption
that upstream had fixed this. Upstream commit e1374b3 ("always return a
promise") only fixed two early-exit validation paths — not the main
chain's error absorption. Issues tschaub/gh-pages#465, #412 and #151
remain open.
Restore the callback-based wrapper: the callback always fires with the
error, so we bridge it to a rejection of our own Promise.
Regression tests:
- engine.gh-pages-integration.spec.ts: mock-contract test that encodes
the exact bug shape (callback fires with error, promise resolves),
plus a "no success banner on failure" assertion.
- engine.gh-pages-behavior.spec.ts: spawn-level canary that drives the
real gh-pages library through engine.run() with child_process.spawn
mocked to emit "fatal: Authentication failed" + exit 128 on clone.
Existing mocks across engine.spec.ts, engine-filesystem.spec.ts, and
parameter-tests/builder-integration.spec.ts updated to invoke the
callback (they previously relied on mockResolvedValue only and would
hang once engine started awaiting a callback).
Fixes#205
0 commit comments