rails/rails
How to contribute
This section covers the contributor workflow for the Rails codebase: how to pick up work, run tests, follow code style, and ship a pull request.
The canonical, user-facing version of this guide lives at https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html. The pages here are a developer-oriented summary keyed to specific files in the repo.
Sub-pages
- Development workflow — branch, code, test, PR, merge.
- Testing — Minitest, parallel runs, the Active Record adapter matrix, fixtures, and helpers.
- Debugging — common pitfalls, where logs go, how to bisect.
- Patterns and conventions — the code style that spans every component.
- Tooling — RuboCop, mdl, the
bin/testwrapper, CI, devcontainers.
Where to start
If you've never contributed before:
- Read
CONTRIBUTING.mdat the repo root. - Read
AGENTS.md— it documents the conventions explicitly for AI/automated contributors but is just as useful for humans. - Read the per-component
README.{md,rdoc}for whatever component you're touching. - Check the
*-stablebranches for backporting policy if your fix needs to ship on a maintenance release. - Look at the bug-report templates in
guides/bug_report_templates/if you need to reproduce something for an issue.
Pull request expectations
- One coherent change per PR. Refactors and behavior changes should be separate.
- Add an entry to the relevant
<component>/CHANGELOG.mdfor behavior changes. - Include tests. The repo treats untested behavior as not promised.
- Reference the issue number in the commit body (
Fix #12345: Description). - Run
bundle exec rubocopand the affected component'sbin/testbefore pushing.
The maintainers' review priorities, in rough order, are: correctness, performance regressions, test coverage, code style, documentation, and changelog. Rails has a very high bar for adding new public API; bug fixes and removing dead code tend to merge much faster than additions.
Definition of done
A change is considered done when:
- The component's tests pass locally on the relevant adapter(s).
- RuboCop is clean.
- A
CHANGELOG.mdentry exists for any behavior change. - The PR has been reviewed and approved by a committer.
- For Active Record changes, all four adapter test suites pass on CI.
For deep technical conventions (configuration flags, helper layout, naming), see patterns and conventions. For test specifics, see testing.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.