Shopify / Shopify/tapioca

Generating dsl introspects the database which may contain columns from other branches.

Open
#646 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Scenario:

  1. work on branch A, add a column c to table t through a rails migration.
  2. create a new branch off main to do a quick fix which doesn't add any columns, run tapioca dsl to generate dsl rbis.
  3. RAILS_ENV=development bin/tapioca dsl --verify fails in CI because in step 2, the tapioca dsl command introspected the database that had columns left over from branch A.

Any ideas on how to handle this cleanly so that step 2 doesn't generate a DSL polluted from branch A's db migration? I was thinking maybe introspecting the schema.rb file or maybe generate a fresh database and generate the dsl from that fresh database rather than using what's in the current development branch.

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 with the tapioca dsl command and the reported RAILS_ENV=development bin/tapioca dsl --verify failure. Compare the proposed schema.rb-based approach with generating from a fresh database; done means DSL output is not polluted by columns left from another branch and CI verification succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.