MTA Developer Lightspeed Guide
Using the Migration Toolkit for Applications Developer Lightspeed to modernize your applications
Abstract
Making open source more inclusive
Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.
Chapter 1. Running an analysis and resolving issues
After you complete the configurations, the next step is running an analysis to identify the issues in the code and generate suggestions to address the issues. You can run an analysis by using MTA with Developer Lightspeed in the solution server mode or in the agent mode.
When you run an analysis using either mode, MTA with Developer Lightspeed automatically performs the following tasks:
- Displays issues in all the files in your project in the Issues pane.
- While generating suggestions to resolve issues, you can view the migration hints that explain the resolution and in which files the updates are applied.
- Generates new files in Resolutions pane. These files have the updates to the code that resolves the issues detected in the current analysis. You can review the changes, apply, or revert the updates.
If you apply all the resolutions, MTA with Developer Lightspeed applies the changes and triggers another analysis to check if there are more issues.
1.1. Running an analysis by using solution server
Solution server uses Retrieval Augmented Generation (RAG) to generate a resolution based on a context. Solution server derives the context from rules and past changes to similar issues in the codebase of your organization and generates a prompt for your large language model (LLM). The LLM generates migration hints for the issues that it detects based on the contextual prompt.
An analysis completed by the solution server identifies the issues in the code. It displays the success metrics for incidents and issues. Success metrics indicate the confidence level in applying the code fix based on how many times the update was applied in past analysis.
Prerequisites
- You installed the MTA distribution version 8.0.0 in your system.
- You installed Jave 17+ and Maven 3.9.9+ in your system.
- You installed the Migration Toolkit for Applications (MTA) extension version 8.0.0 in VS Code.
- You installed the latest version of Language Support for Java™ by Red Hat extension in Visual Studio (VS) Code.
- You opened a Java project in your VS Code workspace.
- You configured an analysis profile on the Konveyor Analysis View page.
Procedure
Verify that solution server is enabled in one of the following ways:
-
Type
Ctrl + Shift + P
in VS Code search (Linux/Windows system) andCmd + Shift + P
for Mac to go to the command palette. -
Enter
Preferences: Open User Settings (JSON)
to open thesettings.json
file. Ensure that
konveyor.solutionServer.enabled
is set totrue
.OR
- Go to Extensions > MTA with Developer Lightspeed > settings
- Click the Solution Server:Enabled option to enable the server.
-
Type
- Click the MTA with Developer Lightspeed extension and click Open Konveyor Analysis View.
- Select a profile for the analysis.
- Click Start to start the MTA RPC server.
- Click Run Analysis on the Konveyor Analysis View page.
To resolve the identified issues, see Applying resolutions after a solution server analysis.
1.2. Applying resolutions after a solution server analysis
When you use MTA with Developer Lightspeed to find a solution for the issues in your code, you first get a migration hint about what needs to be fixed to resolve the issues and the corresponding updates to your code in newly generated files. You can review the changes to the code in the new files and apply the resolutions.
MTA with Developer Lightspeed then triggers another round of analysis to check if more issues must be fixed in the code.
Prerequisites
- You installed the MTA distribution version 8.0.0 in your system.
- You installed Jave 17+ and Maven 3.9.9+ in your system.
- You installed the Migration Toolkit for Applications (MTA) extension version 8.0.0 in VS Code.
- You installed the latest version of Language Support for Java™ by Red Hat extension in Visual Studio (VS) Code.
- You opened a Java project in your VS Code workspace.
- You configured a profile on the Konveyor Analysis View page and ran an analysis.
Procedure
Review the issues from the Analysis results space of the Konveyor view analysis page by the following tabs:
- All: lists all incidents identified in your project.
- Files: lists all the files in your project for which the analysis identified issues that must be resolved.
- Issues: lists all issues across different files in your project.
- Use the Category drop down to filter issues based on the how crucial the fix is for the target migration. You can filter mandatory, potential, and optional issues.
- Click Has Success Rate to check how many times the same issue resolution was accepted in previous analysis.
- Click the solution tool to trigger automated updates to your code. If you applied any category filter, code updates are made for all incidents, specific files, or specific issues based on the filter. MTA with Developer Lightspeed generates new files with the updated code.
- Review and (optionally) edit the code update in a diff or a merge view.
- Click Apply all in the Resolutions pane to permanently apply the changes to your code.
1.3. Running an analysis in agent mode
In the agent mode, MTA with Developer Lightspeed planning agent creates the context about an issue and picks a sub agent that is most suited to resolve the issue. The sub agent runs an automated analysis to detect issues and generate files with the updated resolutions in one stream.
You can review the updated files and approve or reject the changes to the code. The agent runs another automated analysis to detect new issues in the code or diagnostic issues that your tool may generate following a previous analysis. If you allow the process to continue, MTA with Developer Lightspeed runs the stream again and generates a new files with the latest updates.
When using the agent mode, you can reject the changes or discontinue the stream but cannot edit the updated files during the stream.
Prerequisites
- You installed the MTA distribution version 8.0.0 in your system.
- You installed Jave 17+ and Maven 3.9.9+ in your system.
- You installed the Migration Toolkit for Applications (MTA) extension version 8.0.0 in VS Code.
- You installed the latest version of Language Support for Java™ by Red Hat extension in Visual Studio (VS) Code.
- You opened a Java project in your VS Code workspace.
- You configured an analysis profile on the Konveyor Analysis View page.
Procedure
Verify that agent mode is enabled in one of the following ways:
-
Type
Ctrl + Shift + P
in VS Code search (Linux/Windows system) andCmd + Shift + P
for Mac to go to the command palette. -
Enter
Preferences: Open User Settings (JSON)
to open thesettings.json
file. Ensure that
konveyor.kai.agentMode
is set totrue
.OR
- Go to Extensions > MTA with Developer Lightspeed > settings
- Click the Agent Mode option to enable the server.
-
Type
- Click the MTA with Developer Lightspeed extension and click Open Konveyor Analysis View.
- Select a profile for the analysis.
- Click Start to start the MTA RPC server.
- Click Run Analysis on the Konveyor Analysis View page. The Resolution Details tab opens where you can view the automated analysis that makes changes in applicable files.
- Click Review Changes option to open the editor that shows the diff view of the modified file.
- Review the changes and click Apply to update the file with all the changes or Reject to reject all changes. If you applied the changes, then MTA with Developer Lightspeed creates the updated file with code changes.
- Open Source Control to access the updated file.
- In the Resolution Details view, accept the proposal from MTA with Developer Lightspeed to make further changes. The stream of analysis repeats after which you can review and accept change. MTA with Developer Lightspeed creates the file with the code changes and the stream continues until you reject the proposal for further analysis.