Onboarding a repo
Step-by-step (and a copy-paste AI prompt) to put any repo on the central versioning + CI + changelog pipeline, plus how to roll out policy changes.
Adding a repo to the pipeline is almost entirely replacing its CI workflows with one thin stub that calls the central reusable workflow. Use consent-manager as the working exemplar, or the canonical template ci/samples/caller-stub.yml in the packaging repo.
Why some boilerplate is repeated in every stub. The Run workflow dialog is rendered from a repo's own workflow_dispatch inputs — a reusable (imported) workflow cannot supply them. So the two changelog inputs and their wording live in each stub, not centrally. Keep that block byte-identical across repos (copy it from the canonical template) so every repo's dialog reads the same; the per-repo bits are only images / chart-path / chart-image-paths / pins.
Steps
Add
.github/workflows/build-publish.yml(the stub — see the prompt below), callingopeng2p/openg2p-packaging/.github/workflows/build-publish.yml@v1.Delete the old
docker-build*.ymlandhelm-publish.yml.Placeholder the image tags in
values.yaml(CI injects the real ones) and confirmChart.yamlkeepsversion: 0.0.0-develop.Do it on
develop(the default branch) — it flows to release lines when they're cut.Push a throwaway branch first (e.g.
xxx-smoke) to smoke-test: a feature branch builds images at0.0.0-xxx-smoke.Nand skips chart/changelog publishing, so nothing central is touched. Then pushdevelop.
Prerequisites (once per org)
OPENROUTER_API_KEY— org-level Actions secret (else changelogs publish without the AI summary).GitHub Pages enabled on
openg2p-packaginggh-pages(to view changelogs).The bot PAT (
OPENG2P_BOT_GITHUB_PAT) can push toopeng2p-helmandopeng2p-packaging.
The prompt
Paste this to an AI agent working in the new repo (fill the one bracketed line):
Put this repository on the OpenG2P central build/versioning/changelog pipeline, exactly like
consent-manager.
Create
.github/workflows/build-publish.ymlthat triggers onpushtobranches: ["**"]andtags: ["**"], plusworkflow_dispatchwith boolean inputchangelog_skip_ai(default false) and string inputchangelog_regenerate(default ""). Give them clear descriptions:changelog_skip_ai→ "Skip the AI summary — publish the changelog from commit messages only (use when AI is unavailable). Leave OFF for a normal run.";changelog_regenerate→ "Backfill the AI summary for a release that published without one: enter its release version e.g. 1.0.1 (a bare N.N.N, not a develop version). Leave EMPTY for a normal run." It must have one job that callsuses: openg2p/openg2p-packaging/.github/workflows/build-publish.yml@v1and passespackaging-ref: v1.Under
with:, setimagesto a JSON array — one entry per Docker image this repo builds — each{ "name", "repo", "dockerfile", "context"?, "pins"? }, wherenamelabels the build,repois the Docker Hub repository (openg2p/…),contextdefaults to., andpinsis only for images whose Dockerfile declares anARGthat is a git ref (list{ "arg", "repo", "ref" }so CI resolves the ref to a SHA). Find the images by looking at thedocker/**andui/**Dockerfiles.Set
chart-pathto the chart directory, andchart-image-pathsto a JSON array of theyqpaths in that chart'svalues.yamlthat hold this org's image tags (exclude third-party images). Find them by greppingvalues.yamlforrepository: openg2p/….Forward
changelog_skip_aiandchangelog_regeneratefrom the dispatch inputs, and pass secretsdocker_hub_actor,docker_hub_token,OPENG2P_BOT_GITHUB_PAT, andOPENROUTER_API_KEY.Delete the existing
docker-build*.ymlandhelm-publish.yml.In the chart's
values.yaml, set every OpenG2P imagetagto a placeholder (CI injects the real version at package time); keepChart.yamlversion: 0.0.0-develop.Do NOT add any versioning logic or path filters to the stub — all logic is in
openg2p-packaging@v1. Keep the stub minimal and declarative.Reference: the
consent-managerbuild-publish.yml, and the docs at Helm & Docker Versioning Strategy and CI.
Maintaining the pipeline: moving v1
When you change the central logic in openg2p-packaging (the versioning script, the changelog, the workflow), the repos pick it up only when the v1 tag moves:
Moving v1 re-points every repo and branch on their next run. Best practice:
Cut an immutable peg first:
git tag v1.2.0 && git push origin v1.2.0.Canary it on one repo by temporarily pinning that repo's stub to
@v1.2.0.Only then move
v1:git tag -f v1 v1.2.0 && git push -f origin v1.
Ordering matters: if you push a stub that uses a new input before v1 has it, that run fails with startup_failure. Move v1 first. (A re-run fixes a stale failure once v1 is current.)
The compatibility rule
Moving
v1may change how artifacts are built and published. It must never change what version string a given commit gets.
Fixing a bug, adding an input with a default, improving a label — safe under v1. Changing the version format (e.g. -rc. → -alpha.) changes what a commit is called and needs a v2, or it breaks the immutability guarantees of versions already published from long-lived branches.
Keep every v1.x.y peg forever — it is how you answer "which policy built this?" and how you roll back (git tag -f v1 v1.1.0 && git push -f origin v1).
Last updated
Was this helpful?