CodeVetter · Repo Unpack · System map
rails/rails
The repository root is a Bundler workspace plus an npm workspace, not a single application. railties/exe/rails is the user-facing executable; rails/all.rb is the full framework require list; Rails::Application#initialize! is the runtime boot boundary. Persistence and file storage sit behind adapter registries. The in-repo test entry points are Rake and each component's bin/test. Gem and npm publishing is tools/releaser, triggered by the GitHub Actions release workflow; the full suite gate documented for releases is Buildkite, whose pipeline YAML is not in this checkout.
- RAILS_VERSION is 8.2.0.alpha and rails.gemspec requires Ruby >= 3.3.1 and RubyGems >= 1.8.11, with MIT license and rubygems_mfa_required metadata.
- The meta-gem depends on activesupport, actionpack, actionview, activemodel, activerecord, actionmailer, activejob, actioncable, activestorage, actionmailbox, actiontext, and railties, each at the same version, plus bundler >= 1.15.0.
- railties/exe/rails unshifts railties/lib onto $LOAD_PATH when a sibling .git directory exists, then requires rails/cli.
- Rails::AppLoader.exec_app walks parent directories looking for bin/rails or script/rails and execs Gem.ruby on that binstub when the file references APP_PATH or ENGINE_PATH; a Bundler-generated bin/rails prints BUNDLER_WARNING and then requires config/boot plus rails/commands.
- In-app dispatch is railties/lib/rails/commands.rb, which maps g, d, c, s, db, r, and t onto generate, destroy, console, server, dbconsole, runner, and test, then calls Rails::Command.invoke.
- rails/all.rb requires, in order, active_record/railtie, active_storage/engine, action_controller/railtie, action_view/railtie, action_mailer/railtie, active_job/railtie, action_cable/engine, action_mailbox/engine, action_text/engine, and rails/test_unit/railtie, swallowing LoadError only when the missing path is that railtie.
- Rails::Application#initialize! runs Bootstrap.initializers_for, then railties_initializers, then Finisher.initializers_for, and refuses a second call. Bootstrap loads Active Support, the logger, the error reporter, the cache, and the once-autoloader; Finisher builds the middleware stack, eager-loads, adds internal routes, and enables YJIT.
- DefaultMiddlewareStack#build_stack assembles HostAuthorization, optional AssumeSSL and SSL, Static, Executor, RequestId, RemoteIp, Logger, ShowExceptions, DebugExceptions, Reloader, Cookies, the configured session store, Flash, ContentSecurityPolicy, and optional ActiveRecord DatabaseSelector and ShardSelector middleware.
- ActiveRecord.protocol_adapters maps DATABASE_URL schemes sqlite to sqlite3, mysql to mysql2, and postgres to postgresql; external adapters may replace those strings. The root Gemfile's :db group installs pg, mysql2, and trilogy, and sqlite3 is a default dependency.
- ActiveStorage::Service documents Disk, GCS, S3, and Mirror. Service.configure delegates to Service::Configurator.build, which require's active_storage/service/<name>_service and instantiates the matching Service subclass. Registry#fetch memoizes built services from the YAML configuration hash.
- Root Rakefile task test iterates Releaser::FRAMEWORKS and runs rake test in each directory; task smoke does the same except Active Record, which runs sqlite3:test. Per-adapter tasks exist for mysql2, trilogy, postgresql, sqlite3, and sqlite3_mem, plus activerecord:db:create/drop/rebuild.
- Releaser::FRAMEWORKS is ordered so dependents follow dependencies, ending in railties. The release GitHub workflow checks out the repo, configures RubyGems trusted publishing and npm, bundle-installs tools/releaser, and runs bundle exec rake push.
- package.json is a private npm workspace of actioncable, actiontext, and activestorage. @rails/actioncable, @rails/actiontext, and @rails/activestorage are versioned 8.2.0-alpha, matching RAILS_VERSION.
- RELEASING_RAILS.md tells releasers to treat https://buildkite.com/rails/rails as the CI status and not to release on red CI. This checkout has no .buildkite directory; the GitHub workflows that do exist cover release publishing, a rails-new Docker smoke, rail_inspector, markdown, devcontainer, labeling, and staleness.