Skip to content

docs: describe services with several images - #85

Merged
uniqueg merged 4 commits into
devfrom
docs/4-multiple-images
Nov 7, 2026
Merged

uniqueg merged 4 commits into
devfrom
docs/4-multiple-images

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Documents how services with several images are upgraded. Pubgrade keeps one notification per built image ({image_name, tag}); a listener matches by image repository. Pubgrade-Sidecar (since elixir-cloud-aai/Pubgrade-Sidecar#40, closing elixir-cloud-aai/Pubgrade-Sidecar#39) updates every container in its namespace whose image repository equals image_name, optionally limited to deployments with a label.

  • docs/usage.md: new section "Services with several images", plus a note on what listeners do with a notification
  • pubgrade/api/pubgrade.yaml: callback and NotificationRequest.image_name descriptions (matching by image repository, one notification per image); descriptions only, no schema change
  • external/pubgrade-sidecar: bumped to the merge of Pubgrade-Sidecar PR 40, so that the included sidecar docs describe the new behaviour

Closes #4

Light lane: docs, OpenAPI descriptions and a submodule bump only; no code or schema change. I reviewed the diff myself.

Verification

  • mkdocs build --strict with the bumped submodule: clean

  • pytest --cov: 597 passed, 100% coverage

  • CI: all checks passed (incl. Docs, Read the Docs build, Upgrade test, image scans)

  • Sourcery: 2 findings; subscribing once per Pubgrade repository (not per image) fixed in 7dedcf1, which also documents how many images a build publishes (a prebuilt image is the only entry of images; with builds on, only the first entry counts; 14c9733)

Declined review findings

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Document independent notification and rollout behavior for services that use several container images.

Enhancements:

  • Document how services composed of multiple images are published, notified, and upgraded independently by matching notifications to image repositories.
  • Clarify that listeners should subscribe once per Pubgrade repository and update all matching containers while leaving other images unchanged.

Documentation:

  • Expand usage documentation with guidance for services containing several images and describe the corresponding Pubgrade-Sidecar behavior.

Chores:

  • Update the Pubgrade-Sidecar reference to include support for upgrading all matching containers.
  • Improve OpenAPI descriptions for per-image notifications, image repository matching, and multi-image build semantics.

uniqueg and others added 2 commits November 7, 2026 21:33
Document that each notification names one image and that subscribers
match notifications by image repository: a listener updates every
container whose image repository equals image_name, as
Pubgrade-Sidecar does with PUT /deployment, optionally limited to
deployments with a label. Describe this in the notification callback
of the API as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bump Pubgrade-Sidecar to the merge of its PR 40, whose docs describe
updates of all containers of an image repository.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Clarify in the OpenAPI contract that notifications name one image and subscribers match by image repository, and specify which containers a notification updates.

  • pubgrade/api/pubgrade.yaml L595-599, L1118-1120, L1169-1171

Documentation

Explain how listeners and Pubgrade-Sidecar handle services with several images, including subscription scope and per-image rollouts.

  • docs/usage.md L109-110, L121-152

Lock files and vendored code

Bump the Pubgrade-Sidecar submodule to include its documentation of updating containers by image repository.

  • external/pubgrade-sidecar L1

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 Pubgrade | 🛠️ Build #35724654 | 📁 Comparing 14c9733 against latest (169b82c)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (169b82c) to head (14c9733).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #85   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1471      1471           
=========================================
  Hits          1471      1471           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 7, 2026 21:18
@uniqueg
uniqueg requested a review from akash2237778 as a code owner November 7, 2026 21:18

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/usage.md" line_range="136-137" />
<code_context>
+Pubgrade-Sidecar does this with `PUT /deployment`: in every Deployment it
+manages (its `targetDeployments`, optionally only those with the label
+`deploymentLabel`), it updates every container of the notified image
+repository. Subscribe its callback URL `<sidecar URL>/deployment` once per
+image repository, i.e., to each repository of the service that publishes an
+image (see the sidecar's [API](sidecar/api.md) and
+[Deployment](sidecar/deployment.md)). `PUT /deployment/<deployment name>`
</code_context>
<issue_to_address>
**Sidecars receive duplicate updates**

When one source repository publishes multiple image repositories and a user follows the instruction to subscribe once per image repository, pubgrade subscriptions target the source repository, not image repositories, and each matching build triggers every subscription; the sidecar therefore receives repeated callbacks and performs redundant deployment updates.

Instruct users to subscribe once per source repository rather than once per image repository.
</issue_to_address>

### Comment 2
<location path="pubgrade/api/pubgrade.yaml" line_range="595-596" />
<code_context>
                 aren't followed. A subscriber that takes longer answers at
                 once (e.g., with 202) and acts in the background, as
-                Pubgrade-Sidecar does.
+                Pubgrade-Sidecar does. Each call names one image; a service
+                with several images gets one call per published image.
+                Subscribers match calls by image repository and update
+                every container whose image repository equals `image_name`
</code_context>
<issue_to_address>
**Multi-image callback payload**

The issue asks for the callback schema to handle multiple images in a broker request, but the change specifies one image per call and one call per published image. The schema still accepts only one `image_name` and `tag` pair, so it does not describe a multi-image payload.
</issue_to_address>

Linked issues

#4 How to handle multiple Docker images in single service · 1 of 2 met

# Requirement Status Notes
1 Handle multiple images in a broker callback request. 🟡 Partly met The change describes handling a multi-image service through separate one-image notifications; the callback request schema still contains only one image_name and tag.
2 Allow deployments to identify which pod or deployment should be updated with which image. ✅ Met The documentation says the sidecar updates containers matching the notified image repository, optionally limiting the managed Deployments by label.

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: docs/usage.md:137, pubgrade/api/pubgrade.yaml:596


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/usage.md Resolved
Comment thread pubgrade/api/pubgrade.yaml Resolved
Subscriptions belong to Pubgrade repositories, so a callback subscribed
twice to one repository gets every notification twice. Also say that a
build publishes only the first entry of `images`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Linked issues

#4 How to handle multiple Docker images in single service · 1 of 2 met

# Requirement Status Notes
1 Handle multiple images in one callback request ❌ Not addressed The callback still names one image and tag; the docs direct publishers to send further images as separate builds.
2 Identify which deployment or pod should use each image ✅ Met The documented behavior matches containers by image repository and updates every match, optionally limiting the deployments.

Comment thread pubgrade/api/pubgrade.yaml Resolved
A prebuilt image must be the only entry of `images`; only with builds
on are further entries ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 579c4f0 into dev Nov 7, 2026
35 of 46 checks passed
@uniqueg
uniqueg deleted the docs/4-multiple-images branch November 7, 2026 21:38
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.

How to handle multiple Docker images in single service

1 participant