Engineering
Spotify: finish fleet-wide migrations
Carry one code change across thousands of components, from a scoped instruction to merged, verified pull requests.
By OneShot · Updated
- time saved on agent-written migrations
- 60 to 90%against writing code by hand, with Spotify's agent
- framework release to reach 70% of services
- <7 daysagainst about 200 days through organic updates
- of 270,000+ scripted PRs automerged in 2022
- 77%11% more were merged by a person after review
About Spotify
Spotify runs thousands of repositories holding around 60 million lines of code, and its Fleet Management program ships each change to every owning team.
- of prod components fleet-managed, 2023
- >80%
- of Spotify PRs automated since mid-2024
- ~50%
- PRs merged from its own agent by 2025
- 1,500+
- repos targeted by a median shift, 2023
- 46
20,000+lines in one transformation script
Scripts stop at the complex changes
Scripted shifts cover changes a script can express, and only a few teams have the expertise and time to write sophisticated ones.
- Formatting check
- Build log
- Test report
- Judge verdict
A passing pull request that is wrong
A PR passing CI can still be wrong, Spotify's most serious error, so its agent waits for checks and a judge vetoing a quarter.
About 50repos opted out, each with a reason
Weeks of follow-up for the last repos
Merging the long tail of pull requests takes weeks of follow-up, and automerge waits for the owning team's working hours, never weekends.
What Spotify has published 5 sources
Spotify Engineering describes Fleet Management as a framework for applying code transformations across all of its repositories, reaching thousands of software components. Scripted changes handled dependency bumps, configuration updates and simple refactors; more complex migrations still needed engineers.
In November 2025 Spotify reported that its background coding agent had generated more than 1,500 pull requests that teams merged into production, saving 60–90% of the time against writing those migrations by hand. It also noted that agents can be slow and unpredictable, which creates a need for new validation and quality controls. These are Spotify’s results from its own internal agent. The OneShot workflow below coordinates code migrations from the change request through validation and review.
- Spotify Engineering: 1,500+ PRs Later (Honk, Part 1)Company source
- Spotify Engineering: Background coding agents, context engineering (Honk, Part 2)Company source
- Spotify Engineering: Background coding agents, strong feedback loops (Honk, Part 3)Company source
- Spotify Engineering: Fleet Management, Part 1: a fleet-first mindsetCompany source
- Spotify Engineering: Fleet Management, Part 3: fleet-wide refactoringCompany source
The OneShot solution
Carry each approved migration to merged, verified changes in every in-scope repository, with an owner for anything that cannot be changed automatically.
An approved migration, a newly in-scope repository or a pull request that has gone stale.
Goal
Campaign scoping
- Starts on
- The migration lead approves an instruction and repository list.
- Does
- Records the instruction, repositories in scope, when to leave a repository alone, and what counts as done.
- Returns
- In-scope repositories, opt-outs with reasons, and the required checks.
- Source repositories and CI
1 step- Scope the campaign
Record the migration instruction, the repositories in scope and what counts as done: a passing build plus the checks the migration lead names. Leave out repositories whose owners have opted out, and record why.
Goal
Change and verify
- Starts on
- Each in-scope repository, once the campaign scope is recorded.
- Does
- Applies the change, runs build, tests and named checks, retries failures, and opens a pull request only on a pass.
- Returns
- A passing pull request, or a set-aside repository with failure evidence.
- Source repositories and CI
1 step- Make and verify each change
The OneShot agent runs the change per repository within the campaign’s budget and opens a pull request only when the build passes. A failing build is retried with the error as context; repeated failures are set aside for an engineer.
Goal
Review and close-out
- Starts on
- A passing pull request opens or waits two working days.
- Does
- Asks the owning team to review on the request page, chases silence and hands the blocked tail to the lead.
- Returns
- The campaign report: every repository's status, evidence and owner.
- Source repositories and CI
2 steps- Get the owner’s review
Ask each owning team to review its pull request, with the build result and a short description of the change, through the goal’s private request page. Chase reviews that go unanswered and bring requested changes back into the same pull request.
- Close the campaign
Track merged, open and blocked repositories against the scope. Hand blocked ones to the migration lead with the failure evidence, and reopen a repository if its change is later reverted.
What the workflow produces
Migration campaign report- Scope
- Verification
- Review
- Remaining work
- Pays back
- Engineering time on fleet-wide migrations60 to 90% less time than by hand
- Decided by
- Migration lead; each owning team approves its own change
- Done when
- Every in-scope repository is merged with a passing build, or is listed as blocked with evidence and an acknowledged owner.
Illustrative
One repository, start to finish
A backend service repository is one of 1,180 in scope for a migration from hand-written value types to records.
- Agent
Applies the record change to 31 value types across the service's modules.
- Agent
A serialization test fails on field order, and a retry fails the same way.
- Agent
Opens no pull request; asks the migration lead on the request page, failing test attached.
- Decision
The migration lead rules field order is contract and excludes the two serialized types.
- Agent
Reruns on 29 types, passes build and tests, and opens the pull request.
- Agent
No review after two working days, so it chases the owning team's on-call reviewer.
- Decision
The reviewer reads the diff and merges it in the team's working hours.
| Status | Repositories | Share | Next action |
|---|---|---|---|
| Merged | 874 | 74.1% | None; reopen if reverted |
| Awaiting review | 141 | 11.9% | Chased on days 2 and 5 |
| Changes requested | 37 | 3.1% | Agent revising same pull request |
| Blocked, build failure | 52 | 4.4% | With the lead, logs attached |
| Reverted, reopened | 3 | 0.3% | Owning team asked for cause |
| Not yet run | 73 | 6.2% | Queued; added on day 7 |
Where it gets hard
It does not merge or judge behavior
The owning team merges. Whether a changed output is acceptable is a person's call, so the agent asks.
A green build can still be wrong
Where tests are thin a pass proves little, so changes get full review and a revert reopens the repository.
It needs the fleet's own records
It reads every in-scope repository, its build and test runner, the ownership record and the opt-out list.
What to measure
- Share of in-scope repositories merged
- Pull request review age
- Build failures per change
- Reverted changes
What comes next
- Group blocked repositories by failure cause, so one instruction fix clears many.
- Open a campaign when a security advisory names a dependency already in use.
- Carry pipeline migrations, where done means every downstream job still reads the new output.
The agent’s tools
- Source repositories and CI
Live toolConnection to your systems
What each connection does
- Source repositories and CI
- Read in-scope repositories, open pull requests and read build and test results for each change.
Workflow pricing
Scope the full workflow around your volume, business systems and required outcome.
Discuss workflow pricing →