fix(release): wait via list+filter and self-heal missing draft#439
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Hardens the Wait for draft release to be visible step in the publish workflow after observations that gh release view was returning 404 on freshly created drafts (causing v4.7.0/v4.7.1 to publish with 0 assets and v4.7.2 to remain in draft). Switches to a list+filter strategy via the REST GET /releases endpoint, doubles the poll window, and adds a self-heal fallback that creates the draft if the wait expires.
Changes:
- Replace
gh release view "$TAG"polling withgh api repos/$REPO/releases?per_page=100filtered by tag name through--jq. - Increase poll attempts from 30 to 60 (≈150s → ≈300s window).
- On timeout, downgrade the error to a warning and create the draft release inline (
gh release create --draft ...) instead of failing the job.
Comments suppressed due to low confidence (1)
.github/workflows/publish.yml:145
2>/dev/nullswallows all errors from thegh apicall inside the loop. If authentication is wrong, the token lacks scope, the network is failing, or the API is returning 5xx, the loop will silently iterate all 60 times producing only the generic "not yet visible" message before eventually self-healing — which itself may then fail for the same reason. Consider capturing stderr and emitting it (perhaps only on the final attempts, or every Nth iteration) so the actual root cause is visible in the workflow log instead of being hidden behind a 5-minute timeout.
ID=$(gh api "repos/$REPO/releases?per_page=100" \
--jq ".[] | select(.tag_name == \"$TAG\") | .id" 2>/dev/null \
| head -n1)
Comment on lines
+153
to
+159
| echo "::warning::Release $TAG never appeared after 300s — creating it now as self-heal" | ||
| gh release create "$TAG" \ | ||
| --draft \ | ||
| --title "$TAG" \ | ||
| --notes "Release notes will be filled by the post-publish step." \ | ||
| --target "${{ github.sha }}" | ||
| echo "Created draft release $TAG via self-heal" |
| gh release create "$TAG" \ | ||
| --draft \ | ||
| --title "$TAG" \ | ||
| --notes "Release notes will be filled by the post-publish step." \ |
Comment on lines
+143
to
+145
| ID=$(gh api "repos/$REPO/releases?per_page=100" \ | ||
| --jq ".[] | select(.tag_name == \"$TAG\") | .id" 2>/dev/null \ | ||
| | head -n1) |
Comment on lines
+143
to
+144
| ID=$(gh api "repos/$REPO/releases?per_page=100" \ | ||
| --jq ".[] | select(.tag_name == \"$TAG\") | .id" 2>/dev/null \ |
Comment on lines
+137
to
+138
| # ferrflow's create_release call in CI silently warned-and- | ||
| # continued (see monorepo.rs:1339, follow-up filed at #439-fix). |
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: f7da982 | Previous: 0b5fe57 | Ratio |
|---|---|---|---|
full_check_flow/100_commits |
2769876 ns/iter (± 12948) |
||
full_check_flow/1000_commits |
28101813 ns/iter (± 216289) |
This comment was automatically generated by workflow using github-action-benchmark.
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Wait for draft release to be visiblestep in.github/workflows/publish.ymlhas been silently breaking the release pipeline since #438 (v4.7.0). v4.7.0 and v4.7.1 published with 0 assets; v4.7.2 stayed in draft state. Downstream consumers (FerrLabs/FerrFlow@v4resolving toreleases/latest/download/ferrflow-linux-x64.tar.gz) hit 404 — FerrGames-Cloud has 10 PRs sitting on main since 2026-05-13T17:22 with no release because of this.Root cause
The wait step polled
gh release view "$TAG"which, in the v4.7.2 Publish run, returned 404 for the freshly-created draft despite the draft existing in the GitHub UI. Verified locally:gh release view v4.7.2 --repo FerrLabs/FerrFlowfinds the draft,gh api .../releases/tags/v4.7.2returns 404 (the REST endpoint excludes drafts entirely). The CLI behavior in the runner appears version-skewed.Compounding bug:
monorepo.rs:1339swallowscreate_releasefailures as warnings, so a transient API error duringferrflow release --draftlets the workflow push the tag without ever creating the release. Filed as a follow-up in the comment.Fix
gh api /releases?per_page=100 --jq '.[] | select(.tag_name == "$TAG") | .id'— the only stable surface that lists drafts when authenticated.Test plan
https://github.com/FerrLabs/FerrFlow/releases/latest/download/ferrflow-linux-x64.tar.gzreturns 200