Skip to content

F2: cut-release.sh learns v<major>-<tier> channels [#657] #1184

Closed

Description

@don-petry

Phase F2 of the major-scoped-channels epic #657 (Option 1 decided 2026-07-13; model documented in agentic-release-strategy.md via F1). Teach cut-release.sh the v<major>-<tier> channel model. .github-private only — no .github tooling change here.

Context

Today (scripts/cut-release.sh): channel_ref(agent, channel) = <agent>/<channel> and --channel <tier> moves <agent>/<tier> to the new <agent>/vX.Y.Z release. The tiers are next/ring0/ring1/stable.

Change

Introduce major-scoped channel names: --channel values become v<MAJOR>-<tier> (e.g. v1-stable, v2-next). Derive <MAJOR> from the <version> arg's major component when the caller passes a bare tier, OR accept the fully-qualified v<M>-<tier> directly.

  • channel_ref (or a new resolver): given <agent> <version> <tier>, emit <agent>/v<major(version)>-<tier>. When --channel is already v<M>-<tier>, pass through; when it's a bare tier (stable), prefix with v<major(version)>-.
  • --promote --channel <tier> moves <agent>/v<major>-<tier> (within the release's major).
  • Keep immutable <agent>/vX.Y.Z release tags exactly as-is.
  • Update the usage/header examples to the v<M>-<tier> form.
  • Preserve the App-token gh-api path for protected channel moves (GH013 avoidance).

Tests

  • cut-release.sh <agent> 2.0.0 --channel stable --dry-run → plans a move of <agent>/v2-stable (not <agent>/stable).
  • explicit --channel v1-ring0 passes through unchanged.
  • release tag <agent>/v2.0.0 still created.
  • bump of major is reflected in the channel prefix (1.x → v1-, 2.x → v2-).

Out of scope

F3 ring-pins.sh (.github), F4 engine, F5 audit/drift + live migration + consumer re-pins. Backward-compat with existing bare-tier channels is handled at migration time (F5), not here — F2 just makes the tool capable of the new names.

Acceptance

  • cut-release.sh cuts/promotes v<major>-<tier> channels, deriving the major from the version; release tags unchanged; usage docs updated; tests green.

Activity

  1. github-actions commented on Jul 13, 2026

    @github-actions
    Contributor

    Thanks for the detailed spec and for linking this back to the F1 decision — really helpful context! One clarifying question: should cut-release.sh emit a warning (or hard error) when a bare tier like stable is passed without a version argument, since the major prefix can't be derived in that case, or is the version argument already required/guaranteed by existing usage?

  2. don-petry commented on Jul 13, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead Implementation Plan

    Issue: #1184 — F2: cut-release.sh learns v- channels [#657]

    Scope

    Teach scripts/cut-release.sh the major-scoped channel model: --channel <tier> resolves to <agent>/v<major(version)>-<tier>, while a fully-qualified v<M>-<tier> passes through unchanged. Immutable <agent>/vX.Y.Z release tags and the App-token gh-api path are untouched.

    Implementation Checklist

    • Add major_of <version> pure helper (extracts MAJOR from MAJOR.MINOR.PATCH)
    • Change channel_ref to channel_ref <agent> <version> <channel>: bare tier → <agent>/v<major>-<tier>; v<M>-<tier> → pass through
    • Update the single channel_ref call site in main() to pass $version
    • Update usage/header examples to the v<M>-<tier> form; add major_of to the sourced-helpers list
    • Wire tests/test_cut_release_cross_repo.bats into lint.yml's bats list (currently omitted) so integration tests run in CI

    Tests to Write

    • Unit: major_of (1.2.3→1, 2.0.0→2, 12.4.37→12)
    • Unit: channel_ref bare tier prefixes major (dev-lead 2.0.0 stable → dev-lead/v2-stable)
    • Unit: channel_ref passes through explicit v1-ring0 unchanged
    • Unit: major bump reflected (1.x→v1-, 2.x→v2-)
    • Integration: dev-lead 2.0.0 --channel stable --dry-run plans move of dev-lead/v2-stable
    • Integration: explicit --channel v1-ring0 passes through
    • Integration: release tag <agent>/v2.0.0 still created on --push

    Test Command

    scripts/run-bats.sh tests/test_cut_release.bats tests/test_cut_release_cross_repo.bats and bash .dev-lead/scripts/dev-lead-lint.sh

  3. don-petry commented on Jul 13, 2026

    @don-petry
    CollaboratorAuthor

    Dev-Lead: Implementation Complete

    Plan Execution

    • Added major_of <version> pure helper (extracts MAJOR from MAJOR.MINOR.PATCH)
    • Changed channel_ref to channel_ref <agent> <version> <channel>: bare tier → <agent>/v<major>-<tier>; fully-qualified v<M>-<tier> passes through unchanged (its own major wins)
    • Updated the single channel_ref call site in main() to pass $version (covers both cut and --promote paths)
    • Kept immutable <agent>/vX.Y.Z release tags and the App-token gh-api path untouched
    • Updated usage/header examples + sourced-helpers list to the v<M>-<tier> form
    • Wired tests/test_cut_release_cross_repo.bats into lint.yml's bats list (it was previously omitted from CI)

    Test Results

    1..72
    ok 50 major_of: 1.2.3 is 1
    ok 51 major_of: 2.0.0 is 2
    ok 52 major_of: 12.4.37 is 12
    ok 45 channel_ref: dev-lead 2.0.0 stable -> dev-lead/v2-stable
    ok 48 channel_ref: explicit v<M>-<tier> passes through unchanged
    ok 53 channel_ref: major bump is reflected in the prefix (1.x -> v1-, 2.x -> v2-)
    ok 68 major-scoped: --channel stable derives v2- from version 2.0.0 (dry-run)
    ok 69 major-scoped: explicit --channel v1-ring0 passes through unchanged (dry-run)
    ok 70 major-scoped: bump of major is reflected in the channel prefix (1.x -> v1-)
    ok 71 major-scoped: release tag <agent>/v2.0.0 is still created on --push
    ok 72 major-scoped: --promote moves the major-scoped channel of the release's major
    

    All 72 tests pass across tests/test_cut_release.bats + tests/test_cut_release_cross_repo.bats.
    Repo lint (.dev-lead/scripts/dev-lead-lint.sh) passes: shellcheck clean on 80 files, agent profiles + CODEOWNERS OK.

    Files Changed

    • scripts/cut-release.sh: new major_of helper; channel_ref now major-scoped (3-arg); call site + usage/header docs updated. Release-tag creation, immutability guard, and the gh api App-token path are unchanged.
    • tests/test_cut_release.bats: major_of unit tests + rewritten channel_ref tests for the 3-arg major-scoped signature.
    • tests/test_cut_release_cross_repo.bats: existing channel assertions updated to major-scoped names; added acceptance tests (dry-run plans v2-stable; v1-ring0 passthrough; v2.0.0 release tag still created; --promote moves v2-ring1).
    • .github/workflows/lint.yml: added test_cut_release_cross_repo.bats to the bats run list so the integration path is CI-gated.

    Notes

    • Explicit v<M>-<tier> wins over the version's major — e.g. --channel v1-ring0 with version 2.0.0 pins v1-ring0, so a patch can be cut against an older major's ring without repointing it to the new major. This matches the F1 model (a bare tier is prefixed; a fully-qualified channel is authoritative).
    • Out of scope (per issue): F3 ring-pins.sh, F4 engine, F5 audit/drift + live migration + consumer re-pins. Backward-compat with existing bare-tier channels is an F5 migration concern; F2 only makes the tool capable of the new names.
    • The stale harness copy .dev-lead/scripts/cut-release.sh was intentionally not modified — it is a frozen snapshot already out of sync and is not linted/sourced by the repo's checks (only scripts/**/*.sh is).
  4. added a commit that references this issue on Jul 13, 2026
  5. added 8 commits that reference this issue on Aug 2, 2026
  6. 4 remaining items

  7. added 13 commits that reference this issue on Aug 7, 2026
  8. added 2 commits that reference this issue on Aug 19, 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

    dev-leadFor dev-lead agent pickupenhancementFeature requests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions