Skip to content

fix(publish-release): 🐛 wait for GitHub to list a draft created a moment ago - #127

Merged
robertodr merged 1 commit into
release/1.6from
backport-126-to-release/1.6
Nov 19, 2026
Merged

robertodr merged 1 commit into
release/1.6from
backport-126-to-release/1.6

Conversation

@algorithmiq-release-bot

Copy link
Copy Markdown
Contributor

Backport of #126 to release/1.6.

🤖 AI text below 🤖

Summary

Closes #125

The Publish run of v1.6.2 failed: publish-release listed the releases about 0.6 s after draft-release created the draft, found none for the tag, and stopped. The same listing showed the draft minutes later, and it was published by hand. GitHub's list of releases lags behind a new draft for a moment; it may also still show a draft that draft-release just deleted (a re-run), whose id then fails to publish.

  • publish-release now tries up to five times, waiting 2, 4, 8 and 16 s in between (about 30 s), while the listing doesn't show exactly one draft of the tag or publishing the draft it found fails. It logs each retry and fails with the same error after the last attempt (Found N draft releases of vX.Y.Z, expected exactly one. Run draft-release (again) first., or Could not publish the draft release <id> ...). A tag that is already published still needs nothing.
  • Tests: the fake gh can answer each listing differently, fail the publishing of given ids, and sleep only records its argument. New cases: a listing that shows the draft at the third attempt (the v1.6.2 case), a stale id that fails to publish followed by the right one, and the existing failure cases now check the five listings and the waits. 5 of the publish tests fail against the old action.
  • Docs: the action's description and the re-run caveat in docs/caveats.md.

Not verified against GitHub: how long the listing lags. 0.6 s was too short in the v1.6.2 run; 30 s is a guess with a wide margin. Adopters whose publish job runs minutes after draft-release (a package upload in between) weren't affected.

Checklist

  • Bug fix for the current release: add the backport label (or ask a maintainer to)
  • just lint and just test pass (ran the equivalents: ruff, ty, prek, full pytest 367 passed, 7 skipped; just isn't installed here)
  • docs/adopting.md, docs/organisation-setup.md, and docs/repository-setup.md updated if the stubs, inputs or setup changed
  • Breaking change or deprecation: the Migration section says what consumers must change

…ent ago (#126)

🤖 _AI text below_ 🤖

## Summary

Closes #125

The Publish run of v1.6.2 failed: `publish-release` listed the releases
about 0.6 s after `draft-release` created the draft, found none for the
tag, and stopped. The same listing showed the draft minutes later, and
it was published by hand. GitHub's list of releases lags behind a new
draft for a moment; it may also still show a draft that `draft-release`
just deleted (a re-run), whose id then fails to publish.

- `publish-release` now tries up to five times, waiting 2, 4, 8 and 16 s
in between (about 30 s), while the listing doesn't show exactly one
draft of the tag or publishing the draft it found fails. It logs each
retry and fails with the same error after the last attempt (`Found N
draft releases of vX.Y.Z, expected exactly one. Run draft-release
(again) first.`, or `Could not publish the draft release <id> ...`). A
tag that is already published still needs nothing.
- Tests: the fake `gh` can answer each listing differently, fail the
publishing of given ids, and `sleep` only records its argument. New
cases: a listing that shows the draft at the third attempt (the v1.6.2
case), a stale id that fails to publish followed by the right one, and
the existing failure cases now check the five listings and the waits. 5
of the publish tests fail against the old action.
- Docs: the action's description and the re-run caveat in
`docs/caveats.md`.

Not verified against GitHub: how long the listing lags. 0.6 s was too
short in the v1.6.2 run; 30 s is a guess with a wide margin. Adopters
whose publish job runs minutes after `draft-release` (a package upload
in between) weren't affected.

## Checklist

- [ ] Bug fix for the current release: add the `backport` label (or ask
a maintainer to)
- [x] `just lint` and `just test` pass (ran the equivalents: ruff, ty,
prek, full pytest 367 passed, 7 skipped; `just` isn't installed here)
- [ ] docs/adopting.md, docs/organisation-setup.md, and
docs/repository-setup.md updated if the stubs, inputs or setup changed
- [ ] Breaking change or deprecation: the Migration section says what
consumers must change

(cherry picked from commit ccba48f)
@robertodr
robertodr merged commit 49423aa into release/1.6 Nov 19, 2026
6 checks passed
@robertodr
robertodr deleted the backport-126-to-release/1.6 branch November 19, 2026 09:48
robertodr pushed a commit that referenced this pull request Nov 19, 2026
Merging this PR releases **v1.6.3**.

It is updated automatically whenever a change lands on `release/1.6`.
Every fix backported to `release/1.6` is added to this PR. Merge it when
the fixes
should ship. Patch releases have no release candidates.
Wording fixes to `CHANGELOG.md` can be pushed to this PR and reach the
notes
of the GitHub release, but make them just before merging: the next
update
overwrites them.

---


## 1.6.3 (2026-11-19)

### Fixes

- **publish-release:** Wait for GitHub to list a draft created a moment
ago ([#127](#127))

Co-authored-by: algorithmiq-release-bot[bot] <349245065+algorithmiq-release-bot[bot]@users.noreply.github.com>
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