Repository navigation
Poll the staged release URL from the publish response - #1299
Merged
Merged
Conversation
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.
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.
mix hex.publish --waitbuilt the staged release status path from theidin the publish response, through hex_core'sget_staged. hexpm/hexpm#2095 removes the id from staged release URLs and from the response. Once it deploys, a--waitpublish 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 theurlfrom 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 toapproval_checksum.The client only requests a
urlunderHEX_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 localHEX_API_URLthat 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
urlthat the client couldn't build from any other field, an organization publish polling thaturland not/api/repos/<org>/..., and aurloutside the API.