Skip to content

Poll the staged release URL from the publish response - #1299

Merged
ericmj merged 2 commits into
mainfrom
staged-release-url
Nov 2, 2026
Merged

ericmj merged 2 commits into
mainfrom
staged-release-url

Conversation

@ericmj

@ericmj ericmj commented Nov 2, 2026

Copy link
Copy Markdown
Member

mix hex.publish --wait built the staged release status path from the id in the publish response, through hex_core's get_staged. hexpm/hexpm#2095 removes the id from staged release URLs and from the response. Once it deploys, a --wait publish from an API key or workload identity on a package that requires approval would poll a path that no longer exists, and fail with "Failed to read staged release status". The task now polls the url from the staged response. It authenticates the same way the publish did, with an API key, OAuth token or workload identity token, including workload identity renewal. Approval stays bound to approval_checksum.

The client only requests a url under HEX_API_URL; any other URL fails with "Failed to read staged release status". That keeps a server response from sending the publish credential to another host. It also means a status endpoint moved to another host needs a client change, and so does a local HEX_API_URL that names hexpm differently from the URLs it builds.

hex_core is vendored from hexpm/hex_core#257 at daea875, which removes get_staged. It needs vendoring again from hex_core main after that merges.

The suite, including integration tests against hexpm main at 70a8302, passed 904 tests with 2 skipped on 6336ece. The Bypass tests cover polling a returned url that the client couldn't build from any other field, an organization publish polling that url and not /api/repos/<org>/..., and a url outside the API.

mix hex.publish --wait built the status path from the staged release id
and the --organization flag. It now requests the `url` Hex.pm returns
with the staged release, so the server decides where the status lives.
The request goes through the configured API with the publish's
credentials, and a status URL outside the configured API URL fails the
wait without being requested.
@ericmj
ericmj merged commit ed887bc into main Nov 2, 2026
15 checks passed
@ericmj
ericmj deleted the staged-release-url branch November 2, 2026 16:36
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