Repository navigation
ci(publish): verify refuses a deleted or moved tag; a Slack post that fails shows on the run - #22
Merged
Merged
Conversation
…g the release The awaiting-tap and failure posts used curl -sS ... || true, so a revoked webhook (403/404) or Slack being unreachable read as success. They now use curl -fsS: a post Slack refuses or never answers fails its step with an error annotation, and continue-on-error on that step keeps it from failing the release. An unset secret still logs a warning and passes.
…lt fails the step too; the comment says what a failed post looks like
… commit (deleting a tag starts a push run too)
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.
Why
Two gaps in
publish.yml, the workflow that ships the package to PyPI:pypiapproval, and when the pipeline fails. Both posts ended incurl -sS ... || true. Without-f, curl treats a 403 or 404 from Slack as success, so a revoked webhook looked like a sent message: the step was green and nothing reached the channel.verify. A tag deletion can start a push run too. For a deleted branch, GitHub's docs say the run gets the default branch's head as its commit. They say nothing about tags, but nothing guards against the same for a tag. Whilemain's version still equals the deleted tag's, everyverifycheck passed: the tag name matched the version, and the commit was onmain. One approval would then publishmain's head under a tag that no longer exists. A tag moved to another commit beforeverifyran passed the same way.What changes
.github/workflows/publish.yml:verifychecks the tag as origin has it now. On a tag push, it fetchesrefs/tags/<tag>from origin and refuses the release unless that tag, peeled to its commit, is the commit being published. The refusal says what git saw: the tag is missing, or it points at another commit. Annotated and lightweight tags both pass.notify-awaiting-tap,notify-failure):curl -fsS, and no|| true. A post that Slack refuses (403, 404, 410) or never answers (connection refused, the 15 s timeout) now fails its step and writes an::error::annotation on the run.set -o pipefail. If the JSON payload never builds (a jq failure), the step fails too, instead of curl quietly sending an empty body.continue-on-error: trueon both steps. A failed post shows as a failed step and an annotation, but the job and the run stay green. No publish job depends on a notify job.The rest of the release path is unchanged: the version checks, the test matrix, the build and the environment gate. No version bump, because nothing that ships in the package changed.
Proof (local)
I extracted each
run:block from this file with a YAML parser and ran it underbash -e, GitHub's default shell.verify, against a throwaway origin withmain, an unmerged branch, and tags set per case:v1.3.0on a 1.3.0maincommit, annotated tagv1.3.1main's headverifyproddispatch onmainproddispatch offmaintestdispatch offmainpyproject.tomland_version.pydisagreeSlack steps, against a local HTTP stub:
::error::::error::::error::::error::::warning::set -o pipefail, the jq case exits 0.Test plan
verifypasses on the tag push andnotify-awaiting-tapposts the tap request. If the post fails, the run shows a failedPost to Slackstep, and the publish still goes ahead after approval.