Inner GitLab hooks for native Mercurial repositories
For the initial exposition of native (HGitaly) Mercurial repositories in Heptapod, we will need the inner hooks sent from the Mercurial processes to contain Mercurial Node IDs (SHAs) instead of their Git counterpart.
Since we are a long way to replace the existing hg-git
backed repositories, we'll need it to be conditional. Overall this will all components, except HGitaly itself:
-
py-heptapod: introduce a new heptapod.native
configuration item, defaulting toFalse
. IfTrue
, send Mercurial SHAs in the hooks. In later milestones, the same configuration item will be used to bypass conversion to Git entirely -
py-heptapod: introduce a special HTTP header (e.g., X-HEPTAPOD-HG-NATIVE
and have the WSGI application interpret it to set the value ofheptapod.native
-
py-heptapod: also react to the HEPTAPOD_HG_NATIVE
environment variable to set the value ofheptapod.native
-
Rails: make sure the internal API endpoint used by Shell provides the vcs_type
information -
Rails: provide a way to include vcs_type
information in responses to Workhorse (probably will be a special header, could even be the same one as understood bypy-heptapod
) -
Shell: read vcs_type
from the internal API payload, and use it topassset--config heptapod.native
on the command lineHEPTAPOD_HG_NATIVE
environment variable -
Workhorse: pass the appropriate X-HEPTAPOD-HG-NATIVE
header to the Mercurial HTTP backend -
Rails: pass --config heptapod.native
on the command line or setHEPTAPOD_HG_NATIVE
environment variable for all directhg
calls.