Skip to content

Extend T::Generic in Tapioca DSL compilers - #24219

Merged
MikeMcQuaid merged 1 commit into
mainfrom
tapioca-compiler-generics
Oct 10, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
tapioca-compiler-generics

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Tapioca 0.20 declares Tapioca::Dsl::Compiler's ConstantType in an RBS comment, which only becomes extend T::Generic when Tapioca's RBS rewriter transforms the file as it loads. Our DSL compilers call type_member, so they depend on that rewrite. brew typecheck --update gets it, but specs that require "tapioca/dsl" don't (they patched Tapioca::Dsl::Compiler instead) and neither does Tapioca run inside brew ruby, where Homebrew's Bootsnap is already set up. Loading the compilers there fails with undefined method 'type_member' for class Tapioca::Compilers::ApiStructs.

Each compiler now extends T::Generic itself, so the spec patches are removed. brew typecheck --update regenerates every DSL RBI unchanged.


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Claude Code (Opus 5.5) traced the failure, wrote the change and ran brew lgtm --online, checking that both specs fail to load without it once their patches are removed and that brew typecheck --update leaves every DSL RBI unchanged. Codex (GPT-6 Astra) reviewed it, independently reproducing those results and tracing why the rewrite is skipped under Bootsnap. I reviewed the diff.


Signed-off-by: Patrick Linnane <patrick@linnane.io>
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6f37de54-c5ca-40f5-90b2-1de2315e8fbf

📥 Commits

Reviewing files that changed from the base of the PR and between c7c0518 and 91452ce.


📒 Files selected for processing (15)
  • Library/Homebrew/sorbet/tapioca/compilers/api_structs.rb
  • Library/Homebrew/sorbet/tapioca/compilers/args.rb
  • Library/Homebrew/sorbet/tapioca/compilers/cask/caveats.rb
  • Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb
  • Library/Homebrew/sorbet/tapioca/compilers/cask/dsl.rb
  • Library/Homebrew/sorbet/tapioca/compilers/env_config.rb
  • Library/Homebrew/sorbet/tapioca/compilers/forwardables.rb
  • Library/Homebrew/sorbet/tapioca/compilers/on_system.rb
  • Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb
  • Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb
  • Library/Homebrew/sorbet/tapioca/compilers/rubocop_cask_ast_stanza.rb
  • Library/Homebrew/sorbet/tapioca/compilers/subcommand_args.rb
  • Library/Homebrew/sorbet/tapioca/compilers/tty.rb
  • Library/Homebrew/test/sorbet/tapioca/compilers/subcommand_args_spec.rb
  • Library/Homebrew/test/sorbet/tapioca/config_spec.rb

💤 Files with no reviewable changes (2)
  • Library/Homebrew/test/sorbet/tapioca/config_spec.rb
  • Library/Homebrew/test/sorbet/tapioca/compilers/subcommand_args_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📜 Recent review details
⏰ Context from checks skipped due to timeout. (20)
  • GitHub Check: docker (x86_64 Ubuntu 24.04)
  • GitHub Check: docker (arm64 Ubuntu 24.04)
  • GitHub Check: docker (arm64 Ubuntu 26.04)
  • GitHub Check: docker (x86_64 Ubuntu 26.04)
  • GitHub Check: tests (load-only Linux)
  • GitHub Check: tests (online, 2/2)
  • GitHub Check: tests (generic OS, 2/2)
  • GitHub Check: tests (load-only macOS)
  • GitHub Check: tests (macOS, 1/2)
  • GitHub Check: tests (Linux, 2/2)
  • GitHub Check: tests (no Sorbet)
  • GitHub Check: tests (online, 1/2)
  • GitHub Check: tests (generic OS, 1/2)
  • GitHub Check: tests (Linux, 1/2)
  • GitHub Check: tests (macOS, 2/2)
  • GitHub Check: syntax
  • GitHub Check: workflow_syntax
  • GitHub Check: docs
  • GitHub Check: Analyze
  • GitHub Check: tapioca

🔇 Additional comments (13)
Library/Homebrew/sorbet/tapioca/compilers/api_structs.rb (1)

11-11: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/args.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/cask/caveats.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/cask/config.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/cask/dsl.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/env_config.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/forwardables.rb (1)

11-11: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/on_system.rb (1)

12-12: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/rspec_dynamic_matchers.rb (1)

9-9: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/rubocop_cask_ast_stanza.rb (1)

10-10: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/subcommand_args.rb (1)

11-11: LGTM!


Library/Homebrew/sorbet/tapioca/compilers/tty.rb (1)

10-10: LGTM!



📝 Summary

Summary by CodeRabbit

  • Refactor
    • Updated compiler type declarations to support generic typing consistently.
    • Removed test setup that applied generic typing to the shared compiler base class.

Walkthrough

Thirteen Tapioca compiler classes now extend T::Generic. Two specs remove calls that extended Tapioca::Dsl::Compiler with T::Generic.

Changes

Tapioca generic declarations

Layer / File(s) Summary
Compiler generic support
Library/Homebrew/sorbet/tapioca/compilers/*, Library/Homebrew/test/sorbet/tapioca/compilers/subcommand_args_spec.rb, Library/Homebrew/test/sorbet/tapioca/config_spec.rb
Thirteen compiler classes add T::Generic extensions. The two specs remove comments and calls that extended Tapioca::Dsl::Compiler with T::Generic.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: issyl0


Merge Risk | ⚪ Minimal · up to 91452

Merge Risk: ⚪ Minimal · up to 91452

The affected compiler declarations establish generic support before their type-member calls, covering the inspected spec paths. No concrete merge-blocking regression is established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 91452

The changes are confined to existing compiler declarations and removal of test-only patches. No introduced security issue was identified, but external dependency behavior has not been fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The intended exposure change is successful loading of existing compilers in contexts that previously lacked generic support. The inspected changes do not add attacker-controlled inputs, execution sinks, privileges, or new service entrypoints. This is a bounded assessment of the change, not a verification of all external loader behavior.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding T::Generic to Tapioca DSL compilers.
Description check Passed The description explains the failure, the implementation change, the removed spec patches, and the reported validation results. It is directly related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@MikeMcQuaid

Copy link
Copy Markdown
Member

Thanks!

@MikeMcQuaid
MikeMcQuaid enabled auto-merge October 10, 2026 16:58
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 9eae0f0 Oct 10, 2026
55 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the tapioca-compiler-generics branch October 10, 2026 17:27
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