Repository navigation
Conversation
Following open-quantum-safe/oqs-provider#786 this PR updates the `README.md` to advise use of version pinning over mutable tag pointers. It also adds an opt-in mechanism that creates an issue on downstream open-quantum-safe projects when a new version of a consumed base CI image is published, so the changes can be reviewed and the digest updated as necessary. - When a push to `main` bumps an image's `LABEL version` and the image is republished, the `notify.yml` workflow opens an issue (as `oqs-bot`) on every subscribed repo, containing the version, the `@sha256:...` digest to pin, and a link to verify it. - Projects subscribe by PR to `subscribers.yml`; a validation workflow checks each entry (schema + `open-quantum-safe/` org restriction) on the PR. This fills a gap Dependabot does not cover (dependabot-core#5819 / #5541, open since 2022). Required of maintainers/organisation administrators before merge: - `oqs-bot` is used to create the issues: this is currently a member of the `open-quantum-safe` organisation and has been utilised across the org for automated actions: **please verify this is an acceptable additional use**. - Ensure a fine-grained PAT for `oqs-bot` (resource owner: open-quantum-safe; repository access: all org repos (or edit this PR if this is to be requested on a per-repo basic); permissions: Issues → Read and write only), and store it as the `NOTIFY_TOKEN` secret. I’m happy to abandon the secondary notification aspect of this PR, but it seemed like the obvious follow-on. Signed-off-by: JP Lomas <jp@theqrl.org>
| # --------------------------------------------------------------------------- | ||
|
|
||
| subscribers: | ||
| - repo: open-quantum-safe/oqs-provider # must be an open-quantum-safe repository |
There was a problem hiding this comment.
Why only that? Shouldn't liboqs also be listed?
There was a problem hiding this comment.
Yes - anywhere where :latest is consumed IMHO. I've not done a sweep (yet) as
- I wanted to make sure this approach was both reasonable and practical (e.g. with respect to oqs-bot setup)
- If a user is to be tagged into bot-created issues, it probably warrants prior warning with an issue on the respective repo suggesting subscription here
I'm happy to perform the sweep for use and add consumers/maintainers to this PR if the alternative, more didactic approach, is acceptable.
There was a problem hiding this comment.
That'd be nice to before merge, otherwise LGTM.
There was a problem hiding this comment.
@baentsch added, from GOVERNANCE.md file where available
baentsch
left a comment
There was a problem hiding this comment.
PR Review: ci-containers#107 — Notify consumers when a new image is pushed
Co-authored with Anthropic's Claude Code (claude-sonnet-4-6) — https://claude.ai/code
Overview
This PR adds a subscriber notification system: when a Dockerfile's LABEL version is bumped and the image is pushed to Docker Hub, a workflow resolves the new multi-arch digest and opens a GitHub issue on every subscribed repo. It also adds digest-pinning guidance to the README. The motivation is solid — Dependabot has had an open gap for Docker Hub digest pinning since 2022.
Code quality
Strengths:
set -euo pipefailthroughout — good defensive scripting.- Duplicate-issue guard before creating each notification.
- Graceful degradation: missing
NOTIFY_TOKENsilences the workflow without failing. workflow_runtrigger correctly runs in the base branch context (so secrets are accessible).- Minimal permissions (
contents: readonly on both new workflows). - Validation workflow gives contributors fast feedback on bad
subscribers.ymlentries.
Issues / risks:
-
fetch-depth: 0is overkill. The script only needsHEAD^;fetch-depth: 2is sufficient and avoids fetching the full history on every run. -
Three separate places list the known images (
IMAGESmap innotify-subscribers.sh,KNOWN_IMAGESinvalidate-subscribers.sh, and the comments insubscribers.yml), all
flagged "keep in sync" but with no enforcement. A single source of truth (e.g. deriving the list from the filesystem at runtime) would be more robust. -
yqis assumed present but neither workflow installs it. This works today because GitHub-hostedubuntu-latestrunners shipyq, but it's an implicit dependency that could
silently break if the runner image changes. An explicit install step would be safer. -
git diff HEAD^ HEADwill fail if the workflow ever runs on the very first commit of a branch (noHEAD^). Unlikely in practice but worth a guard. -
Digest resolution race:
docker buildx imagetools inspectruns after the push. If two images are pushed in rapid succession there is a tiny window where the digest resolves to the
wrong image. Negligible in practice. -
Hardcoded example digest in
README.md(sha256:52c9f9c...) will go stale immediately and could mislead users copy-pasting it.
Organisational / process concerns
These are the real questions before approving:
-
jplomasadds themselves to thementionlist foropen-quantum-safe/oqs-providerin the initialsubscribers.yml. That means an external contributor
will be @-mentioned in another project's issues every time an image is updated. Maintainers ofoqs-providershould explicitly agree to this. -
The required setup is non-trivial: a fine-grained PAT for
oqs-bot, scoped to all org repos (or named individually),Issues: write, stored asNOTIFY_TOKEN, and rotated
annually. The PR is clear about this, but it is a standing maintenance burden. -
oqs-botissue-write permission across all org repos is a meaningful trust escalation. Worth confirming this is acceptable to org admins before merge.
Verdict
The implementation is clean and well-considered — this fills a real gap. The code issues (fetch-depth, yq, three-way sync) are minor and fixable. The blocking questions are
organisational:
- Do
oqs-providermaintainers acceptjplomasbeing @-mentioned in their repo's issues? Yes by @baentsch but asking @open-quantum-safe/oqs-provider-maintainers - Are org admins prepared to provision and rotate the
NOTIFY_TOKENPAT? - Is the
oqs-botissue-write grant across the org acceptable?
If yes to all three (with only answers to Q2&Q3 real "deal-breakers"), this is ready to merge with the minor nits above optionally addressed first.
Question 1 goes to @open-quantum-safe/oqs-provider-maintainers (I'm surely fine with this); questions 2&3 go to @ryjones.
|
Added myself just for |
Populate subscribers.yml with every non-archived open-quantum-safe repository that consumes these images on its default branch: `liboqs`, `oqs-provider`, `liboqs-java`, and `openssh`. `openssh`’s workflow still references the `ci-ubuntu-focal-x86_64` image that CI stopped publishing in 2024, so it watches the supported successor, `ci-ubuntu-focal`. Since these issues ask a project to review and re-pin a digest, define who a `mention` may name: a maintainer listed under "Current Maintainers" in the subscribed repository's GOVERNANCE.md, or an open-quantum-safe team for repositories that do not carry one. This is documented in subscribers.yml and README.md, and enforced in validate-subscribers.sh, which also now rejects duplicate repo entries that would open duplicate issues. Join mentions with spaces rather than commas so team slugs render as mentions in the issue body. Signed-off-by: JP Lomas <jp@theqrl.org>
|
Cool idea, thanks JP! For the mentions, rather than mentioning individuals, is it possible to mention the relevant team as defined in the TSC config file, such as liboqs-maintainers, oqs-provider-maintainers, etc.? If that works then we only have to worry about keeping the list of users up to date in one place. |
|
Also, as far as I can tell the notifications get triggered when a Docker file increments |
TIL... Thanks, that's a useful point-out. I'll refactor this week (hopefully). |
|
Regarding point 2: I usually set bot-PATs to expire on 12/31/(current year). For something like this, a github app might be a more durable solution, since it needs a one-time grant instead of a token. That's down the road. Point 3: yes. it isn't risk free, of course. |
CI for this and Hadolint are on this list... I think just a simple check for an existing matching LABEL version on Docker Hub should suffice. |
Following open-quantum-safe/oqs-provider#786 this PR updates the
README.mdto advise use of version pinning over mutable tag pointers.It also adds an opt-in mechanism that creates an issue on downstream open-quantum-safe projects when a new version of a consumed base CI image is published, so the changes can be reviewed and the digest updated as necessary.
mainbumps an image'sLABEL versionand the image is republished, thenotify.ymlworkflow opens an issue (asoqs-bot) on every subscribed repo, containing the version, the@sha256:...digest to pin, and a link to verify it.subscribers.yml; a validation workflow checks each entry (schema +open-quantum-safe/org restriction) on the PR.This fills a gap Dependabot does not cover (dependabot-core#5819 / #5541, open since 2022).
Required of maintainers/organisation administrators before merge:
oqs-botis used to create the issues: this is currently a member of theopen-quantum-safeorganisation and has been utilised across the org for automated actions: please verify this is an acceptable additional use.oqs-bot(resource owner: open-quantum-safe; repository access: all org repos (or edit this PR if this is to be requested on a per-repo basic); permissions: Issues → Read and write only), and store it as theNOTIFY_TOKENsecret.I’m happy to abandon the secondary notification aspect of this PR, but it seemed like the obvious follow-on.