Table of Contents
Recently, we had to upgrade a mixed codebase, which included both Quarkus and Spring Boot applications, from Java 17 to Java 21. Typically, this involves a fair amount of manual effort, like updating pom.xml, resolving deprecated APIs, tweaking compiler arguments, fixing test failures, and ensuring that the build remains clean.
But this time, we had a secret weapon: GitHub Copilot in Agent Mode.
And what would usually take three to four hours was completed in just 20 minutes.
How the Copilot Agent Handled the Upgrade
We gave straightforward instructions to the Copilot Agent: “Upgrade the project from Java 17 to Java 21, then build the repo and run all the test cases.”
And that was enough. The agent understood the context of the codebase and began working like a developer already familiar with the project’s layout.
Copilot Agent began by updating the pom.xml:
- It bumped the java.version property to 21
- Updated the maven-compiler-plugin configuration accordingly
- Verified that the dependencies, especially for Spring Boot and Quarkus, were compatible with Java 21
Once those changes were made, the agent initiated a Maven build. As expected, a few compilation errors emerged. These included deprecated classes, stricter type checks, and some older APIs no longer behaving the same way in Java 21.
Rather than getting stuck or requiring us to step in, Copilot Agent systematically tackled each issue. It identified the source of the error, made the necessary code adjustments, and recompiled. This process is repeated in a cycle—edit, build, fix—until the codebase compiled cleanly.
With the compilation step complete, Copilot moved on to running the test suite. A few tests failed due to subtle behaviour differences introduced by the new Java version. Again, the agent interpreted the stack traces, made appropriate code changes, and reran the tests.
In the end, every test passed, and we had a fully functioning build running on Java 21.
While Copilot handled the heavy lifting, it wasn’t completely autonomous. At every stage, we had to click “Continue” to authorise the next step.
Even though this kept engineers in the loop, we’d love to see an option to enable “autonomous mode” in future releases, especially for workflows like this, where it’s safe to let the agent operate end-to-end without human intervention.
Beyond that, a few tasks still required manual intervention to complete the migration:
- We had to update our CI/CD pipeline to pull the correct Java 21 base image to ensure builds and deployments aligned with the new version.
- A round of smoke tests was conducted manually to validate that nothing broke in our staging and pre-production environments.
These were minor tasks, but they were essential in ensuring a clean transition across environments.
With Copilot handling the routine upgrade tasks, our team focused on validation, stability, and deployment-readiness — speeding up a three to four hours job to just 20 minutes.
What Impressed Us
What stood out the most was how human-like the Copilot’s process was.
It didn’t try to apply a one-shot transformation. Instead, it worked incrementally — building, checking, fixing, and rerunning — just like we would have done. It truly felt like working with a helpful teammate who was focused, fast, and smart.
Final Thoughts
What could have been a tedious and error-prone upgrade turned into a surprisingly streamlined experience. GitHub Copilot Agent didn’t just save us time—it actively collaborated with us.
If you’re already using GitHub Copilot and haven’t tried Agent Mode, this is the perfect opportunity. Whether you’re upgrading Java versions, cleaning up tech debt, or performing large-scale changes, Copilot Agent can reduce the time and effort significantly, and make the entire process more engaging.
Have you tried something similar with Copilot Agent or another AI tool?
We’d love to hear how it worked for you — drop a comment!