MirLabs / The blog / Maintenance / Security / Open source

My site updates itself while I sleep, and I approve in the morning

Uplift moves PHP, Symfony and the dependencies up within limits I set, runs the tests and lets me decide. First real run: Symfony 7.3 to 7.4.21, 40 packages.

· Cyril Delage · 2 min read · Lire en français

A city at night, full of lights, seen from above
Photo: Clark Gu on Unsplash

Updating a Symfony project is the job you always put off. Nobody sees it, it brings nothing right away, and it can break everything. So you wait. Then a security flaw comes out, and a year of lag becomes a problem overnight.

I have several sites and little time. I wanted upgrades to prepare themselves, without ever going to production without my approval. That became Uplift, an open source Symfony bundle, with its companion Rehearsal.

What a run does

  1. It moves versions up, within a policy I set. For each layer (PHP, Symfony, the other packages): nothing, patches only, minor versions, or major versions. And a PHP ceiling for servers that cannot go further.
  2. It moves one step at a time. First the latest minor version, then the next major, never a jump of three versions at once. An old project catches up over several runs, each one tested.
  3. It fixes what has become deprecated, with Rector.
  4. It adopts the framework's new features when it is safe: the #[AsCommand] attribute, #[MapRequestPayload], that kind of thing.
  5. It runs the tests and writes a report.
  6. It pushes nothing and deploys nothing. The change waits in my back office, where I approve or reject it.

The first real run

Before writing about it, I ran it on a real Symfony 7.3 application. The result:

  • Symfony 7.3.11 → 7.4.21;
  • 40 packages updated, 11 composer.json constraints rewritten;
  • 1 file fixed by Rector;
  • 2 new features adopted;
  • tests green.

That first test mostly served to find a bug. The test process inherited the development environment, which made the tests fail. Uplift concluded that every update broke the project, and rolled everything back. On paper, it all worked. That is why this test now runs on every change to the bundle.

Why not Dependabot or Renovate?

They are very good at proposing new package versions. But they stop there: they do not rewrite code that becomes deprecated, do not adopt the framework's new features, and do not know your server's limits. Uplift does the full loop for PHP and Symfony, then leaves the decision to me.

In the morning

The change lands in Rehearsal, a page of my admin, as a card: "7.3.11 → 7.4.21, 40 packages, tests passed". I try it, I approve or reject it with a comment. Five minutes, instead of half a day.

If you have Symfony projects falling behind, both bundles are free. And if you would rather someone took care of it, write to me.

A project like this one?AI integration, a site to make readable by assistants, security: let's talk.
Contact me

Read next