Public Release (Open-Source Mirror)¶
pybrid development happens on anabrid's internal GitLab server, but a
public snapshot of the source tree is mirrored to
github.com/anabrid/pybrid-computing
on every tagged release. The mirror is one-way (GitLab to GitHub) and is
driven by the publish:github job in .gitlab-ci.yml. This page explains
how that pipeline is structured and how to maintain the public branch
that backs it.
Why a public branch?¶
The internal tree contains a proto/ git submodule that points at an
internal GitLab URL, which is unreachable for external users. The public
mirror must therefore ship a different .gitmodules whose proto/ entry
points at github.com/anabrid/analog-protobuf.
We carry that rewrite as a dedicated branch:
main(internal): canonical source, points the submodule at the internal GitLab.public(internal): exactlymainplus one commit that rewritessubmodule.proto.urlin.gitmodules. Always one commit ahead ofmain, never more.- GitHub
main: a mirror ofpublicafter rebase, pushed by CI.
Why not rewrite history?
Carrying a single, mechanical commit on a long-lived branch keeps the
publishing pipeline simple and lets CI fail loudly the moment someone
edits .gitmodules on main (the rebase will conflict, which is the
correct signal that the rewrite commit needs a human review).
The publish:github CI job¶
Defined in .gitlab-ci.yml. Runs manually or automatically on any tag
pushed to GitLab. Steps:
- Fetch all branches and tags from GitLab (
GIT_DEPTH: 0is set globally, so the runner has full history). - Check out the internal
publicbranch and rebase it onto the currentorigin/main. This replays the single submodule-URL commit on top of the latest source. - Force-push the rebased branch to GitHub as
main. - Push release tags. Two patterns cover the current tag conventions:
vX.Y.Z(used sincev0.11.2) and bareX.Y.Z(older releases). The legacybefore-actual-implementationtag is intentionally excluded.
The job reuses GITHUB_TOKEN and GITHUB_PAGES_REPO from the existing
publish:github-pages job, so no new CI variables are required. It does
not push the rebased branch back to GitLab; the internal public
branch is treated as a template that only needs touching when the
rewrite commit itself changes.
Tags survive the rebase
Rebasing public only rewrites the URL commit at the tip. The
underlying main commits keep their SHAs, so every release tag points
at a commit that ends up in GitHub's history once public is pushed.
The proto/ submodule itself¶
The submodule SHA recorded in a parent pybrid commit must be reachable on
public analog-protobuf, not just on internal redac-protobuf. Two
implications:
- Never bump pybrid's submodule pointer to a
redac-protobuffeature branch SHA. Only point at commits that are merged into protobuf'smain, sincemainis what gets mirrored to public. - Internal
redac-protobufand publicanalog-protobufmust be kept in sync. They sharemainSHAs today, but there is no CI keeping them that way; setting up the same mirror pattern onredac-protobufis recommended follow-up work.
Maintaining the public branch¶
The branch should always look like main plus exactly one commit that
sets proto/'s URL to the public address. To (re)create it from scratch:
git fetch origin
git checkout -B public origin/main
git config --file .gitmodules \
submodule.proto.url git@github.com:anabrid/analog-protobuf.git
git add .gitmodules
git commit -m "Public release: rewrite proto/ submodule URL"
git push --force-with-lease origin public
When the rebase in CI fails (someone changed .gitmodules on main),
resolve it locally with the commands above and force-push the new
public branch. The job will succeed on the next run.
What is not mirrored¶
gh-pageson GitHub is owned bypublish:github-pages(the docs build) and is left untouched bypublish:github.- Internal-only tags (e.g.
before-actual-implementation) are excluded by the tag refspecs above. New internal-only tags must not match thev*or[0-9]*patterns, or they will leak. - Branches other than
mainon GitHub are not maintained. The previously-publishedpublicbranch on GitHub can be deleted; we publish tomainonly.