Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ If there is a conflict, `AGENTS.md` wins.
# 4.0.10 or newer before running root bundle commands.
bundle && pnpm install

# After changing react_on_rails/Gemfile or Gemfile.shared_dev_dependencies,
# also run bundle install at the repo root to keep the root Gemfile.lock synced.
# The root Gemfile is a lint/tooling-only bundle (RuboCop + the benchmarks/
# script-spec runner); it does NOT pull in the package Rails/test/runtime stack.
# After changing the root Gemfile (RuboCop/rspec pins), run bundle install at the
# repo root to keep the root Gemfile.lock synced.

# Build TypeScript → JavaScript
pnpm run build
Expand Down
36 changes: 27 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
# frozen_string_literal: true

# Root Gemfile for developer convenience and RuboCop tooling.
# RuboCop is owned here so the monorepo uses one locked version.
# Root Gemfile for repo-wide lint/tooling.
#
# This is intentionally a lint/tooling-only bundle: RuboCop is owned here so the
# monorepo (OSS and Pro) resolves it from one committed root Gemfile.lock.
# It deliberately does NOT eval_gemfile the react_on_rails package Gemfile,
# so a root `bundle install` for lint-only workflows stays fast and does not
# pull in the Rails/test/runtime stack. The package Gemfiles continue to own
# their RBS/test/runtime dependencies.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root rake breaks lint bundle

Medium Severity

Stopping the root Gemfile from loading the package bundle leaves AGENTS.md’s root bundle plus rake / rake run_rspec:gem flow without Rails and other package gems. The monorepo root Rakefile still eager-loads react_on_rails/rakelib, which requires rails/version before tasks run.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9b7c081. Configure here.

#
# rspec is included only to run the plain-Ruby benchmarks/ script specs from the
# repo root (benchmark.yml). Those specs deliberately load no Rails and no
# react_on_rails gem (see benchmarks/spec/spec_helper.rb), so the bare rspec gem
# is all the root bundle needs — not the package's rspec-rails stack.
#
# The pinned versions below must match what the react_on_rails and
# react_on_rails_pro package locks resolve, to avoid version drift and
# unexpected new offenses.

# Use the open-source gem's Gemfile
eval_gemfile File.expand_path("react_on_rails/Gemfile", __dir__)
source "https://rubygems.org"

group :development, :test do
gem "rubocop", "1.61.0", require: false
gem "rubocop-performance", "1.20.2", require: false
gem "rubocop-rspec", "2.31.0", require: false
end
# benchmark is no longer a default gem on Ruby >= 3.5; rubocop's executable
# requires it, so the lint-only bundle must declare it explicitly.
gem "benchmark", require: false

gem "rubocop", "1.61.0", require: false
gem "rubocop-performance", "1.20.2", require: false
gem "rubocop-rspec", "2.31.0", require: false

gem "rspec", "~> 3.13", require: false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three RuboCop gems use exact-version pins (= x.y.z) but rspec uses a pessimistic constraint. The header comment says "pinned versions must match what the package locks resolve," which only holds for exact pins. A bundle update rspec in isolation could silently drift the root lock ahead of what the package Gemfiles resolve.

Consider pinning exactly to match the lock:

Suggested change
gem "rspec", "~> 3.13", require: false
gem "rspec", "3.13.2", require: false

Or, if patch-level flexibility is intentional, add a note here clarifying that rspec is explicitly allowed to float within the minor unlike the RuboCop gems.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment above (lines 17–19) says the pinned versions must match what the package locks resolve, but rspec uses ~> 3.13 while all three rubocop gems use exact pins. The current resolved version is 3.13.2 (visible in the new lock). A minor rspec bump wouldn't break the benchmark specs since they load no Rails, but it creates a subtle inconsistency with the stated intent. Either pin exactly:

Suggested change
gem "rspec", "~> 3.13", require: false
gem "rspec", "3.13.2", require: false

…or add a brief comment explaining why rspec intentionally gets a range constraint instead of an exact pin (e.g. "benchmarks/spec is stdlib-only so any 3.13.x is safe").

Loading
Loading