Skip to content

[FEATURE] promote-release: generalise candidate tag cleanup to the configured pre-release format #1749

Closed

Description

@gerchowl

Description

promote-release.yml's best-effort cleanup only prunes candidate tags matching <prefix>X.Y.Z-rc[0-9]+ with no GitHub Release. Since #1746 a repo can publish candidates in any pre-release format (DEVKIT_PRERELEASE_FORMAT, e.g. alpha.{N}), and those tags are never cleaned up.

Problem Statement

A repo on alpha.{N} accumulates vX.Y.Z-alpha.N tags forever, while an rc{N} repo gets them pruned at promote. The cleanup is harmless when it misses (it never deletes anything unexpected), but the behaviour silently differs by format.

Proposed Solution

  • Thread the resolved pre-release format (resolve-toolchain's prerelease-format output) into the promote cleanup and derive the tag pattern from it — reuse release-version's format parsing (for example a --list-pattern mode) instead of a second hand-rolled regex.
  • Decide the policy for tags of a previous format of the same X.Y.Z (a mid-series label switch): prune them too, or leave them.
  • Keep the existing guard: only tags with no GitHub Release are ever deleted.

Alternatives Considered

  • Prune every <prefix>X.Y.Z-* tag without a Release: simpler, but deletes tags from formats the repo never configured.

Additional Context

Impact

Promote-time cleanup only; no change for rc{N} repos.

Changelog Category

Changed

Activity

  1. added
    feature
    on Sep 28, 2026
  2. c-vigo commented on Oct 1, 2026

    @c-vigo
    Contributor

    Resolved by #1802 (merged to dev, ships with the next release): the scaffolded promote cleanup derives its tag match from the resolved DEVKIT_PRERELEASE_FORMAT via the new release-version --list-pattern (POSIX ERE, passed to jq with --arg). Policy: tags of a previously configured format for the same X.Y.Z are left alone; only tags with no GitHub Release are ever deleted. Devkit's own promote-release keeps literal rc{N} (it sets no format and also prunes per-arch image tags).

  3. added a commit that references this issue on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions