fix(android): fail the release when a central deployment does not validate - #651
Merged
Conversation
…idate `publishToMavenCentral()` uploads the bundle, prints "Skipping deployment validation!" and exits 0 whatever the portal then makes of it. A release that uploaded something central rejects looked exactly like one that worked, and the only way to tell them apart was opening the portal by hand. The plugin can wait; it just does not by default. `DeploymentValidation.VALIDATED` polls until the portal has validated the deployment and fails the build if it does not, which is what the maven jar's path has always done - the sonatype plugin there blocks and logs "has been validated". Still USER_MANAGED: validating is not releasing, so a human still presses the button and a bad artifact is still recallable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqc6gWzBBnoqvdaQ9HPoEa
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3df0cfe61
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…idate `publishToMavenCentral` uploads the bundle, prints "Skipping deployment validation!" and exits 0 whatever the portal then makes of it. A release that uploaded something central rejects looked exactly like one that worked, and the only way to tell them apart was opening the portal by hand. The plugin cannot help here: it wires its validation task in only when `automaticRelease` is on, and that also releases the deployment - which is deliberately a human's job, since central never forgets a version. So the workflow polls the portal itself, the way the maven jar gets for free from the sonatype plugin. The publish step gains `shell: bash` for its pipefail, without which tee's exit code would hide a failing gradle - the same class of silent success this is about. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lqc6gWzBBnoqvdaQ9HPoEa
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.
publishToMavenCentraluploads the bundle and exits without waiting:Exit 0 whatever the portal then makes of it. A release that uploaded something central rejects looks exactly like one that worked — every android test publish during the maven central bring-up had to be checked by hand in the portal UI.
The maven jar never had this problem: the sonatype plugin blocks and logs
has been validated, somaven.ymlfails loudly. Onlyandroid.ymlwas silent.Why not just ask the plugin
publishToMavenCentral(false, DeploymentValidation.VALIDATED)looks like the fix and does nothing. The plugin only wires its validation task in whenautomaticReleaseis true:That was the first version of this PR, caught in review and then confirmed on a real publish — the log above is from that run, with the enum set.
Turning
automaticReleaseon would validate, but it also releases the deployment. Central never forgets a version, so pressing that button stays a human's job; that was the point ofautoPublish = falseand it does not change here.So the workflow polls
.github/scripts/await-central-validation.shreads the deployment id out of the gradle log and polls/api/v1/publisher/statusuntil the portal reportsVALIDATED, failing the job onFAILED(with the portal's own error text) or on a 10 minute ceiling.The publish step also gains
shell: bash, for thepipefailthat Actions' defaultbash -edoes not set — otherwisetee's exit code would hide a failing gradle, which is the same class of silent success this PR is about.