Papaya Pay · 2021 – 2026
Five years of cleaning up a legacy PHP portal
Stack: PHP 8.3, PHPUnit, GitLab CI, OpenTelemetry, Sentry, Claude Code
- Added the first test suite and CI job, and later caught the harness quietly stopping partway through
- PHP 7.3 to 8.3 across six services, including one that had already been rolled back twice
- Deleted a few hundred files based on 60 days of access logs and production traces instead of guesswork
The internal portal our operations team uses to process bills is the oldest code at the company, and it’s also the code the most people touch every day. I was its main engineer from when I joined in 2021 until I left in 2026. When I started it was procedural PHP with no tests at all, and this is roughly how that changed.
Adding Tests (2021)
In my second week I added PHPUnit, a PSR-4 model layer, and a CI job to run the tests. One of my teammates reviewed it and wrote, “Our first admin php test .. tear .. making me weepy.” From then on every feature shipped with tests.
Years later, in 2026, I noticed the test harness had been quietly dying partway through the suite and still reporting success, so for a while we had a lot less coverage than we thought we did. Fixing the harness was one of the more important changes I made that year, and it’s a good reminder that a green checkmark is only as trustworthy as the thing producing it.
Upgrading Instead of Rewriting (2024)
In 2024 I took six services from PHP 7.3 to 8.3. One of them had already been attempted twice and rolled back both times for a regression nobody could pin down. It turned out a bot-dispatch job behaved differently under PHP 8 without ever throwing an error, and tracking that down is what finally made the third attempt stick. Parse Server went from 3 to 6 the same way, with Terraform-managed cutovers for staging and then production.
Only Deleting What Production Says Is Dead (2026)
By 2026 the portal had years’ worth of pages nobody could say for sure were still used. Instead of guessing, I pulled 60 days of access logs and about four months of production traces and only deleted what had zero traffic. That came out to 245 files, and the repo got a lot smaller and easier to reason about.
The same traces turned up two other problems I wouldn’t have gone looking for. One page was re-downloading the same bill images every time it loaded, which added up to about 15 GB a week, and a fall-through in the code was throwing a few hundred fatal errors a month. Both were small fixes once I could actually see them happening.
The AI Part
I did most of the 2026 work with Claude Code. Since this code is so close to money, the rules were the same as they’d be for a person: nothing merges without tests, and nothing gets deleted without the logs to back it up. It was great at pulling the log and trace data together and at the grunt work, but I was still the one deciding what got deleted.