Repository navigation
ci: keep the Docker Hub listing in a fixed order - #822
Draft
LeeroyHannigan wants to merge 1 commit into
Draft
LeeroyHannigan wants to merge 1 commit into
LeeroyHannigan wants to merge 1 commit into
Conversation
Docker Hub lists a namespace's repositories by last push, newest first. It has no setting for the order, so each publish moves its image to the top of the list. ci/dockerhub-order.py keeps the order postgres, dev, cassandra, mongodb. It finds the lowest repository that is not newer than the one below it. Then, from the bottom up, it pushes the manifest that the latest tag already points to, byte for byte, for that repository and each one above it. No tag changes digest, so signatures and pinned pulls stay the same. The Docker Hub jobs of release-dev-image, release-image, sign-image and promote-image run it after their last Docker Hub push. The script reads the credential that those jobs already hold. The step has continue-on-error and the script runs with --warn-only, so a failure in it never fails a release.
This branch has not been deployed
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.
What
This PR adds
ci/dockerhub-order.pyand runs it at the end of each job that pushes to Docker Hub:release-dev-image.yml, jobpublishrelease-image.yml, jobpublish-candidatesign-image.yml, jobsignpromote-image.yml, jobpromoteThe script keeps the
extenddbrepositories on Docker Hub in this order: postgres, dev, cassandra, mongodb. It finds the lowest repository that is not newer than the one below it. Then, from the bottom up, it pushes the currentlatestmanifest again, byte for byte, for that repository and each one above it.The digest does not change, so the image, its signature and pinned pulls stay the same. Before a push, the script checks that the bytes hash to the digest that Docker Hub reports. After the push, it checks that
lateststill resolves to that digest.The new step has
continue-on-error: trueand runs the script with--warn-only. A failure in the step gives a warning, and the release continues. Without--apply, the script needs no credentials. It prints the plan and checks the manifests.Why
Docker Hub has no setting for the order of the repositories in a namespace. It lists them by last push, newest first. Each publish moves its image to the top. After the 2026-10-23 release, the listing was mongodb, postgres, dev.
The step runs inside the
dockerhubenvironment jobs, because only those jobs hold the Docker Hub credential. A separate workflow would need a second approval for each run. A scheduled job would need the credential outside the protected environment.Points for reviewers:
latestmanifest of other images again. For example, a mongodb promotion pushes thelatestmanifests of cassandra, dev and postgres. No digest changes, but Docker Hub shows a new "last pushed" time for those tags.latesttag. Cassandra has none until its first promotion. If a release publishes mongodb before then, the step warns and mongodb stays above cassandra.Testing done
latestdigests (devsha256:f7fa71e39d2c, postgressha256:9f54c9f4b7a4).--applyrun on 2026-11-04 used an earlier copy of this script with the same push logic. It pushed thelatesttag of dev at 14:03:51 UTC and of postgres at 14:03:57 UTC. The listing then showed postgres, dev, cassandra, mongodb, and bothlatesttags kept their digests.Already in order. Nothing to push.--warn-only, a missinglatesttag, a missing token and a network error each printed a::warningline and exited 0. Without--warn-only, the missing tag exited 1 and the network error raised an exception.actionlinton the four workflows, on this branch and with this commit applied to main at 7c8a776: no findings.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.