Skip to content

[OMBU-821] Document setup and add benchmark examples - #20

Merged
JuanVqz merged 3 commits into
mainfrom
feature/OMBU-821-readme-docs
Aug 20, 2026
Merged

[OMBU-821] Document setup and add benchmark examples#20
JuanVqz merged 3 commits into
mainfrom
feature/OMBU-821-readme-docs

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Aug 20, 2026

Copy link
Copy Markdown
Member

Closes #10

The issue

./bin/setup failed for new contributors with a yarn integrity error, then a failed db:prepare. Two separate causes:

  1. The yarn error came from webpacker's check_yarn_integrity hook in config/webpacker.yml. Removing webpacker in [OMBU-821] Upgrade to Ruby 4.0.6 #19 took that file with it, so this half is already fixed on main. Confirmed: ./bin/setup now exits 0.
  2. The db:prepare failure was never documented. config/database.yml is gitignored, so setup fails until you create one, and nothing in the README said so. This PR documents it.

README

Rewritten to be usable by someone who has never seen the app: what it is for, how to share a benchmark with benchmark-ips, the config/database.yml step, running the suite against both Rails versions, and the POST /reports contract.

Adds a Verifying a change end to end section, because the suite cannot do it: it uses Rack::Test, so it never exercises a real server or a real client. That section covers SHARE_URL against a local server or a deployed instance, plus heroku logs and bin/rails runner to confirm what was stored.

Also notes that report ids are base58 row ids, so early ones on a fresh instance are a single character like /2. That reads like a broken link when it is not.

examples/

A first-time user otherwise has to invent a benchmark before they can try anything.

File Purpose
examples/smoke_benchmark.rb Four ways to build a string, with x.compare!. Checks an instance accepts and renders a report.
examples/legacy_client_benchmark.rb The same, pinned to benchmark-ips 2.14.0, to exercise the pre-2.15.0 request shape.

The pin in the second file is load-bearing: require activates the newest installed version, so installing 2.14.0 alongside a newer gem does not exercise the old path. Worth knowing for anyone touching fix_missing_json_content_type, since that is what the rack ~> 2.2 pin protects.

Also

Drops babel.config.js and postcss.config.js, two webpacker build configs missed when webpacker was removed.

No application code changes. Suite green on Ruby 4.0.6 for both Rails versions: 21 runs, 37 assertions.

bin/setup failed for new contributors (#10). The yarn half of that is fixed by
removing webpacker, which took config/webpacker.yml and its check_yarn_integrity
hook with it; ./bin/setup now completes. The other half was undocumented:
config/database.yml is gitignored, so db:prepare fails until you create one, and
nothing said so.

The README now covers what the app is for, how to share a benchmark, the
database.yml step, how to run the suite against both Rails versions, and the
POST /reports contract. It also documents verifying a change end to end, which
the suite cannot do: it uses Rack::Test, so it never exercises a real server or
a real client.

Adds examples/ with two runnable benchmarks, since a first-time user otherwise
has to invent one:

  smoke_benchmark.rb         four ways to build a string, with x.compare!
  legacy_client_benchmark.rb the same pinned to benchmark-ips 2.14.0, to
                             exercise the pre-2.15.0 request shape

Pinning matters there: `require` activates the newest installed version, so
installing the old gem alongside a newer one does not exercise the old path.

Also drops babel.config.js and postcss.config.js, webpacker build configs
missed when webpacker was removed.
Rails generates bin/dev as a foreman wrapper around Procfile.dev, which exists
to run an asset watcher next to the server. This app no longer has one, so that
would mean adding a foreman dependency to supervise a single process. This is a
plain launcher instead.

It earns its place by catching the trap from #10: a missing config/database.yml
otherwise fails partway through boot, and the file is gitignored, so a fresh
clone always hits it. bin/dev checks first and prints the fix.

Arguments pass through, so `bin/dev -p 4000` works.
bin/dev already refused to start without config/database.yml, but bin/setup runs
first and still failed inside db:prepare with a stack trace. Both entry points
now stop with the same message, and it is self-contained rather than pointing at
the README, so the README no longer needs to spell the step out.
@JuanVqz
JuanVqz merged commit dcc622b into main Aug 20, 2026
2 checks passed
@JuanVqz
JuanVqz deleted the feature/OMBU-821-readme-docs branch August 20, 2026 20:44
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.

[BUG] bin/setup script fails with yarn error and failed db:prepare

1 participant