ci: a merge onto the default branch reuses the branch's build #335

closed cmc opened this on 2026-10-19 04:53 UTC

Discussion

cmc 2026-10-19 04:53 UTC

A merge onto the default branch often queues no build. queueJobs treats a build of the same commit (BuildsForCommit) or the same tree (SuccessBuildForTree, #177) on any ref as standing for the new push, so a squash merge whose tree equals the branch head's, or a fast-forward, reuses the branch's result. A job sees GITBAY_REF, so the branch build may not have done what the default-branch build would: krz/orgo's pages job no-ops off main, and its docs site was not republished after krz/orgo!9, krz/orgo!12, krz/orgo!13 and krz/orgo!14. Their statuses on main read "passed in build N as , same tree". krz/orgo!10 and krz/orgo!11 did build, because main moved under them and the squashed tree differed.

Reproduced on cmc/ci-ref-scratch: build 2 ran publish on feat with GITBAY_REF=feat, and the squash merge 63ab9f2 got "passed in build 2 as 4494a32f15, same tree" and no build.

closed by cmc in commit e14c4caeec: ci: reuse a build only on the ref it ran for

2026-10-19 05:09 UTC