Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This quickstart shows you how to create and apply your own tasks when you use GitHub Copilot app modernization.
In code development, enterprises often have different processes and controls to adhere to their organizational policies and business needs. This area is where My Tasks (Custom) come in. Your own task is generated by analyzing code commits from already-migrated code. The task then guides Copilot to remediate code, following the pattern established by the already-migrated code.
The following video demonstrates using GitHub Copilot app modernization to create and apply your own custom task to migrate a Java project to Azure:
Prerequisites
- A GitHub account with an active GitHub Copilot subscription under any plan.
- One of the following IDEs:
- The latest version of Visual Studio Code. Must be version 1.101 or later.
- GitHub Copilot in Visual Studio Code. For setup instructions, see Set up GitHub Copilot in Visual Studio Code. Be sure to sign in to your GitHub account within Visual Studio Code.
- GitHub Copilot app modernization. Restart Visual Studio Code after installation.
- The latest version of IntelliJ IDEA. Must be version 2023.3 or later.
- GitHub Copilot. Must be version 1.5.59 or later. For more instructions, see Set up GitHub Copilot in IntelliJ IDEA. Be sure to sign in to your GitHub account within IntelliJ IDEA.
- GitHub Copilot app modernization. Restart IntelliJ IDEA after installation. If you don't have GitHub Copilot installed, you can install GitHub Copilot app modernization directly.
- The latest version of Visual Studio Code. Must be version 1.101 or later.
- Java 21 or later.
- Maven or Gradle to build Java projects.
Note
If you're using Gradle, only the Gradle wrapper version 5+ is supported. The Kotlin Domain Specific Language (DSL) isn't supported.
The function My Tasks isn't supported yet for IntelliJ IDEA.
Create your own task
We now support three ways to add references: Git commits, external links, and text files. You can use one or more methods at a time.
Use Git commits
The following steps provide an example of creating your own task by using Git commits as references:
Clone the Java migration copilot samples repository.
In Visual Studio Code, open the
rabbitmq-senderproject folder from the cloned repository. Then, switch to the source branch.In the Activity sidebar, open the GitHub Copilot app modernization extension pane, hover over the TASKS section, and then select Create a Custom Task.
A
task.mdfile opens. In the Task Name field, enter Custom task migrate rabbitmq. In the Task Prompt field, enter You are a Spring Boot developer assistant, follow the commit to migrate from rabbitmq to servicebus.Select Add References and then select Git commits in the pop-up dialog box.
Search for the commit that migrates RabbitMQ by typing migrate rabbitmq to service bus. Select the corresponding commit and then select OK.
Select Save. Your custom task for migrating
rabbitmqnow appears in the TASKS - My Tasks section.
Use external links and text files
The following steps show an example of creating your own task by using external links and text files as references:
Open the
task.mdfile by following the predefined steps in the GitHub Copilot app modernization extension.In the opened
task.mdfile, enter the following information:- Task Name: Expose health endpoint via Spring Boot Actuator.
- Task Prompt: You are a Spring Boot developer assistant, follow the Spring Boot Actuator documentation to add basic health endpoints for Azure Container Apps deployment.
Select Add References. In the pop-up window, select External links, then paste the following URL:
https://docs.spring.io/spring-boot/reference/actuator/endpoints.htmland press Enter to confirm.Create a file containing the following content:
In this migration, only expose the health endpoints over web, use the following property: management.endpoints.web.exposure.include=healthSelect Add References again, and this time select Text Files. Locate the file you created and then select Select File.
You should now see two references added: one external link and one text file. Select Save to finalize and create the task.
Share your own task
Use the following steps to share your task with others:
Copy the folder located under .github/appmod/custom-tasks that contains your created task, and share it with the intended recipient.
On the recipient's side, create a .github/appmod/custom-tasks directory within the source path of their project.
Paste the task folder into this directory and then select Refresh Task in the extension pane.
The task now appears in the TASKS - My Tasks section, ready to be used.
Apply your own task
Use the following steps to apply your own task:
Select Run at the bottom of the file. Or find your own task in the TASKS - My Tasks section of GitHub Copilot app modernization pane and run the task by selecting Run Task.
The Copilot chat window opens in Agent Mode and automatically executes the following steps:
- Creates plan.md and progress.md.
- Checks the version control status and checks out a new migration branch.
- Performs code migration.
- Runs validations: Build, Tests, CVE, Consistency, and Completeness.
- Generates a summary.md file.
If the agent stops while waiting for your confirmation or is interrupted during execution, enter Continue to proceed.
After all steps finished, review the code changes and then select Keep to confirm in chat window.
Update or delete your own task
Locate the Custom task migrate rabbitmq in the TASKS - My Tasks section and then right-click to open the context menu and choose one of the following options:
- Edit to update the task.
- Delete to remove the task.