AI / Automation / Developer tools / Magento

How to make progress on the job you keep putting off

A slow deployment pipeline I had put off for years went from about 29 minutes to about 10. The AI did the research and the measuring. I kept the goal and the decisions.

On this page
  1. The project I kept putting off
  2. What I could do, and what I couldn't afford to learn
  3. Handing the research to the AI
  4. The safety net: tests, safe branches and measuring everything
  5. The results: from about 29 minutes to about 10
  6. The change that did nothing, and why I reverted it
  7. What I kept for myself
  8. How to try this on your own put-off project

The project I kept putting off

Everyone has a job like this. Mine was a slow deployment pipeline.

For years I had a deployment pipeline that worked but was slow. A full run for a client’s Magento shop took about half an hour, from pushing code to having it live on the test server and checked.

I knew it could be much faster. I also knew exactly why I hadn’t done it. It was complicated, it touched a lot of moving parts, and the work itself goes like this: change one setting, run the pipeline, wait, check what happened, adjust it by hand, run it again. Every check costs another half hour. It is exceptionally boring, laborious work, and every time I looked at it, something else came along and the pipeline went back on the shelf.

What I could do, and what I couldn’t afford to learn

I built the deployment myself, using Deployer and a fairly basic layer of GitLab CI around it. I understand what a good deployment needs to do, and I know what each step is for.

What I don’t have is the time to learn every option that GitLab CI offers, or to keep up as those options change. Finding the right setting, testing it, measuring it and trying the next one would have taken me weeks of my time. That is the real reason the project never got done: I could have done it, but I couldn’t afford the time to learn enough to do it well.

Handing the research to the AI

So I split the job. I stayed in charge of the goal and the decisions. The AI took the part that eats time: reading the documentation, finding the options, making the changes and measuring what each one did.

The goal was simple: a full deployment in about five minutes. I also told it what must not happen: nothing untested reaches a live server.

I did the work in Claude Code, on my own machine, using sub agents to review each change and to run the tests afterwards. So every change was checked twice: once by a reviewer that had not written it, and once by the test run.

The safety net: tests, safe branches and measuring everything

Letting an AI change a deployment pipeline sounds risky, and without a safety net it would be. Three things made it safe enough for me.

  1. Automated tests

    The project already had automated tests. If a change broke something, the pipeline would say so before anything reached a live server.

  2. Branches that cannot deploy

    All the experiments ran on separate branches that were set up so they could never deploy anywhere. The AI could try things freely, and the worst case was a failed test run.

  3. Measured against the same code

    Every change was measured against the same code. I did not accept "this should be faster". Each change got three runs on the same code, and I compared the numbers with the three runs before it. If the numbers did not improve, the change did not stay.

The results: from about 29 minutes to about 10

The whole pipeline, from first job to last, went from a median of about 29 minutes to about 10 to 11 minutes, with the same code throughout.

MeasureBeforeAfter
Full pipeline including deployabout 29 minabout 10 to 11 min
Build and test onlyabout 16 minabout 4 to 5 min
Deploy job aloneabout 4.5 minabout 3 min
Time jobs sat waiting for the build machineabout 15 min or moreunder 1 min
Before and after, one full pipeline with deploy to the test server
Before: pipeline 3073153502, 16 November 2026. Start to finish 28m 31s, summed job run time 18m 30s. Hatched bars show time a job waited for a runner. Before: pipeline 3073153502, 16 November 2026 0 min 5 min 10 min 15 min 20 min 25 min 30 min lint php lint php: waiting 48s lint php: running 13s 13s lint yaml lint yaml: waiting 2m 43s lint yaml: running 6s 6s lint json lint json: waiting 4m 31s lint json: running 7s 7s prepare prepare: waiting 1m 41s prepare: running 2m 14s 2m 14s phpstan phpstan: waiting 15s phpstan: running 1m 44s 1m 44s unit tests unit tests: waiting 31s unit tests: running 1m 49s 1m 49s artifact-build artifact-build: waiting 38s artifact-build: running 3m 30s 3m 30s deploy (staging) deploy (staging): running 4m 34s 4m 34s smoke test smoke test: waiting 35s smoke test: running 1m 23s 1m 23s Sentry release Sentry release: waiting 2m 56s Sentry release: running 1m 9s 1m 9s platform suite platform suite: waiting 3m 7s platform suite: running 1m 41s 1m 41s done 28m 31s
After: pipeline 3128144509, 29 November 2026. Start to finish 10m 35s, summed job run time 13m 6s. Hatched bars show time a job waited for a runner. After: pipeline 3128144509, 29 November 2026 0 min 5 min 10 min 15 min 20 min 25 min 30 min lint php lint php: waiting 3s lint php: running 18s 18s lint yaml lint yaml: waiting 4s lint yaml: running 13s 13s lint json lint json: waiting 5s lint json: running 14s 14s prepare prepare: waiting 18s prepare: running 1m 56s 1m 56s phpstan phpstan: waiting 2s phpstan: running 58s 58s unit tests unit tests: waiting 3s unit tests: running 43s 43s artifact-build artifact-build: waiting 4s artifact-build: running 2m 5s 2m 5s deploy (staging) deploy (staging): running 3m 27s 3m 27s smoke test smoke test: waiting 3s smoke test: running 34s 34s Sentry release Sentry release: waiting 4s Sentry release: running 39s 39s platform suite platform suite: waiting 1s platform suite: running 1m 59s 1m 59s done 10m 35s
One full pipeline before and after, on the same 30 minute scale: lint, build and test on the self-hosted runner, deploy to staging on a GitLab shared runner, then three checks. GitLab job timestamps of pipelines 3073153502 (16 November 2026, 28m 31s) and 3128144509 (29 November 2026, 10m 35s). One run each (n=1).

