Simon Bisson
Contributor

GitHub Copilot learns new tricks

analysis
07 Nov 20248 mins
Artificial IntelligenceDevelopment ToolsGenerative AI

GitHub and Microsoft have taken their AI-powered programming assistant into new territories, tackling code reviews, simple web apps, Java upgrades, and Azure help and troubleshooting.

colorfully dressed juggler clown juggling brightly colored blue green red yellow balls against a bright purple background
Credit: TSViPhoto / Shutterstock

The role of GitHub as part of Microsoft’s developer division is much more than providing Microsoft and its customers with a mix of cloud-hosted and on-premises source code version control. First GitHub branched out into offering a CI/CD platform with a build and test runner in the shape of GitHub Actions. Then it added tools to help reduce the risk of common bugs and to automate patching known security holes by managing dependencies.

These features have all built on its role as the place where we store code, using that as a lever to help developers build all types of projects, from hobbyist hacks to scientific computing. GitHub has billions of lines of code that make up the largest software projects. All that code, much of it with permissive licenses, gives GitHub unprecedented insight into developer trends, which it wraps up in its annual Octoverse report on the programming languages and development tools we’re using.

That massive code base has allowed GitHub to build a set of AI-powered programming assistants, drawing on the collective experience of millions of developers to provide a set of Copilots that plug into familiar developer tools. I think of them as “AI pair programmers,” not so much writing code for you (though you can use them that way if you want) as offering a pool of collective knowledge to hint at alternate ways of doing things, helping solve problems and get around blockages.

GitHub Universe 2024, held last week in San Francisco, saw GitHub expand its roster of Copilots, adding new AI-powered tools and services, as well as new options for its existing platform. These go beyond the semantic space explored by the original GitHub Copilot to provide AI agent-based services to help with migration tasks.

Using GitHub Copilot for code review

One interesting new use for these technologies is GitHub Copilot’s Code Review tool. This takes a similar approach to Microsoft’s Editor in Word, checking the contents of a pull request using Copilot as an additional reviewer. Reviews can be across a section of code or all the changes made since the last push. GitHub notes that the service won’t find all the issues in your code and may make mistakes. For now, you should treat it as an assistive technology and still run tests after using it, or use it alongside human reviewers. There is a feedback loop, where you can comment on the suggestions the service makes, which will drive more training and fine-tuning.

Like a human code reviewer, GitHub’s Copilot will comment on your code and offer quick fixes. The tool is available inside GitHub workspaces or through the Copilot plug-in in Visual Studio Code. The quicker choice of reviewing a selected snippet of code is available for all supported languages, while the deeper review of changes is only available for a subset of more popular languages, such as C#, Java, JavaScript (and TypeScript), and Python.

Most reviews are likely to be manually triggered, but there’s the option to ensure all pull requests are reviewed by the service. Here developer leads and repository owners can set rules for their branches, ensuring that Copilot reviews are run on all new pull requests. This approach will automatically comment code, allowing other members of the team to make or accept changes as part of merging a pull request.

GitHub Spark: AI-powered development for everyone

GitHub also announced GitHub Spark, an AI-powered development tool for small cloud-hosted applications. Perhaps best thought of as a tool that fits in between the development scratchpad of Glitch and the low-code and no-code Power Platform, Spark gives you a framework for quickly building and sharing application ideas with colleagues, using natural language.

GitHub Spark is an interesting experiment, delivering a new development feedback loop where you quickly get to iterate through changes to your application. All the variants of your app are stored in a history view, so you can jump back to an older version to start a new set of iterations. Apps are delivered as progressive web apps (PWAs) and hosted by GitHub, with a managed NoSQL store for your data.

It’s still early days for Spark, with a long to-do list for the development team. But the idea is fascinating, extending what can be done with Copilots into a tool for anyone to build an application.

Using AI to upgrade Java

