chore: generate protobuf rbs#414
Open
chris-olszewski wants to merge 1 commit intoolszewski/fix_hidden_steep_issuesfrom
Open
chore: generate protobuf rbs#414chris-olszewski wants to merge 1 commit intoolszewski/fix_hidden_steep_issuesfrom
chris-olszewski wants to merge 1 commit intoolszewski/fix_hidden_steep_issuesfrom
Conversation
9c6a031 to
6657816
Compare
6657816 to
490a1a8
Compare
chris-olszewski
commented
Apr 11, 2026
| # Protobuf generates overly specific type signatures that result in Steep choking while creating union types. | ||
| # To avoid this, we widen them to their supertype e.g. `lookup` taking a String compared to the union type of each | ||
| # message type string literal. | ||
| def normalize_generated_rbs!(path) |
Member
Author
There was a problem hiding this comment.
Highlighting this for reviewer as this is probably the riskiest part of the addition. We intentionally widen various aspects of the generated types to work around:
- Missing RBS definitions from the protobuf gem
- Steep choking on our codebase with some of the union types.
I don't love the raw string substitution. I have an alternative version of this that uses the rbs to parse and rewrite the file, but I didn't find that to be more legible.
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.
What was changed
Start generating RBS files for our protobuf messages.
(This does require a new version of
protocwhich has not been released viagrpc-toolsgem yet so now maintainers/CI need to acquireprotocthemselves)Note this is on top of #415 as we upped our type checking now that we have types for protobufs and this resulted in finding some preexisting gaps. I moved those changes to their own PR so they don't get lost in the 40k lines of generated protobuf RBS types.
Why?
Previously this was unsupported, but with Protobuf 34.0
protoccan now output RBS files alongside the generated RB files.Checklist
Closes N/A
How was this tested:
Stopped excluding the
protocgenerated message types from type checking.Any docs updates needed?
N/A, internal at the moment since we don't ship RBS types with the gem.