Skip to content

Exit mix hex.info with status 2 when the package or release is missing - #1309

Merged
ericmj merged 1 commit into
mainfrom
info-not-found-exit-code
Nov 6, 2026
Merged

ericmj merged 1 commit into
mainfrom
info-not-found-exit-code

Conversation

@ericmj

@ericmj ericmj commented Nov 6, 2026

Copy link
Copy Markdown
Member

mix hex.info PACKAGE VERSION exited with status 1 both when the release doesn't exist and when the request failed, for example on a 5xx or a network error. A script that publishes only when a version isn't on hex.pm yet had to parse the No release with name ... message to tell the two apart. Exiting with status 1 in both cases was how hex_core's release workflow ended up publishing after a failed check (https://github.com/hexpm/hex_core/actions/runs/42227736305/job/127925415950).

A 404 for the package or the release now exits with status 2. Every other error still exits with status 1, which is also what Mix exits with when the task itself fails, so a script can publish on 2 and fail on anything else. The status codes are documented in the task's moduledoc.

Scripts that check whether a version is published, before publishing it,
couldn't tell a missing release from a failed request because both exited
with status 1.
@ericmj
ericmj merged commit 986d4e6 into main Nov 6, 2026
15 checks passed
@ericmj
ericmj deleted the info-not-found-exit-code branch November 6, 2026 14:29
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