Skip to content

fix: resolve draft releases in promote-release validation#510

Merged
c-vigo merged 2 commits intodevfrom
bugfix/507-promote-release-draft-release-api
Apr 9, 2026
Merged

fix: resolve draft releases in promote-release validation#510
c-vigo merged 2 commits intodevfrom
bugfix/507-promote-release-draft-release-api

Conversation

@c-vigo
Copy link
Copy Markdown
Contributor

@c-vigo c-vigo commented Apr 9, 2026

Description

The promote-release validate step queried GET /repos/{owner}/{repo}/releases/tags/{tag}, which does not return draft releases (404). The workflow now uses the paginated releases list API and jq to select the release by tag_name, so draft releases created by release.yml are found. The RC git tag cleanup step uses the same lookup so “release exists” stays correct for drafts if they ever apply.

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 — Draft release verification and RC tag cleanup use gh api …/releases --paginate with jq to match tag_name instead of the per-tag endpoint.
  • assets/workspace/.github/workflows/promote-release.yml — Same behavior for the downstream template.
  • CHANGELOG.md — Unreleased Fixed entry for [BUG] promote-release validate step uses API endpoint that cannot find draft releases #507.
  • assets/workspace/.devcontainer/CHANGELOG.md — Synced copy of the changelog entry (manifest sync).

Changelog Entry

Fixed

  • Promote-release draft release validation (#507)
    • Use the paginated releases list API with jq instead of GET /releases/tags/{tag}, which returns 404 for draft releases
    • Apply the same release lookup for RC git tag cleanup in upstream and workspace promote-release.yml

Testing

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

Manual Testing Details

N/A — workflow-only change; not exercised locally against GitHub. Pre-commit (yaml/yamllint) passed on commit.

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: #507

@c-vigo c-vigo self-assigned this Apr 9, 2026
@c-vigo c-vigo requested a review from Copilot April 9, 2026 13:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes promote-release validation failing to find draft GitHub Releases by switching from the per-tag release endpoint (which 404s for drafts) to a releases list lookup, and applies the same lookup to RC-tag cleanup for consistency.

Changes:

  • Update upstream promote-release.yml to locate releases via gh api .../releases --paginate and select by tag_name.
  • Apply the same change to the workspace template workflow.
  • Add an Unreleased changelog entry (and synced devcontainer copy) referencing #507.

Reviewed changes

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

File Description
.github/workflows/promote-release.yml Changes draft-release verification and RC tag cleanup to use list-releases lookup by tag_name.
assets/workspace/.github/workflows/promote-release.yml Mirrors the upstream workflow fix in the workspace template.
CHANGELOG.md Adds Unreleased “Fixed” entry for #507.
assets/workspace/.devcontainer/CHANGELOG.md Syncs the same changelog entry into the workspace devcontainer copy.

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

Comment thread .github/workflows/promote-release.yml Outdated
Comment thread assets/workspace/.github/workflows/promote-release.yml Outdated
Comment thread .github/workflows/promote-release.yml Outdated
Comment thread assets/workspace/.github/workflows/promote-release.yml Outdated
gh api does not support --arg (that is a jq flag). Split the call into
gh api --paginate followed by piped jq -s --arg. In the RC tag cleanup
steps, distinguish API failure (skip deletion with warning) from
confirmed "no release" (proceed with deletion).

Refs: #507
@c-vigo c-vigo merged commit b09bde7 into dev Apr 9, 2026
11 checks passed
@c-vigo c-vigo deleted the bugfix/507-promote-release-draft-release-api branch April 9, 2026 14:35
c-vigo added a commit that referenced this pull request Apr 10, 2026
## Description

Updates the smoke-test `repository-dispatch` workflow so **final**
releases dispatch downstream `promote-release.yml` (publish draft
release, merge release PR, RC tag cleanup) instead of merging the
release PR from the listener alone. **RC** dispatches wait for required
checks on the release PR and stop with the PR left open. Preflight now
requires `promote-release.yml` on the `dev` ref. Cross-repo gate docs
describe the split behavior and that the canonical flow no longer needs
a manual publish on smoke-test before upstream promote.

## 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
- [x] `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

- `assets/smoke-test/.github/workflows/repository-dispatch.yml`
  - Add `promote-release.yml` to preflight `REQUIRED_WORKFLOWS`.
- Replace `merge-release-pr` with `wait-release-pr-ci` (`gh pr checks
--required`, fail/cancel handling, 30m timeout).
- Add `trigger-promote-release` for `release_kind == final` only:
dispatch and poll `promote-release.yml` on `dev` with `version` = base
semver.
- Update `summary` / `notify-failure` dependencies and result checks
(final requires promote success; candidate requires promote skipped).
- `docs/CROSS_REPO_RELEASE_GATE.md` — contract, receiver steps, promote
gate wording for automated downstream publish.
- `CHANGELOG.md` and `assets/workspace/.devcontainer/CHANGELOG.md` —
Unreleased **Changed** entry for #511.

## Changelog Entry

```diff
@@ -27,6 +27,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - **Sync workflows run in devcontainer image** ([#509](#509))
   - `sync-issues` and `sync-main-to-dev` use `resolve-image` and run inside the pinned devcontainer, removing the `setup-env` composite action dependency and the inlined retry helper
   - `sync-main-to-dev` creates sync branches via `git push` instead of the GitHub refs API
+- **Smoke-test dispatch triggers promote-release for final releases** ([#511](#511))
+  - Final releases dispatch downstream `promote-release.yml` instead of merging the release PR directly, publishing the draft GitHub Release and satisfying the upstream promote-time downstream gate
+  - RC releases wait for release PR required checks but no longer merge the PR to `main`
 
 ### Deprecated
```

## Testing

- [ ] Tests pass locally (`just test`)
- [ ] Manual testing performed (describe below)

### Manual Testing Details

N/A — GitHub Actions workflow and documentation only; end-to-end
validation happens after the template is deployed to
`vig-os/devcontainer-smoke-test` (see issue prerequisite: PR #510 merged
there).

## Checklist

- [x] My code follows the project's style guidelines
- [x] 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`)
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and
pasted the entry above)
- [x] 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: #511
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