Skip to content

feat: pluggable pre-release format, draft-first Release owner and publish seam for the release train - #1750

Merged
gerchowl merged 19 commits into
devfrom
feature/1746-rust-release-extension-seams
Sep 28, 2026
Merged

gerchowl merged 19 commits into
devfrom
feature/1746-rust-release-extension-seams

Conversation

@gerchowl

@gerchowl gerchowl commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Description

Makes Rust (and Rust+Python) repos first-class on the release train without making the train Rust-aware. It adds three language-neutral seams from #1746:

  1. Pluggable pre-release format. Candidates can be tagged X.Y.Z-alpha.1, -beta, -nightly.YYYYMMDD.N and so on. The format resolves with precedence dispatch input > .vig-os DEVKIT_PRERELEASE_FORMAT > rc{N}. The default reproduces today's X.Y.Z-rcN byte for byte. A format switch that would sort below an existing pre-release of the same X.Y.Z is refused.
  2. Draft-Release-first owner contract. release-publish.yml creates the draft (--target <finalize_sha>) before the tag ref, so tag-triggered asset workflows always find a draft to upload into. That period is the documented "pre-publish assets window". A failed tag push discards the orphan draft, and promote-release.yml stays the only publisher.
  3. Standalone publish-release-extension.yml seam. A preserved, default no-op workflow on release: published, plus a workflow_dispatch tag retry, for irreversible publishes (crates.io, PyPI, registries). It is standalone so Trusted Publishing's OIDC subject binds to its own path. It is deny-by-default, with the id-token: write and environment: opt-ins seeded as comments.

Two corrections to the issue text (details in this comment):

  • The issue's cargo-dist recipe does not work. With create-release = false, cargo-dist uploads into the draft and then undrafts it itself under GITHUB_TOKEN. That bypasses promote, makes the Release immutable before late assets land, and never fires release: published. The documented recipe instead uses cargo-dist as an asset builder (hosting = ["github"], no generated CI) plus a consumer tag-push workflow that uploads into the draft.
  • The default is rc{N}, not rc.{N}. Only rc{N} meets the byte-identical acceptance criterion.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • packages/vig-utils/src/vig_utils/release_version.py (+ pyproject.toml script, README): new release-version CLI.
    • Validates the format ({N}, {YYYYMMDD}, SemVer charset, valid pre-release expansion).
    • Discovers the counter per format; {N} in a dated format restarts per day.
    • Monotonicity gate: a format's own tags rank by counter (SemVer ranks rc10 below rc9), while other formats compare by SemVer precedence. An existing final X.Y.Z only warns, which keeps the forward-fix path after a failed final open.
  • assets/workspace/.github/workflows/release.yml: new pre-release-format dispatch input, threaded with the documented precedence.
  • assets/workspace/.github/workflows/release-core.yml: new pre_release_format input; Compute publish version now delegates to release-version and lists <prefix>X.Y.Z plus <prefix>X.Y.Z-*.
  • assets/workspace/.github/actions/resolve-toolchain/action.yml, assets/workspace/.vig-os, assets/init-workspace.sh: new DEVKIT_PRERELEASE_FORMAT key, resolved into a prerelease-format output and persisted across re-scaffolds.
  • assets/workspace/.github/workflows/release-publish.yml: release notes, then the draft (--target, no --verify-tag), then the tag ref. New Discard orphan draft on tag failure step. It never deletes a published Release, and never deletes a pre-existing draft whose tag exists.
  • assets/workspace/.github/workflows/publish-release-extension.yml: new seed. init-workspace.sh adds it to PRESERVE_FILES and to the release feature group.
  • docs/DOWNSTREAM_RELEASE.md (+ scaffold mirror): new sections Pre-release format, Release owner and the pre-publish assets window, cargo-dist adopter recipe and Publish Extension Hook. docs/MIGRATION.md and docs/WORKFLOW_SECURITY.md now list the third seam.
  • Tests:
    • packages/vig-utils/tests/test_release_version.py
    • tests/test_release_prerelease_format.py: executes the real compute step against a stubbed git and the real CLI.
    • tests/test_release_publish_draft_first.py: executes the publish steps against a stateful gh/git fake, covering ordering, orphan cleanup and idempotent re-runs.
    • tests/test_workflow_publish_release_extension.py: executes the resolve step for both triggers; checks that promote publishes under the App token, and the scaffold ship/preserve/opt-out behaviour.
    • tests/test_vig_os_manifest.py

Changelog Entry

