fix(bundle_fetch): handle null requirements in RubyGems API#350
Merged
p0deje merged 2 commits intobazel-contrib:mainfrom Mar 3, 2026
Merged
fix(bundle_fetch): handle null requirements in RubyGems API#350p0deje merged 2 commits intobazel-contrib:mainfrom
p0deje merged 2 commits intobazel-contrib:mainfrom
Conversation
RubyGems API v2 sometimes returns `"requirements": null` instead of an empty list. Since Starlark's `json.decode` maps JSON `null` to `None`, attempting to iterate over `requirements` was failing. This change ensures that `_fetch_gem_requirements` always returns an iterable list. Additionally: - Exported `jars_downloader_internal` to allow unit testing of private functions. - Added comprehensive unit tests in `ruby/tests/jars_downloader_tests.bzl`. - Registered the new test suite in `ruby/tests/BUILD`. Verified with `bazelisk test //ruby/tests/...`.
Contributor
Author
|
@amarkowitz FYI this bug blocked us from upgrading past 0.22.0. |
p0deje
approved these changes
Mar 3, 2026
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.
RubyGems API v2 sometimes returns
"requirements": nullinstead of an empty list. Since Starlark'sjson.decodemaps JSONnulltoNone, attempting to iterate overrequirementswas failing.This change ensures that
_fetch_gem_requirementsalways returns an iterable list.Additionally:
jars_downloader_internalto allow unit testing of private functions.ruby/tests/jars_downloader_tests.bzl.ruby/tests/BUILD.