publish_bundle: refresh remote ref before --force-with-lease push #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "apme/fix-publish-bundle-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the silent failure surfaced during AAP testing of PR #4: per-app job 21637 ran the full v4 pipeline successfully through render+containerfile+validate, then failed at publish_bundle git push with
no_log: truemasking the real error.Root cause reproduced locally:
--force-with-leaserejects with! [rejected] (stale info)when the local clone'srefs/remotes/origin/bundle/<slug>is older than what the remote currently has.Fix: re-fetch the branch ref immediately before push, then use the explicit
--force-with-lease=<ref>:<sha>form. Race protection preserved (if remote advances between fetch and push, lease still rejects). Fallback to plain push for the first-run case (remote branch doesn't exist yet).Also adds
failed_when: rc != 0so non-zero exits abort the per-app job rather than continuing silently, and an echo task so the push rc shows in the log without leaking the PAT-bearing URL.