Tapioca doesn't import hand written signatures from the `stripe` gem

Open
#2,248 19 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ruby
Domain
tooling

Research direction

Start by comparing the generated output for stripe with the handwritten signatures in rbi/stripe/resources/v2/event.rbi, focusing on request and type. Read the workaround in orb.rb to understand how it avoids introspection, then identify the expected import behavior and verify that the generated RBI preserves those signatures.

Written by the indexing model from the issue text.

Description

help-wanted

hola 👋,

Stripe just released their v14 of their SDK, and it ships with generated RBI definitions https://github.com/stripe/stripe-ruby/tree/master/rbi/stripe

But there is a problem:

when you run bundle exec tapioca gem stripe, you get the following output

  # source://stripe//lib/stripe/resources/v2/event.rb#13
  class Stripe::V2::Event::Reason < ::Stripe::StripeObject
    # source://stripe//lib/stripe/resources/v2/event.rb#23
    def request; end
    # source://stripe//lib/stripe/resources/v2/event.rb#21
    def type; end
  end

which contains no type definition for either request or type, when the original RBI file does include them:

see https://github.com/stripe/stripe-ruby/blob/5ce725ae222219a0ebc3d8f1140644e25fc9f740/rbi/stripe/resources/v2/event.rbi#L9


As a library author, how I got around this limitation is that I inserted a snippet at the beginning of my gem, such that when "required" under tapioca, it bails out of the introspection.

see https://github.com/orbcorp/orb-ruby/blob/d109a878d3a85e263521dab7ae604eaf63b81f54/lib/orb.rb#L21


Is there a less hacky way to work around this particular issue?

Dominant language
Ruby
Stars
873
Forks
164
Avg merge
4d 27m
Merged PRs (30d)
9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shopify/tapioca

All issues in Shopify/tapioca

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.