Skip to content

fix: do not read a rubygems.org outage as "never published" - #12

Draft
simonx1 wants to merge 1 commit into
obie:mainfrom
simonx1:fix/release-status-fails-open
Draft

simonx1 wants to merge 1 commit into
obie:mainfrom
simonx1:fix/release-status-fails-open

Conversation

@simonx1

@simonx1 simonx1 commented Sep 18, 2026

Copy link
Copy Markdown

published asks rubygems.org whether this version is already out, and rescued OpenURI::HTTPError to false. The comment says 404, and 404 does mean the gem has never been published — but the rescue caught every HTTP error. A 500, a 429, or anything else from rubygems.org read as "not published", which is the one answer that makes release:push go ahead and push.

That inverts the check. It exists so a re-run is a no-op, and the case it's least able to handle is the case where it cannot tell. Failing the release is the right answer there: the version is still sitting in the gemspec and the workflow can be run again.

The fix

Only 404 returns false; everything else propagates. The lookup gets explicit open and read timeouts instead of inheriting none, and the response is checked for being the array it's parsed as — .any? over an unexpected Hash would have raised NoMethodError from inside a lambda with no context.

Verified against the real API: a never-published name returns false, ruby_decision_model 0.1.0 returns true, 9.9.9 returns false, and a 503 now raises where it used to read as false.


Draft: part of a security and API-coverage audit, opened for reference rather than as a request for immediate review. Independent of the other branches, each off main. Suite green on Ruby 3.2.11, 3.3.8 and 3.4.8.

🤖 Generated with Claude Code

`published` asked rubygems.org whether this version is already out and
rescued OpenURI::HTTPError to false. The comment says 404, and 404 does
mean the gem has never been published -- but the rescue caught every HTTP
error. A 500, a 429, or anything else from rubygems.org read as "not
published", which is the one answer that makes release:push go ahead and
push.

That inverts the check. It exists so a re-run is a no-op, and the case it
is least able to handle is the case where it cannot tell. Failing the
release is the right answer there: the version is still sitting in the
gemspec and the workflow can be run again.

Only 404 returns false now; everything else propagates. The lookup gets
explicit open and read timeouts instead of inheriting none, and the
response is checked for being the array it is parsed as -- .any? over an
unexpected Hash would have raised NoMethodError from inside a lambda with
no context.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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