chore: fix CodeQL parsing of Sorbet fallback#303
Merged
Conversation
HAYDEN-OAI
approved these changes
Jul 13, 2026
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
thanks, this is exactly the right minimal workaround. parenthesizing the same notimplementederror argument preserves runtime behavior while avoiding the documented tree-sitter and codeql parse failure, and the full supported ruby matrix plus lint are green. approving!
Open
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
NotImplementedErrorargument in the endless Sorbet fallback methodlib/openai/internal/util.rbRationale
The existing
def to_sorbet_type = raise NotImplementedErroris valid Ruby, but CodeQL's underlying tree-sitter Ruby parser misparses a command-style call on the right-hand side of an endless method definition. CodeQL 2.26.0 consequently reports an extraction warning at this line and may provide incomplete analysis around it.Using
raise(NotImplementedError)is the minimal workaround recommended in github/codeql#14279 and tracked upstream in tree-sitter-ruby#242. It does not change runtime behavior.Validation
ruby -c lib/openai/internal/util.rbbundle exec rake test TEST=test/openai/internal/util_test.rb(36 runs, 154 assertions)bundle exec rubocop lib/openai/internal/util.rb --except Lint/RedundantCopDisableDirective,Layout/LineLengthgit diff --check