CI: No Hackage candidate for published version#3186
Merged
DigitalBrains1 merged 1 commit intomasterfrom Apr 12, 2026
Merged
Conversation
martijnbastiaan
approved these changes
Apr 12, 2026
rowanG077
approved these changes
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job.
4d009ef to
89b14bc
Compare
mergify bot
pushed a commit
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job. (cherry picked from commit 7aef241)
1 task
DigitalBrains1
added a commit
that referenced
this pull request
Apr 12, 2026
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions. But we use the `.ci/publish_sdist.sh` script from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version. So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the `hackage-release-candidate`, indicating a failure that does not cause the pipeline as a whole to fail. When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result. Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in `.ci/functions.sh` that makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our `.ci/setup.sh` script against such exits so they don't trigger unwantedly in the `hackage-release-candidate` job. (cherry picked from commit 7aef241) Co-authored-by: Peter Lebbing <peter@digitalbrains.com>
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.
Since haskell/hackage-server#1469 (Check candidate uploads against main index), Hackage no longer allows candidates for published versions.
But we use the
.ci/publish_sdist.shscript from our stable branches to publish a candidate before we do the final release, so we do want it to run for nightlies on our stable branch. But we need to differentiate between runs that do not contain a new version and runs that do contain a new version.So we do this check in the CI job, and exit with a special exit code to flag when we did not upload a candidate. This means normal nightlies will have an exclamation mark in an orange circle next to the
hackage-release-candidate, indicating a failure that does not cause the pipeline as a whole to fail.When the "special" nightly before a release is run, the developer inspecting the result should verify a candidate was published (check mark in green circle). In the usual case, where only one candidate will be uploaded before release, they will also necessarily notice that the candidate is simply not on Hackage if they forget to check the CI job's result.
Because we don't have control over the exit codes of any binaries we invoke, a trap handler is added in
.ci/functions.shthat makes sure no other exits will have the exit code we reserve for allowed-to-fail. Currently, GitLab runners will not actually propagate the exit code of a failing step in the script, but this might very well change in an update. So we also proof our.ci/setup.shscript against such exits so they don't trigger unwantedly in thehackage-release-candidatejob.Still TODO:
Write a changelog entry (see changelog/README.md)