Microsoft’s own developer tools teams have been working with GitHub to find new uses for GitHub Copilot. One interesting new possibility is using it to provide upgrade help for Java developers. A lot of older Java applications out there could benefit from upgrading to newer releases of Java, frameworks like Spring Boot, or newer versions of APIs and services.

Updating that code requires more than switching to a recent version of the JDK, as applications have many dependencies that will need updating at the same time. This can take a lot of time to follow different update paths and remediate errors and issues. Instead of taking your time, the new GitHub Copilot upgrade assistant for Java uses an agentic workflow, taking advantage of the ability of AI-based applications to construct their own workflows that bring in different tasks as needed. It uses the AI to build an upgrade plan for you.

You start with an existing project and the details of build tools and frameworks, along with a target Java version (for example upgrading from Java 8 to Java 21). The Copilot upgrade assistant analyses your code base and generates a list of the necessary steps to run your upgrade, presenting it as a set of GitHub issues that you can check before running the update.

Once you’re happy with the tasks, the tool takes you to a dashboard where you can watch the update process, including how Copilot rewrites code for you. You can stop and start the process at any time, drilling down into tasks for more information on just how the AI-based code is working. It’s good to have this level of transparency, as you need to be able to trust the AI, especially when it’s working on business-critical software.

As this is an agentic AI process, the service can detect errors and fix them, launching sub-agents that make changes, rebuild, and retest code. Interestingly if a fix doesn’t work, it’ll take another approach, using the shared knowledge of the Java developers whose work has been used to train the Copilot Java model. Like other GitHub Copilots, changes that work are used to fine-tune the model, reducing the risk of errors in future runs. That goes for manual updates and changes too.

The upgrade tool takes advantage of Git, saving changes in a new branch. You can continue supporting the original code without affecting the updated version, which can be tested at the same time. The agent will mark any commits it makes with the details of the action taken, again giving you a guide to how it has handled upgrading your code. It won’t make the final pull request—that’s left for you once you’re satisfied with the upgraded Java application and it’s passed all your tests.

An Azure Copilot in VS Code

Other new GitHub Copilot features are aimed at reducing the number of times developers have to context switch. One, designed to work inside Visual Studio Code, brings Azure infrastructure tools into the GitHub Copilot chat pane, with a new @azure operator.

Besides helping quickly get the syntax for Azure CLI commands, it can help you find features and services you may not have considered. The underlying tool includes a retrieval-augmented generation–based search that uses Azure documentation to deliver always-up-to-date information about the platform and how to use it. Other options help you pick app templates and provide details that help you build and deploy applications, for example, quickly finding an appropriate region where a service you want to use is available.

Other tools help troubleshoot problems by accessing logs and other diagnostic tools to come up with suggested fixes. This is one place where the tools developed for agentic AI have a role to play, providing the APIs and data sources needed to construct a complex diagnostic workflow on the fly. Those same tools can help operate your environment, allowing you to build, troubleshoot, and run a development Azure instance from the same code editor you use to build your application.

Having an assistant in your development tools isn’t about having an AI write code for you. That’s not what generative AI does, at least not yet. Instead, you’re getting a pair programmer that’s made up of the expertise of everyone who’s been working on a similar problem and used GitHub to save their code. It’s about hints, suggested code, and yes, automations that simplify complex tasks. As one of the pioneers of using large language models at scale, GitHub is now looking at what comes next—and it might be very interesting indeed.

Simon Bisson
Contributor

Author of InfoWorld's Enterprise Microsoft blog, Simon Bisson prefers to think of “career” as a verb rather than a noun, having worked in academic and telecoms research, as well as having been the CTO of a startup, running the technical side of UK Online (the first national ISP with content as well as connections), before moving into consultancy and technology strategy. He’s built plenty of large-scale web applications, designed architectures for multi-terabyte online image stores, implemented B2B information hubs, and come up with next generation mobile network architectures and knowledge management solutions. In between doing all that, he’s been a freelance journalist since the early days of the web and writes about everything from enterprise architecture down to gadgets.

More from this author

Exit mobile version