The build and test time came down in steps, and each step was measured on its own.

StepBuild and test time
Starting pointabout 16 min
More jobs allowed to run at once on the build machineabout 9 to 11 min
Jobs stop re-uploading the same large filesabout 6 to 6.5 min
Jobs start as soon as the jobs they depend on finishabout 4 to 5 min
Build and test time after each change, three runs each on the same code

Three changes did most of the work. I’ll show each one in a few lines.

1. Let jobs start when their dependencies are done, not when the whole previous stage is done. GitLab calls this needs.

build:
  needs: [prepare]
tests:
  needs: [prepare]
analysis:
  needs: [prepare]
linting build and test deploy post-deploy checks
BEFORE lint php lint yaml lint json prepare phpstan unit tests artifact-build deploy smoke test Sentry release platform suite one at a time: the runner had 4 workers for 10 entries every job waits about 1m 40s before it starts
AFTER lint php lint yaml lint json prepare starts at once (needs: []) phpstan unit tests artifact-build needs deploy release file must pass must pass (stage order) smoke test Sentry release platform suite needs
How the jobs depend on each other, before and after. Solid arrows: the job starts when the one it points from finishes. Dashed lines: the deploy waits for these to pass, but takes nothing from them.

2. Stop every job uploading the same large folders. Each job was uploading hundreds of megabytes that nothing downstream needed. That one was my own doing: I had misunderstood how artifacts work when I set the pipeline up, all those years ago.

tests:
  artifacts: {}      # nothing to upload
build:
  artifacts:
    paths:
      - artifacts/   # only the finished build

3. Allow more jobs to run at once on the build machine. The runner was sharing four workers between ten configured projects, so jobs sat idle between steps. Raising the limit cut waiting time from about 12 minutes to about 15 seconds.

concurrent = 12

A word on why I have my own build machine. I use the free cloud version of GitLab, and I was running out of free build minutes. I didn’t want to move everything onto my own infrastructure yet, so I set up a runner on my Mac Studio using Docker. That meant I never had to worry about minutes, and I could concentrate on the pipeline itself instead of rebuilding everything around it.

The change that did nothing, and why I reverted it

The first thing the AI tried was a per-project setting on the build machine. It ran three pipelines and the numbers did not move, so it put the setting back from the backup.

I know very little about how these runners work, and I would have spent ages on this. The AI found the real cause on its own, from the job traces: the machine was serving ten projects with only four workers, and the polling from the other nine was blocking the one being tested. The fix was the global limit, not the per-project one.

That is why I measured everything. Without the before and after numbers, we would have kept a change that did nothing and believed it worked.

What I kept for myself

I did not hand over the decisions. The AI proposed and measured, and I approved. Anything that touched shared equipment, such as the settings on the build machine other projects also use, only changed after I said yes, and I kept a backup so it could be put back.

I also chose what to leave alone. A few things in the pipeline looked odd and had no recorded reason, and I decided to leave them for now instead of changing everything in one go. Speed was the goal, and it was not worth risking a live shop to tidy up.

One honest limit: tests only protect what they cover. They gave me the confidence to let the AI work, but they are only as good as the things somebody thought to test.

How to try this on your own put-off project

Most of this has nothing to do with Magento. If you have a slow, dull job that you keep putting off, the same method should work.

  • Write the goal down as a number, for example "a deployment in five minutes".
  • Say what must never happen, and make sure something automatic will catch it.
  • Let the AI experiment where it cannot cause harm.
  • Measure every change on the same code, three runs before and three after.
  • Keep what the numbers support and revert what they don't.
  • Keep the decisions for yourself.

I’m now looking at making this reusable for other people, which needs more work to make it generic. If that would be useful to you, get in touch.

Comments