Skip to content

ci: downstream promote-release, GHCR cleanup, and RC prune - #472

Merged
c-vigo merged 9 commits into
devfrom
feature/463-prune-stale-ghcr-tags
Mar 27, 2026
Merged

c-vigo merged 9 commits into
devfrom
feature/463-prune-stale-ghcr-tags

Conversation

@c-vigo

@c-vigo c-vigo commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Implements issue #463: downstream promote-release.yml workspace template paired with root promote-release, optional create-release for candidate runs (wired through smoke-test dispatch and just publish-candidate), best-effort GHCR and git RC cleanup in root promote-release.yml after merge, documentation updates (RELEASE_CYCLE, DOWNSTREAM_RELEASE, CROSS_REPO_RELEASE_GATE), and removal of the dead downstream RC gate from upstream release.yml (final verification lives in promote-release). Adds BATS/integration coverage for promote-release and create-release.

Stale RC and sha256-*-only package versions are pruned only via the promote workflow (org Packages API); there is no checked-in manual prune script.

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

  • .github/workflows/promote-release.yml — cleanup job: GHCR RC + sha256-*-only orphans (paginated listing merged with jq -s 'add // []'), remote git RC tags without a GitHub Release; continues on error.
  • .github/workflows/release.yml — trim validate job; remove dead downstream RC gate steps.
  • assets/workspace/.github/workflows/promote-release.yml — new downstream template (validate, publish, merge, best-effort git RC cleanup).
  • assets/workspace/.github/workflows/release.yml / release-publish.yml — create-release input and conditional draft pre-release for candidates.
  • assets/smoke-test/.github/workflows/repository-dispatch.yml — pass create-release=true for downstream candidate dispatch.
  • justfile.gh, assets/workspace/.devcontainer/justfile.gh — forward create-release; GitHub recipe import pattern.
  • scripts/manifest.toml — manifest updates for workspace assets where applicable.
  • CHANGELOG.md (synced to assets/workspace/.devcontainer/CHANGELOG.md) — Unreleased entries ([CHORE] Prune stale RC and sha256 tags from GHCR #463 and related unreleased items).
  • docs/RELEASE_CYCLE.md, docs/DOWNSTREAM_RELEASE.md, docs/CROSS_REPO_RELEASE_GATE.md — release flow and permissions.
  • README.md, CONTRIBUTE.md — minor doc sync.
  • tests/bats/just.bats, tests/test_integration.py — promote-release / create-release assertions.

Changelog Entry

## Unreleased

### Added

- **Downstream `promote-release.yml` workspace template** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Add `assets/workspace/.github/workflows/promote-release.yml` as the counter-party to root `promote-release.yml`: validate draft release and release PR, publish the release, merge to `main`, best-effort git RC tag cleanup (no GHCR/cosign/smoke-test gate)
  - Document in `docs/DOWNSTREAM_RELEASE.md` and align `docs/RELEASE_CYCLE.md` Phase 5 for consumer vs upstream paths
- **Optional draft pre-release for downstream release candidates** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Workspace `release.yml` adds `create-release` (`workflow_dispatch`, default `false`); `release-publish.yml` creates a draft GitHub pre-release only when set for `candidate` runs
  - Smoke-test `repository-dispatch.yml` passes `create-release=true` when triggering downstream `release.yml`
  - `just publish-candidate` forwards `create-release` in `justfile.gh` and the workspace template copy

### Changed

- **RELEASE_APP permissions and GHCR cleanup token model** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Document Packages read/write on the org for `promote-release` cleanup, align the app table in `docs/RELEASE_CYCLE.md`, and explain why cleanup uses the GitHub App token instead of `GITHUB_TOKEN`
- **Promote-release cleans up stale RC artifacts after merge** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Best-effort job deletes GHCR package versions for `${VERSION}-rc*` and `sha256-*`-only orphans, and deletes remote git RC tags for that base version when no GitHub Release exists; does not fail the workflow on error
- **Downstream release helper recipes via GitHub justfile import** ([#373](https://github.com/vig-os/devcontainer/issues/373))
  - Move `prepare-release`, `finalize-release`, `publish-candidate`, and `reset-changelog` into `justfile.gh` so downstream workspace templates expose these release helpers by default
  - Keep root recipe availability (including `pull`) through `import 'justfile.gh'` while consolidating release helper ownership in the GitHub-focused recipe file; the workspace template copy omits the `pull` recipe
- **Split final release into publish and promote phases** ([#456](https://github.com/vig-os/devcontainer/issues/456))
  - Final `release.yml` publishes versioned GHCR tags and a draft GitHub Release but no longer updates `:latest`
  - New `promote-release.yml` runs after downstream smoke-test publishes its final release: updates `:latest`, publishes the draft release, merges the release PR to `main`
  - Add `just promote-release` in `justfile.gh` (and workspace template copy)
- **Smoke-test dispatch fails fast when deploy PR checks fail** ([#381](https://github.com/vig-os/devcontainer/issues/381))
  - `wait-deploy-merge` in `assets/smoke-test/.github/workflows/repository-dispatch.yml` exits as soon as all required checks have completed with failures instead of waiting for the merge poll timeout (`gh pr checks --required`)

### Deprecated

### Removed

- **One-time GHCR/git RC prune script** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Remove `scripts/prune-ghcr-tags.sh`; RC and `sha256-*` orphan cleanup remains in root `promote-release.yml`
- **Downstream RC pre-release gate from release validate job** ([#463](https://github.com/vig-os/devcontainer/issues/463))
  - Removed dead `if: false` steps from `release.yml`; downstream final release is verified only in `promote-release.yml` before promote

### Fixed

- **Git commit now falls back to nano when editor config is unusable** ([#383](https://github.com/vig-os/devcontainer/issues/383))
  - `setup-git-conf.sh` now validates the effective Git editor and sets `core.editor=nano` only when the configured editor is missing or invalid in-container
  - Add integration regression coverage to ensure invalid editor settings are corrected during setup
- **Release finalize no longer races sync-issues; CHANGELOG TBD verified after reset** ([#455](https://github.com/vig-os/devcontainer/issues/455))
  - Run `sync-issues` after capturing finalize SHA so downstream build/publish use the finalized commit
  - Fail finalize if `CHANGELOG.md` still contains `## [version] - TBD` after `git reset --hard`
- **generate-docs pre-commit runs when CHANGELOG.md changes** ([#455](https://github.com/vig-os/devcontainer/issues/455))
  - Keeps README "Latest Version" and other generated docs aligned with the changelog
- **prepare-release tolerates GitHub API ref propagation and reliable CHANGELOG rollback** ([#453](https://github.com/vig-os/devcontainer/issues/453))
  - Poll until the new release branch ref resolves before `commit-action` commits to it
  - Fetch dev `CHANGELOG.md` by resolved commit SHA during rollback so Contents API staleness does not skip the rollback commit
- **sync-main-to-dev sync job no longer depends on dev's setup-env** ([#459](https://github.com/vig-os/devcontainer/issues/459))
  - Inline the same `retry` shell helper used by `setup-env` so the job works when `main`'s workflow expects helpers not yet on `dev`

### Security

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A (CI and release behavior validated via automated tests; no manual workflow runs in this session).

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

N/A

Refs: #463

@c-vigo c-vigo self-assigned this Mar 27, 2026
@c-vigo
c-vigo requested a review from Copilot March 27, 2026 15:32

Copilot AI 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.

Pull request overview

Implements issue #463 by extending the release pipeline with a downstream promote-release.yml template, optional draft pre-release creation for candidate runs, and automated/manual RC artifact pruning. This fits into the repo’s split publish/promote release architecture (publish produces artifacts + draft release; promote publishes/merges and performs cleanup).

Changes:

  • Add downstream workspace promote-release.yml workflow and wire candidate create-release option through dispatch and just publish-candidate.
  • Add RC cleanup capabilities: upstream promote cleanup job + new one-time manual scripts/prune-ghcr-tags.sh.
  • Update tests and docs/changelogs to reflect the new promote flow and removal of the old downstream RC gate from upstream release.yml.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_integration.py Updates template assertions for new/removed release-helper behaviors and create-release forwarding.
tests/bats/just.bats Adjusts recipe signature checks and adds coverage for downstream promote-release.yml template wiring.
scripts/prune-ghcr-tags.sh Adds a manual, dry-run-by-default GHCR/git RC prune utility.
scripts/manifest.toml Updates workspace sync transforms for downstream-friendly release helper text/behavior and removes pull block.
justfile.gh Extends publish-candidate recipe to forward create-release.
docs/RELEASE_CYCLE.md Documents promote-time gating/cleanup and token/permissions model changes.
docs/DOWNSTREAM_RELEASE.md Documents downstream promote workflow and candidate create-release option.
docs/CROSS_REPO_RELEASE_GATE.md Updates gate enforcement documentation to reflect promote-time validation ownership.
assets/workspace/CHANGELOG.md Adds workspace template changelog entries for downstream promote workflow.
assets/workspace/.github/workflows/release.yml Adds create-release input and passes it to publish workflow.
assets/workspace/.github/workflows/release-publish.yml Adds create_release input and conditionally creates draft pre-release for candidates.
assets/workspace/.github/workflows/promote-release.yml Introduces downstream promote workflow (validate → publish release → merge → best-effort RC git tag cleanup).
assets/workspace/.devcontainer/justfile.gh Updates downstream-shipped release helper recipes (incl. create-release forwarding; removes pull).
assets/workspace/.devcontainer/CHANGELOG.md Mirrors root changelog updates into the workspace devcontainer template copy.
assets/smoke-test/.github/workflows/repository-dispatch.yml Passes create-release=true when orchestrating downstream candidate runs.
README.md Updates documented publish-candidate recipe signature to include create-release.
CONTRIBUTE.md Updates documented publish-candidate recipe signature to include create-release.
CHANGELOG.md Adds unreleased entries for downstream promote template, candidate draft pre-release option, and prune script.
.github/workflows/release.yml Removes dead downstream RC gate steps from upstream release validate job.
.github/workflows/promote-release.yml Adds upstream promote cleanup job for GHCR RC + sha256-orphan package versions and RC git tags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/promote-release.yml Resolved
Comment thread scripts/prune-ghcr-tags.sh Resolved
Comment thread scripts/prune-ghcr-tags.sh Resolved
Comment thread CHANGELOG.md Resolved

Copilot AI 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.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/DOWNSTREAM_RELEASE.md Resolved
@c-vigo
c-vigo enabled auto-merge March 27, 2026 16:17
@c-vigo
c-vigo merged commit f695f47 into dev Mar 27, 2026
11 checks passed
@c-vigo
c-vigo deleted the feature/463-prune-stale-ghcr-tags branch March 27, 2026 16:26
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.

2 participants