Server-side merges fire no ref-update event: no webhooks, no CI #65

closed cmc opened this on 2026-08-31 20:29 UTC

Discussion

cmc 2026-08-31 20:29 UTC

mr merge updates the target ref with gitutil.UpdateRefCAS (internal/control/mr.go), which bypasses receive-pack. Everything that hangs off a ref update therefore never runs for a merge performed over SSH, the CLI, the web UI, or the API:

  • no webhook — postReceive records the push event that webhooks subscribe to (internal/hookd/hookd.go, "Every ref update is an event webhooks can subscribe to"). A merge records mr.merged and nothing else, so a subscriber watching push never hears that main moved.
  • no builds — queueBuilds reads .gitbay/ci.yml and creates one build per job on a branch push. A merge queues none, so CI silently skips exactly the commits that land on the default branch.
  • no push mirrors — MarkMirrorsDirty(repoID, "push") is not called, so a mirrored repo does not sync after a merge.

The issue-reference and landed-commit work is already duplicated into the merge path, which is what makes the omission easy to miss: closes #N in a commit message works on merge, but CI does not.

Concretely: merging an MR into a repo with a .gitbay/ci.yml runs nothing, and pushing the identical commit to the same branch runs the whole config.

Found while trying to trigger a site deploy from a merge in krz/krz.sh.

cmc 2026-08-31 20:48 UTC

Correction to the description: push mirrors are not affected. MarkMirrorsDirty(repo.ID, "push") is already called in the merge path; I missed it when writing this up. A mirrored repo does sync after a merge today.

The two real gaps stand: no push event, so webhooks never hear that the branch moved, and no builds queued.

closed by commit 5460cca8a5 by cmc: Fire the ref-update work when a merge moves a branch

2026-08-31 20:58 UTC