Added

  • Release train: pluggable pre-release format, draft-Release-first owner
    contract, and a standalone publish seam

    (#1746)
    • Candidates can be tagged in any SemVer pre-release format, e.g. alpha.{N}
      for v0.1.0-alpha.1 ({N} counter, {YYYYMMDD} date). Precedence:
      release.yml input pre-release-format > .vig-os
      DEVKIT_PRERELEASE_FORMAT > rc{N}, which keeps today's X.Y.Z-rcN tags
      byte-identical. A format switch that would sort below an existing tag of
      the same X.Y.Z is refused. Computed by the new release-version
      vig-utils CLI
    • release-publish.yml now creates the draft GitHub Release before the tag
      ref, so tag-triggered asset workflows always find it (the "pre-publish
      assets window"); a failed tag push discards the orphan draft.
      promote-release.yml stays the only place a draft is published
    • New preserved, default no-op seam publish-release-extension.yml on
      release: published (plus a workflow_dispatch tag retry) for
      irreversible publishes such as crates.io or PyPI. It is standalone so
      Trusted Publishing binds to its own path
    • docs/DOWNSTREAM_RELEASE.md documents the contract and a cargo-dist
      recipe: cargo-dist builds the assets and a tag-push workflow uploads them
      into the train's draft, because create-release = false makes cargo-dist
      publish the draft itself

Testing

  • Tests pass locally (just test): 1343 passed; test_image, test_integration and the 17 TestInstallScriptIntegration cases need a locally built devcontainer:dev image and run in CI; BATS 611 ok
  • Manual testing performed (describe below)

Manual Testing Details

N/A for the train itself: no live release was cut. The workflow steps are covered by executing their real bash against stubs. I also ran release-version against this repo's real tags (git ls-remote origin 1.17.0 1.17.0-*). The cargo-dist behaviour was checked against its source at v0.32.0 (6886366) and HEAD.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Refs: #1746

Candidates are computed by the release-version CLI from a format selected
by dispatch input > .vig-os DEVKIT_PRERELEASE_FORMAT > rc{N}. The default
reproduces X.Y.Z-rcN; a format switch that would lower the ordering for
the same X.Y.Z is refused.

Refs: #1746
release-publish.yml now creates the draft against the finalize SHA and
POSTs the tag ref afterwards, so tag-triggered consumer workflows always
find the draft during the pre-publish assets window. A failed tag POST
discards the orphan draft this run created.

Refs: #1746
A preserved, default no-op workflow on release: published plus a
workflow_dispatch tag retry, for irreversible outward publishes after
promote. Standalone so Trusted Publishing binds to its own path; the
token stays contents: read with id-token and environment opt-ins
seeded as comments.

Refs: #1746
…g final tag

The monotonicity gate now blocks only lowering pre-release label
switches. An existing final X.Y.Z tag is the forward-fix recovery state
after a failed final run, so it produces a warning annotation.

Refs: #1746
Pins cargo-dist citations to a commit SHA.

Refs: #1746
@gerchowl gerchowl self-assigned this Sep 28, 2026
…II digits

A counterless or same-day dated format no longer silently recomputes an
existing candidate tag; {N} may not touch a digit or {YYYYMMDD}; digit
classes are ASCII-only.

Refs: #1746
A create whose response was lost is adopted on retry instead of minting
a second draft; releases are looked up in the release list since a
draft has no tag ref, and cleanup deletes every draft for the tag and
finalize target.

Refs: #1746
@gerchowl
gerchowl merged commit 084692e into dev Sep 28, 2026
15 checks passed
@gerchowl
gerchowl deleted the feature/1746-rust-release-extension-seams branch September 28, 2026 23:31
gerchowl added a commit that referenced this pull request Sep 28, 2026
Resolves the CHANGELOG conflict by keeping both Unreleased entries:
#1746's release-train seams and #1744's operator plugin. Devkit's own
release.yml did not conflict -- #1750 changed the SCAFFOLD copy under
assets/workspace/, so the plugin.json bump in the "Update root .vig-os"
step carried over untouched.

#1746's seams are merged now, so the plugin's claims about them were
stale in the wrong direction. Corrected:

- pack-rust's "what is still open" section becomes an audit of three
  shipped contracts: the pre-release format (precedence, the dotted-
  counter caveat because SemVer sorts rc10 below rc9, the sort-below
  refusal, and stray X.Y.Z-* tags now blocking candidates), the
  draft-first Release-owner contract with its pre-publish assets window,
  and the standalone publish seam on `release: published`.
- The cargo-dist guidance is taken from the merged
  docs/DOWNSTREAM_RELEASE.md, NOT from #1746's issue body: the proposed
  `create-release = false` plus `github-release = "host"` recipe is
  documented there as wrong, because cargo-dist uploads into the draft
  and then publishes it itself, bypassing promote and firing no
  `release: published` event. The supported shape is cargo-dist as an
  asset builder with no `ci` key, plus a consumer-owned tag-push upload.
- status no longer says DEVKIT_PRERELEASE_FORMAT is absent until #1746
  lands, and no longer claims a candidate never creates a Release object
  (`create-release: true` makes a draft pre-release).
- Only #1496's pack template layers remain open.

The drift gate now resolves publish-release-extension.yml against the
real scaffold file, so the seam is named rather than described in prose.

Refs: #1744
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.

1 participant