How would you set a Rails upgrade cadence for a portfolio of a dozen Rails apps, given Rails' six-month releases and support windows?
answer
- the security window is the floor
- about four minors in two years
- latest patch keeps security cheap
- deprecation ratchet between releases
- shared gems span two minors
basics
~20 sAnchor the policy to Rails' windows: every app must stay on a security-supported minor and the latest patch, and most should follow each new minor within a set period. Deprecation ratchets, a next-Rails CI build and a shared playbook keep each step small.
solid answer
~50 sStart from the constraints. Rails aims at a feature release every six months, and each minor gets bug fixes for one year and security fixes for two years from its `.0`. That gives a hard floor: no app on an end-of-life series, and every app on its series' latest patch so security releases apply in hours. Above the floor, choose a target such as "within one minor of current, upgraded within a quarter of each release" for actively developed apps, and a looser one for apps in maintenance. Make each step cheap: a deprecation ratchet in every app's test settings, a CI job that runs against the next Rails, `load_defaults` raised within the same cycle, and internal gems that support two minors. Upgrade a pilot app first, write its findings into a shared playbook, then roll through the rest. The trade-off is steady small cost versus rare, risky multi-minor jumps.
go deeper
Understand that Rails apps need regular upgrades because each minor series loses bug fixes after one year and security fixes after two.
Know the inputs to a cadence: six-month releases, the support windows, deprecation warnings and load_defaults.
Run upgrades so each step is small: ratchet deprecations, keep a next-Rails CI job, and raise load_defaults with the gem.
Set a floor tied to the security window and per-tier targets above it, fund it as steady capacity, and defend the trade-offs to the business.
## The constraints Rails imposes Any cadence has to fit Rails' maintenance policy: - **Cadence:** a feature release about every **six months**. - **Bug fixes:** one year from a series' `.0`. - **Security fixes:** two years from the `.0`, then end of life. - **Minors can break:** breaking changes are announced as deprecations in the previous minor, so skipping minors skips warnings. - **Security releases** are built from the last release, so they are trivial only for apps already on the latest patch. With a release every six months and a two-year security window, a series stays supported while roughly three newer minors ship. An app more than about three minors behind is close to, or past, end of life. ## A two-tier policy A workable policy separates a hard floor from a target: | Tier | Rule | Why | |---|---|---| | Floor (every app) | on a security-supported series, on its latest patch, security releases applied within days | end-of-life frameworks and slow patching are the real risk | | Target (active apps) | within one minor of current; upgrade within an agreed window after each release | each step stays one minor with warnings already fixed | | Target (maintenance apps) | upgrade before the series leaves bug-fix support | fewer steps, still never near end of life | Apps that cannot meet the floor need an explicit decision: fund the upgrade, retire the app, or isolate it and accept the risk in writing. ## Making each step cheap 1. **Deprecation ratchet.** Every app lists fixed deprecations in `config.active_support.disallowed_deprecation_warnings` with `disallowed_deprecation = :raise` in test, so warnings only ever decrease. 2. **Next-Rails CI.** A second CI job bundles the app against the next Rails release candidate or stable branch; failures show up months before the upgrade is due. 3. **Defaults kept current.** `config.load_defaults` is raised within the same cycle as the gem, so no app accumulates several `new_framework_defaults` files' worth of changes. 4. **Ruby on its own track.** Rails minors can raise the minimum Ruby (8.0 and 8.1 need 3.2), so Ruby upgrades are planned ahead of the Rails step that needs them. 5. **Shared code spans two minors.** Internal gems and engines used by several apps support the current and the next Rails minor, so apps can move independently. ## Rolling it out - **Pilot first.** Upgrade the app with the best tests and the most framework surface; record every breakage and fix. - **Shared playbook.** One page per minor: removed APIs, defaults that changed behaviour, gem versions that work, format-changing defaults to flip only after full deploys. - **Batch by similarity.** Apps sharing gems or patterns upgrade together; the playbook makes the second app a fraction of the first. - **Visible status.** A table of app, Rails version, `load_defaults` value, Ruby version and the series' end-of-life date makes drift obvious. ## Measuring whether it works - **Distance to end of life** per app: months until its series leaves security support. Nobody should be inside the last quarter. - **Patch lag:** days between a security release and its deployment, per app. - **Deprecation count** in each app's test run, which should only fall between upgrades. - **Defaults lag:** apps whose `load_defaults` is behind their gem's minor, and for how long. - **Upgrade cost per step:** engineer-days per app per minor. If it grows, the steps are too far apart. ## The trade-offs to argue - **Small and frequent vs large and rare.** Regular single-minor steps cost a little every six months; skipping saves effort until a multi-minor jump costs more than all the skipped steps together, with fewer warnings to guide it. - **Feature work vs upkeep.** A fixed capacity share per team is predictable; "upgrade when it hurts" tends to land during an incident or an end-of-life deadline. - **Uniformity vs autonomy.** One central owner gives consistency but becomes a bottleneck; per-team ownership with a shared floor and playbook scales better. - **New defaults vs stability.** Some defaults change data formats or security behaviour; flipping them promptly gains the safer behaviour but needs the careful, one-per-deploy rollout. There is no single right interval. The defensible answer states the floor in terms of Rails' own windows, sets a target per app tier, and shows how the cost of each step is kept low.
- Why is the security window, not the newest release, the right hard floor?Running one or two minors behind is a cost decision; running a series past its two-year security window means vulnerabilities get no fix release at all. A floor tied to that window is objective, applies to every app regardless of activity, and leaves the target above it to team and business judgement.
- How do internal gems shared by several apps stop the portfolio from moving in lock-step?If each shared gem supports both the current and the next Rails minor, every app can upgrade on its own schedule. Without that, the slowest app pins the gem and the gem pins everyone else. The cost is testing the gem against two Rails versions in its own CI.
It is like servicing a fleet of vans: a fixed service interval for each van costs a little every few months, while running them until something breaks costs less until the day several overdue repairs land at once on the busiest week.
- Upgrade only when a security issue forces it.
- Skipping minors is cheaper because each upgrade is done once.
- Rails security fixes reach every old series, so being behind is safe.
- The gem bump is the upgrade; load_defaults can wait indefinitely.
- Every app must upgrade on the same day to stay consistent.