Rails core contributions
This course covers how changes get into Rails and how to read the framework's source. It explains why documentation fixes and bug fixes with failing tests are accepted far more often than new features. It shows how to write a self-contained bug report script with Bundler's inline mode, run one component's tests in a Rails checkout, and write the failing test before the fix. It also covers pull request conventions, following up after opening one, backports to stable branches and finding methods with source_location.
What you'll learn
- ✓Which kinds of contributions Rails accepts and why new features are often declined
- ✓Writing an executable bug report with bundler/inline and reducing an application failure to a short script
- ✓Running one component's tests with bin/test and writing a failing test before the fix
- ✓Preparing a focused pull request: CHANGELOG entries, commit messages, rebasing and squashing
- ✓Following up on a pull request and responding to silence or closure
- ✓Release support windows, backports to stable branches and reading Rails source with source_location
What Rails actually merges
It's Friday afternoon, and a query returns rows you didn't ask for. You open the Active Record source in your bundle, find the branch that builds the condition and see the fix. It's four lines.
Read the full lesson free →Curriculum
7 lessonsWhat Rails actually merges
Why documentation fixes and bug fixes with failing tests get merged, while new features are rarely accepted.
The executable bug report
Writing a single-file bug reproduction with bundler/inline, testing against edge Rails and reducing an application failure.
A Rails checkout you can work in
Cloning Rails, running one component's tests with bin/test, and writing a test that fails before the fix.
The pull request itself
Keeping a pull request to one change, deciding on a CHANGELOG entry, writing commits, rebasing and squashing.
After you open it
Why silence follows most pull requests, how to follow up once in public, and how to read closures.
Backports and release branches
How patch, minor and major releases differ, the support windows, and how to backport a fix with cherry-pick.
Reading Rails as a primary source
Using source_location to find method definitions in your bundle and following the full path from bug to release.