Skip to content

fix(promote-charms): verify all revision tags on target commit are provided - #381

Open
xhon-pelushi wants to merge 1 commit into
canonical:mainfrom
xhon-pelushi:fix/369-promote-charms-tag-completeness
Open

xhon-pelushi wants to merge 1 commit into
canonical:mainfrom
xhon-pelushi:fix/369-promote-charms-tag-completeness

Conversation

@xhon-pelushi

Copy link
Copy Markdown

Fixes #369

_parse_revision_tags only validated that at least one revision tag was
provided per charm found in the repo. It didn't check whether the
resolved commit had other revision tags (e.g. a second build/arch
revision for the same charm) that were silently left out of the
revisions input — the "amd64 provided, arm64 not" scenario raised in
#366 (discussion_r3137318781).

This adds a check that diffs revision tags found on the resolved commit
against the revisions input, and fails before promoting if any are
missing, so a partial promotion can't happen by mistake.

Test plan

  • Verified the tag-diffing logic against a real temporary git repo
    (two revision tags on one commit, one on another): a partial
    promotion input correctly flags the missing tag; a complete input
    passes with nothing flagged.
  • ruff check (project's own pyproject.toml config) — no new
    findings introduced by this change.
  • Not run through the actual promote-charms entry point end-to-end
    (needs charmcraft + live Charmhub access).

…ovided

Only checking that at least one tag per charm was passed let a partial
promotion slip through: if a commit produced more than one revision tag
for the same charm (e.g. separate amd64/arm64 revisions), promoting a
subset would leave the missed revision behind on the lower channel.

Diff revision tags found on the resolved commit against the `revisions`
input and fail before promoting if any are missing.

Closes canonical#369

Signed-off-by: xhon-pelushi <xhon@pelushi.com>
@xhon-pelushi
xhon-pelushi requested a review from zmraul as a code owner August 15, 2026 22:31
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.

Improve checks on _promote_charms action

1 participant