Repository navigation
fix: DEVENV-9852 fetch the build index from Harbor, not Artifactory - #6
Merged
Merged
Conversation
Artifactory was switched off on 2026-09-11. k8s-promote.yml still curled the build index from artifactory.../docker-build-metadata/<app>/builds/<id>/index.json and failed hard when it could not. The build index now lives in Harbor: docker-build.yml (and the Bitbucket docker-build-pipe) push it as a tagged OCI artifact at builds/<image_name>:<build_id> with outputs.json + bake-metadata.json as layers, and k8s-apps-config's update-app-manifest.sh pulls it the same way. The fetch step now installs oras and pulls that artifact with harbor_username / HARBOR_TOKEN, then hands outputs.json to the unchanged downstream steps (which only read .outputs[].target and .digest). image_registry is now the Harbor path (<host>/<namespace>/<app>) with no Artifactory /docker/ segment. New inputs harbor_host, harbor_username, harbor_builds_project and runs_on (Harbor is internal-only, so callers need a self-hosted runner); the ARTIFACTORY_HOST / ARTIFACTORY_TOKEN secrets are gone and HARBOR_TOKEN is required. docker-build.yml is untouched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Artifactory was switched off on 2026-09-11 (DEVENV-9852).
k8s-promote.ymlstill fetched the build index fromartifactory.../docker-build-metadata/<app>/builds/<id>/index.jsonandexit 1s when it cannot, so every promotion now fails.What changed (
.github/workflows/k8s-promote.yml)docker-build.yml) and pulls the build index from Harbor as an OCI artifact:<harbor_host>/<harbor_builds_project>/<app_name>:<build_id>. That is exactly whatdocker-build.ymlpushes (builds/<image_name>:<build_id>, layersoutputs.json+bake-metadata.json) and whatk8s-apps-configbin/update-app-manifest.shandtak-nonprod-swarm-alib/harbor.jsalready read.outputs.jsonis copied tobuild-index.json, so the downstream steps (which only use.outputs[].targetand.digest) are unchanged.image_registryis now the Harbor path<harbor_host>/<image_namespace>/<app>- no Artifactory/docker/segment.harbor_host(registry.landcareresearch.co.nz),harbor_username(robot account name),harbor_builds_project(builds),runs_on(ubuntu-latest, mirroringdocker-build.yml).ARTIFACTORY_HOST/ARTIFACTORY_TOKENremoved;HARBOR_TOKEN(required) added. Unavoidable - the workflow had no Harbor credential at all. The only in-org caller is this repo's README example, which is updated.docker-build.ymland itsARTIFACTORY_*inputs are untouched (separate cleanup).Verification (against a real build, not a synthetic one)
oras pullofregistry.landcareresearch.co.nz/builds/nsdr-editor:245-8ca0d576ea26a174960ff79447f920b58f00844awith a Harbor user: artifact typeapplication/vnd.landcareresearch.build-index+json, layersoutputs.json(1186 B) andbake-metadata.json(2142 B). The same fetch also works as a raw registry v2 call (401 ->/service/tokenwith scoperepository:builds/nsdr-editor:pull-> manifest 200 -> blob 200), which is what oras does under the hood.echo token | oras pull -u ... --password-stdin ... -o build-index, then theoutputs.jsonguard) - succeeds; then ran the unchanged "Generate promotion manifest" jq over the pulled index - produces the expectedcomponents/imagesstructure with.target=weband the image digest.yqrequired-field checks (inputs.environment,inputs.build_id) still pass.Things for the reviewer to decide
registry.landcareresearch.co.nz), so a promotion on the defaultubuntu-latestrunner cannot fetch anything. I kept the default for parity withdocker-build.ymland documented it; flipping the default to the self-hosted label (tak-k8s-ci) may be the better call.app_namemust match theimage_namethe build pushed under (both default to the repository name) - unchanged behaviour, now spelled out in a comment.full_refconvention (<registry>/<app>/<target>) suits GitHub bake layouts; a Bitbucket-built single-target app (thensdr-editorindex recordsmwlr-private/nsdr-editor:<tag>) does not fit it. Out of scope here, noting it because it showed up while testing.