Skip to main content

Forking Repman (our story)

· 3 min read
Stephan Hochdörfer
Head of IT Business Operations

We've been using a private Composer repository since the early days of Composer, starting with Satis, then migrating to Satisfy, and finally to Repman for better organization support.

However, Repman is no longer actively maintained, leaving us with outdated PHP and Symfony versions behind. So what to do?

We could either migrate again or try to maintain a custom fork for our own needs. For now, we decided to go with the latter option. And this is our story.

Upgrading Repman

To make our Repman fork to support PHP 8.5 and Symfony 8.0, we used Rector to automatically refactor the code. We did the upgrade in smaller iterations:

  • From Symfony 5.4 to 6.0
  • From 6.0 to 6.4
  • From 6.4 to 7.0
  • From 7.0 to 7.4
  • From 7.4 to 8.0 and 8.1

The process was relatively straightforward, but in-depth testing revealed issues that required a few manual fixes. After about 2 days, we had a usable application ready.

Challenges and Solutions

Rector couldn't fix the unit tests, leaving us with a ton of failing tests. We tried using AI to fix them all at once, but it didn't work as expected.

We then decided to fix each test one by one, removing all failing tests and adding one test case class at a time. Doing this in a single session in the Coding agent proved to be beneficial since the agent could learn how previous errors have been fixed. This approach took more time but worked better and helped us learn more about the code base.

We also used the Coding Agent to fix all PHPStan issues, starting with the initial analysis level of 3 and moving to the max level one by one. This worked flawlessly and was quickly done.

Simplification

Once we had all tests working and PHPStan issues fixed, we simplified the code by removing unused features, such as BitBucket integration, telemetry, the user registration flow, and more.

Also, we've introduced the Asset Mapper to manage assets such as CSS and JS files. This change allows us to control the loading of these assets, rather than relying on direct loading from a CDN.

Conclusion

The combination of Rector and the AI Coding agent was a great learning experience for us and made the migration a lot simpler.

Would we recommend others doing the same? Probably not.

In our case, it makes sense since we self-host a lot of tools and managing the fork for us allows a deeper integration of Repman with some other tools we use on a daily basis. And thanks to Renovate Bot, we get automatic updates for the dependencies, making sure we don't fall behind anymore.