Skip to content

ci: notify consumers when a new image is pushed - #107

Open
jplomas wants to merge 2 commits into
open-quantum-safe:mainfrom
jplomas:main
Open

jplomas wants to merge 2 commits into
open-quantum-safe:mainfrom
jplomas:main

Conversation

@jplomas

@jplomas jplomas commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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.

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>
Comment thread subscribers.yml Outdated
# ---------------------------------------------------------------------------

subscribers:
- repo: open-quantum-safe/oqs-provider # must be an open-quantum-safe repository

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why only that? Shouldn't liboqs also be listed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd be nice to before merge, otherwise LGTM.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baentsch added, from GOVERNANCE.md file where available

Comment thread README.md Resolved

@baentsch baentsch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jplomas for this PR: I think I get it and it does solve the problem of (pinned) image users getting notifications of changes to images. The only caveat I have is the annual scret rotation...

@baentsch baentsch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pipefail throughout — good defensive scripting.
  • Duplicate-issue guard before creating each notification.
  • Graceful degradation: missing NOTIFY_TOKEN silences the workflow without failing.
  • workflow_run trigger correctly runs in the base branch context (so secrets are accessible).
  • Minimal permissions (contents: read only on both new workflows).
  • Validation workflow gives contributors fast feedback on bad subscribers.yml entries.

Issues / risks:

  1. fetch-depth: 0 is overkill. The script only needs HEAD^; fetch-depth: 2 is sufficient and avoids fetching the full history on every run.

  2. Three separate places list the known images (IMAGES map in notify-subscribers.sh, KNOWN_IMAGES in validate-subscribers.sh, and the comments in subscribers.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.

  3. yq is assumed present but neither workflow installs it. This works today because GitHub-hosted ubuntu-latest runners ship yq, but it's an implicit dependency that could
    silently break if the runner image changes. An explicit install step would be safer.

  4. git diff HEAD^ HEAD will fail if the workflow ever runs on the very first commit of a branch (no HEAD^). Unlikely in practice but worth a guard.

  5. Digest resolution race: docker buildx imagetools inspect runs 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.

  6. 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:

  • jplomas adds themselves to the mention list for open-quantum-safe/oqs-provider in the initial subscribers.yml. That means an external contributor
    will be @-mentioned in another project's issues every time an image is updated. Maintainers of oqs-provider should 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 as NOTIFY_TOKEN, and rotated
    annually. The PR is clear about this, but it is a standing maintenance burden.

  • oqs-bot issue-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:

  1. Do oqs-provider maintainers accept jplomas being @-mentioned in their repo's issues? Yes by @baentsch but asking @open-quantum-safe/oqs-provider-maintainers
  2. Are org admins prepared to provision and rotate the NOTIFY_TOKEN PAT?
  3. Is the oqs-bot issue-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.

@jplomas

jplomas commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor Author
  1. Do oqs-provider maintainers accept jplomas being @-mentioned in their repo's issues? Yes by @baentsch but asking @open-quantum-safe/oqs-provider-maintainers
    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 open-quantum-safe/oqs-provider per https://github.com/open-quantum-safe/oqs-provider/blob/00fde3373e466043ee30ed31e32c56f6964ee5f4/.github/CODEOWNERS#L7 as someone who would be 'volunteered' into making changes, and out of politeness to avoid tagging another user. Perhaps this should be a group rather than an individual, as a single point of failure risk reduction. i.e. @open-quantum-safe/oqs-provider-maintainers in the subscribers.yml file

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>
@dstebila

Copy link
Copy Markdown
Member

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.

@dstebila

Copy link
Copy Markdown
Member

Also, as far as I can tell the notifications get triggered when a Docker file increments LABEL version, but it seems like we haven't been fully reliable about bumping those when we've done updates in this repository.

@jplomas

jplomas commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

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.

TIL...

Thanks, that's a useful point-out. I'll refactor this week (hopefully).

@ryjones

ryjones commented Jul 26, 2026

Copy link
Copy Markdown

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.

@jplomas

jplomas commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Also, as far as I can tell the notifications get triggered when a Docker file increments LABEL version, but it seems like we haven't been fully reliable about bumping those when we've done updates in this repository.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants