Shopify / Shopify/tapioca

GeneratedAttributeMethods is inconsistently included in the RBI files

Open
#1,954 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I’m running into a weird issue. We run tapioca dsl --verify on CI and recently it started to detect uncommitted changes and indeed when running tapioca dsl on the CI it does generate differently than it does on local. To give you an example, the model

class MyModel < ApplicationRecord
  self.primary_key = :id

  self.table_name = "my_table"
end

will generate the following rbi file on local (M1 machine)

class MyModel
  extend CommonRelationMethods
  extend GeneratedRelationMethods

and on CI, which runs on x86 linux I get

 class MyModel
+  include GeneratedAttributeMethods
   extend CommonRelationMethods
   extend GeneratedRelationMethods

Happens for multiple models that were not even modified recently. Tested both on tapioca (0.13.3) and the newest tapioca (0.15.1). We don’t have any compiler options.

CI is Github actions with ubuntu-latest is Ubuntu 24.04 TLS x86 architecture and on local I'm running on an M1 Macbook Air.

Besides the architecture, there is no difference between the two setups, environment variables and Tapioca config file is the same. Any ideas would be appreciated. Thanks!

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.

Research direction

Start by reproducing tapioca dsl and tapioca dsl --verify with the reported MyModel example on an M1 Mac and Ubuntu 24.04 x86 GitHub Actions runner. Investigate why GeneratedAttributeMethods is included only in the CI-generated RBI files; done means generation is consistent across both environments.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.