All case studies
Spotify

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.

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.

Starts on

An approved migration, a newly in-scope repository or a pull request that has gone stale.

  1. 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
    1. 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.

  2. 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
    1. 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.

  3. 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
    1. 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.

    2. 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.

  1. Agent

    Applies the record change to 31 value types across the service's modules.

  2. Agent

    A serialization test fails on field order, and a retry fails the same way.

  3. Agent

    Opens no pull request; asks the migration lead on the request page, failing test attached.

  4. Decision

    The migration lead rules field order is contract and excludes the two serialized types.

  5. Agent

    Reruns on 29 types, passes build and tests, and opens the pull request.

  6. Agent

    No review after two working days, so it chases the owning team's on-call reviewer.

  7. Decision

    The reviewer reads the diff and merges it in the team's working hours.

Migration campaign report: value types to records
Instruction
Value types to records, serialized types excluded
Scope
1,180 repositories, 14 opted out
Done means
Checks pass and the owning team merges
As of
Day 9
StatusRepositoriesShareNext action
Merged87474.1%None; reopen if reverted
Awaiting review14111.9%Chased on days 2 and 5
Changes requested373.1%Agent revising same pull request
Blocked, build failure524.4%With the lead, logs attached
Reverted, reopened30.3%Owning team asked for cause
Not yet run736.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 →

Bring a workflow
like this one.