Skip to content

Fixed assertion message from rubygems.org#353

Merged
hsbt merged 1 commit intomainfrom
fix-ci
Feb 10, 2026
Merged

Fixed assertion message from rubygems.org#353
hsbt merged 1 commit intomainfrom
fix-ci

Conversation

@hsbt
Copy link
Copy Markdown
Member

@hsbt hsbt commented Feb 10, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 10, 2026 07:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub Actions CI workflow assertion to match the current error message returned by RubyGems when attempting to publish an invalid gem, keeping the “trusted publisher” token test job passing.

Changes:

  • Update the expected RubyGems error text in the workflow’s “Test token” step.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 71 to 73
output="$(curl -s -w "\n\n%{http_code}" -v -X POST 'https://${{ matrix.gem-server }}/api/v1/gems' -H "Authorization: $RUBYGEMS_API_KEY" -H 'Accept: application/json')"
expected="$(printf "RubyGems.org cannot process this gem.\nPlease try rebuilding it and installing it locally to make sure it's valid.\nError:\npackage metadata is missing\n\n\n422")"
expected="$(printf "RubyGems.org cannot process this gem.\nPlease try rebuilding it and installing it locally to make sure it's valid.\nError:\ngem package contains no entries\n\n\n422")"
test "$output" = "$expected" || (echo "$output" && exit 1)
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow asserts exact equality of the full error body from a third-party service (RubyGems). This is brittle and will keep breaking whenever RubyGems changes wording/formatting (as evidenced by this update). Consider asserting on the HTTP status code (422) separately and matching only a stable substring (or JSON field, if available) rather than the entire response text.

Copilot uses AI. Check for mistakes.
@hsbt hsbt merged commit a8339f7 into main Feb 10, 2026
19 checks passed
@hsbt hsbt deleted the fix-ci branch February 10, 2026 07:56
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.

2 participants