Repository navigation
Declare rexml in the test bundle - #3058
Merged
Merged
Conversation
ericproulx
force-pushed
the
fix/declare-rexml-dependency
branch
from
November 6, 2026 17:51
9911683 to
b36bb5f
Compare
Danger ReportNo issues found. |
Without multi_xml, Grape parses XML with ActiveSupport::XmlMini, whose
default backend requires rexml/document. rexml has been a bundled gem
rather than a default one since Ruby 3.0, so under Bundler it loads only
when the bundle holds it. Nothing in the Gemfile asked for it: Grape's
XML specs passed only because Danger's kramdown dependency brought it
in. Without Danger they fail with
LoadError: cannot load such file -- rexml/document
The :test group now declares it, so the specs no longer depend on
Danger. It stays out of the gemspec: an app that parses XML without
multi_xml brings rexml itself.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
ericproulx
force-pushed
the
fix/declare-rexml-dependency
branch
from
November 6, 2026 17:53
b36bb5f to
f63ec16
Compare
ericproulx
added a commit
that referenced
this pull request
Nov 6, 2026
Danger ran one check, `changelog.check!`, and cost far more than that: * 29 of the 91 gems in the lockfile (octokit, faraday, git, kramdown and their dependencies) were there only for it. They sat in the :test group, which every gemfile evals, so every CI job and every local bundle installed them, and #3045 had to pin `git < 6` to keep it loading. * Its two workflows called a third-party reusable workflow, pinned by tag, with `secrets: inherit`. * It parsed the whole of CHANGELOG.md, so it failed pull requests on entries merged years before, and it failed every pull request opened with the `#PR` placeholder AGENTS.md asks for until the number was filled in. .github/scripts/check_changelog.rb replaces it. It needs nothing but Ruby and git, so .github/workflows/changelog.yml installs no bundle and uses no secret. It reads the lines the pull request adds to CHANGELOG.md: * a new entry must be `* [#N](https://github.com/ruby-grape/grape/pull/N): Description - [@user](https://github.com/user).`, with N this pull request's number; an edited entry keeps the number it was merged with; * a `#PR` or `#XXXX` placeholder is a warning, not a failure; * `* Your contribution here.` stays the last line of each section of the unreleased version; * a pull request that changes more than Markdown files without touching CHANGELOG.md gets a warning, as it did with Danger. Problems are annotations on the CHANGELOG line. RuboCop skips hidden directories, so .rubocop.yml now includes .github/**/*.rb. Removing Danger also takes kramdown out of the bundle, which was the only thing bringing in rexml, the parser ActiveSupport::XmlMini needs for XML when multi_xml is absent. #3058 declared rexml in the :test group, so the XML specs no longer depend on Danger. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.
Summary
Without
multi_xml, Grape parses XML withActiveSupport::XmlMini(lib/grape/xml.rb), whose default backend doesrequire 'rexml/document'.rexmlhas been a bundled gem rather than a default one since Ruby 3.0, so under Bundler it loads only when the bundle holds it.Nothing in the Gemfile asks for it. Grape's XML specs pass today only because Danger's
kramdowndependency bringsrexmlinto the test bundle. With Danger's gems removed (as #3057 does), 18 specs fail with:This declares
rexmlin the:testgroup, so the specs no longer lean on Danger. It is deliberately not a runtime dependency: an app that parses XML withoutmulti_xmlbringsrexmlitself.#3057 adds the same three lines, so whichever merges second drops its copy.
Test plan
bundle exec rake: RuboCop clean, 3184 examples, 0 failures.🤖 Generated with Claude Code