post-receive includes detailed information about pruned GitLab branches
This is the companion to heptapod!81 (merged)
The post-receive payload includes a new hg_prunes
field. It is a JSON-encoded string, because it would be complicated to specify a structured Hash
field in GitLab internal API, at least with the flexibility that we need.
The main keys are reason types, such as topic_published
, and each value is a mapping from GitLab Branch to complementary information. In the case of published topic, the complementary information is the SHA of the latest topic position.
The GitLab branches are encoded in Base64, to centralize encoding resolution on the GitLab side, where there's already a similar one for the regular changes
.
The GitLab branches are pruned right away in all cases. This should solve heptapod#268 (closed) and heptapod#278 (closed) The same will happen anyway in Heptapod 0.14 when GitLab will read directly from Mercurial. We still carry over the prunes in the regular changes
, so that GitLab can account for the removal as before.
For now, the only detailed prune reasons are TopicPublished
and BranchClosed
, but more interesting could be easily added if needed.