Skip to content

Commit cc9e720

Browse files
Pkylas007Prabha Kylasamiyer Sundara Rajan
andauthored
Getting Started Revision (#834)
Signed-off-by: Prabha Kylasamiyer Sundara Rajan <[email protected]> Co-authored-by: Prabha Kylasamiyer Sundara Rajan <[email protected]>
1 parent e614851 commit cc9e720

File tree

4 files changed

+99
-63
lines changed

4 files changed

+99
-63
lines changed

docs/getting_started.md

Lines changed: 99 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,24 @@
44
- [Overview](#overview)
55
- [Installation](#installation)
66
- [Configuration](#configuration)
7-
- [Start](#starting-the-server)
8-
- [Usage](#usage)
7+
- [Starting the RPC Server](#starting-the-rpc-server)
8+
- [Using Kai for analysis and fixes](#using-kai-for-analysis-and-fixes)
9+
- [Guided scenario](#guided-scenario)
910

1011
## Overview
1112

13+
Before you install Kai, you must:
14+
15+
- Create an API key for an LLM model.
16+
- Supported LLM providers: **OpenAI**, Amazon Bedrock, **Azure OpenAI**, DeepSeek, Google Gemini, Ollama
17+
- OpenAI-API-compatible endpoints such as OpenShift AI
18+
19+
- Install Language Support for Java(TM) by Red Hat extension
20+
- Install Java v17 and later
21+
- Install Maven v3.9+
22+
- Install Git and add it to the `$PATH` variable
23+
- Configure an application in Visual Studio Code
24+
1225
Running Kai consists of:
1326

1427
1. Installing the Kai VSCode extension
@@ -22,103 +35,126 @@ IDE extension.
2235

2336
## Configuration
2437

25-
Once the VSCode extension is installed, you are presented with the "Set up
26-
Konveyor" page. This page is where you as a user can configure Kai to suit your
27-
needs. This page can also be accessed by clicking "Help"->"Welcome" and finding
28-
"Set up Konveyor" in the "Walkthroughs" section.
38+
[![Kai first screen](https://i.ytimg.com/vi/IBa8B_RluGs/hqdefault.jpg)](https://youtu.be/IBa8B_RluGs)
39+
40+
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/IBa8B_RluGs" title="Kai configuration walkthrough" frameborder="0" allowfullscreen></iframe> -->
41+
42+
Click the Kai VSCode extension to perform the following tasks:
43+
1. [Configure Kai settings](#configure-kai-settings)
44+
1. [Configure settings for analysis](#configure-settings-for-analysis)
45+
1. [Starting the RPC server](#starting-the-rpc-server)
46+
1. [Using Kai for analysis and fixes](#using-kai-for-analysis-and-fixes)
47+
48+
> [!NOTE]
49+
> You must open an application in your VSCode workspace to use the Kai extension.
50+
51+
### Configure Kai settings
52+
53+
[![Kai configuration settings](https://i.ytimg.com/vi/BgWZcFT7XjQ/hqdefault.jpg)](https://youtu.be/BgWZcFT7XjQ)
54+
55+
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/BgWZcFT7XjQ" title="Kai configuration settings" frameborder="0" allowfullscreen></iframe> -->
56+
57+
Access the Kai settings from `Extensions > Konveyor AI Extension for VS Code settings icon > Settings`.
2958

30-
![image](images/walkthroughs_welcome.png)
59+
You can configure basic settings such as:
60+
- Configure the solution server endpoint
61+
- Select the editor view for analysis: diff or merge
62+
- (Optional) Choose the agent mode for automated analysis with manual review
63+
- (Optional) Choose the demo mode to use cached responses from the LLM
3164

32-
### Options
65+
### Configure settings for analysis
3366

34-
All of the following settings can be configured via the setup page or via
35-
modifying `settings.json`. For more details; see [configuration](./contrib/configuration.md) for a full list of
36-
available settings.
67+
You can configure the initial profile and other settings on the `Get Ready to Analyze` page or by modifying `settings.json`. For more details; see [configuration](./contrib/configuration.md) for a full list of available settings.
3768

38-
#### Override Analyzer Binary
69+
[![Kai profile settings](https://i.ytimg.com/vi/6YN_pGGMSW4/hqdefault.jpg)](https://youtu.be/6YN_pGGMSW4)
3970

40-
This allows you as a user to configure custom analyzer and Kai binaries as
41-
opposed to the default packaged ones. This shouldn't be necessary for most
42-
users. This can be useful for testing changes, please see the [contributing guide](contrib/dev_environment.md) for more information.
71+
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/6YN_pGGMSW4" title="Kai profile settings" frameborder="0" allowfullscreen></iframe> -->
4372

44-
#### Configure Custom Rules
73+
To go to the `Get Ready to Analyze` page,
74+
- Click `Konveyor extension > Open Konveyor Analysis View (icon) > Settings (icon)`.
75+
- Type `Ctrl + Shift + P` to open the Command Palette and type "Konveyor:Manage Analysis Profile".
4576

46-
This allows you as a user to configure custom rules for the Konveyor analyzer
47-
to use when running static code analysis. This can be done by selecting a
48-
directory where these rules exist.
77+
You can access the following configurations on the `Get Ready to Analyze` page:
4978

50-
For information on creating custom rules you can see the [documentation](https://github.com/konveyor/analyzer-lsp/blob/main/docs/rules.md#rules)
79+
- Select Profile
80+
- Configure a Label selector (source and target technologies)
81+
- Set rules (default and custom)
82+
- Configure the generative AI API key
5183

52-
#### Configure Analysis Arguments
84+
Edit these settings by using the `Profile Manager` page to reuse the configuration for multiple analyses.
5385

54-
This allows you as a user to define the sources and targets for static code
55-
analysis.
86+
#### Override analyzer binary
5687

57-
These are mutually exclusive options, you should select one or the other.
88+
You can configure custom analyzer and Kai binaries as opposed to the default packaged ones. This provision can be useful for testing changes though it shouldn't be necessary for most users. See the [contributing guide](contrib/dev_environment.md) for more information.
5889

59-
Sources and Targets are special [labels](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#labels). Selecting the sources and targets will generate the label selector for you.
90+
#### Configure custom rules
91+
92+
You can configure custom rules for the Konveyor analyzer to use when running static code analysis. To do so, edit `Set Rules` on the `Get Ready to Analyze` page to open the `Profile Manager`. You can select the directory that contains the custom rules.
93+
94+
For information about creating custom rules, see the [rules documentation](https://github.com/konveyor/analyzer-lsp/blob/main/docs/rules.md#rules).
95+
96+
#### Configure analysis arguments
97+
98+
On the `Profile Manager` page, you can select or create the sources and target technologies for the static code analysis. They are _**mutually exclusive**_ options: you should select one or the other.
99+
100+
Sources and Targets are special [labels](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#labels) recognized by the analyzer. Selecting the sources or targets will generate the label selector that filters rules for the analysis.
60101

61102
> [!NOTE]
62-
> These source and target labels are only coming from the [default rulesets](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#labels). If you want to use custom labels you must create the label selector manually.
103+
> These source and target labels are configured in the [default rulesets](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#labels). If you want to use custom labels for Kai analysis, you must create the label selector in the profile.
104+
105+
To use this option, type the name of the custom source or target technology:
63106

64-
To use this option click
107+
![image](images/edit-custom-target.png)
65108

66-
![image](images/walkthroughs_configure_analysis_source_and_targets.png)
109+
If you need/want to specify the label selector manually, you can define a specific label selector to use when querying the rulesets.
67110

68-
If you need/want to specify the label selector manually, you as a user can define a specific label selector to
69-
use when querying the rulesets.
111+
To understand the label selector syntax see the [rule label selector documentation](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#rule-label-selector)
70112

71-
To understand the label selector syntax see the [documentation](https://github.com/konveyor/analyzer-lsp/blob/main/docs/labels.md#rule-label-selector)
113+
<!-- To use this option click
72114
73-
To use this option click
115+
![image](images/walkthroughs_configure_analysis_label_selector.png) No longer found in the profile settings-->
74116

75-
![image](images/walkthroughs_configure_analysis_label_selector.png)
117+
#### Configure the generative AI API key
76118

77-
#### Configure Generative AI
119+
On the `Get Ready to Analyze` page, you can configure the LLM API key needed for Kai analysis.
78120

79-
This is where you set up the model configuration for kai to use. To see more information about this see the [llm selection](./llm_selection.md) documentation.
121+
[![Kai generative AI API key configuration](https://i.ytimg.com/vi/F4Va8KFqYV4/hqdefault.jpg)](https://youtu.be/F4Va8KFqYV4)
80122

81-
## Starting the server
123+
<!-- <iframe width="560" height="315" src="https://www.youtube.com/embed/F4Va8KFqYV4" title="Kai generative AI API key configuration" frameborder="0" allowfullscreen></iframe> -->
82124

83-
Click "Start Analyzer" to launch the RPC server. You can then click "Mark Done"
84-
to close the setup page.
125+
To see more information about LLM provider configuration, see the [LLM selection](./llm_selection.md) documentation.
85126

86-
![image](images/walkthroughs_start_server.png)
127+
## Starting the RPC server
87128

88-
## Usage
129+
Click `Start` to start the RPC server on the `Konveyor Analysis View` page. This action activates the `Run Analysis` button.
89130

90-
Now that Kai is installed and started, using the extension consists of running
91-
static code analysis and generating code fixes. Once analysis is performed, you
92-
are presented with a list of violations and their associated incidents. Kai
93-
currently allows the user to generate code fixes based on incidents.
131+
![image](images/start-rpc-server.png)
132+
133+
## Using Kai for analysis and fixes
134+
135+
Now that you installed and started Kai, you can use the Kai extension to run static code analysis and generate code fixes. Once analysis is performed, you can review a list of violations and their associated incidents. Currently, you can generate code fixes based on incidents.
94136

95137
### Running analysis
96138

97-
To start, the analysis view allows you to run a full analysis of the codebase
98-
based on the prior configured analysis arguments. After analysis completes, you
99-
will see violations and incidents generated as a result. On the left side of
100-
the extension, you will see a tree view of these incidents and the files where
101-
those incidents are present.
139+
After starting the RPC server on the `Konveyor Analysis View` page, you can run a full analysis of the codebase based on the prior configured analysis arguments by clicking `Run Analysis`.
140+
141+
> [!NOTE]
142+
> You must select a profile with necessary configurations such as source and target technologies before you run an analysis.
143+
144+
After analysis completes, you will see violations and incidents generated as a result. In the `Konveyor Issues` pane, you will see a tree view of these incidents and the files that contain these incidents.
102145

103146
### Generating fixes
104147

105148
Now that you have violations from analysis, you will want to begin generating
106-
code fixes based on these incidents. This can be done by selecting the `Resolve Incident` button. You can choose to resolve any number of incidents at a time by clicking the button associated with the number.
149+
code fixes based on these incidents. You can generate fix suggestions by selecting the spanner button associated with a specific issue or all issues.
107150

108-
![image](images/resolve_1_incident_button.png)
151+
![image](images/resolve-issues.png)
109152

110-
You can see more details if there are more than one incident by expanding the row. Here you will have more options for resolving incidents.
153+
You can see more details if there are more than one incident by expanding the issues row. Here, you will have more options for resolving incidents.
111154

112-
Once the fix is generated, you will be presented with a list of files that
113-
would be changed, and you are given the option to view, accept, or reject those
114-
changes. You can view this from an in-view diff editor via the analysis view,
115-
or from the _Konveyor Resolutions_ tab. When these changes are accepted, the changes will be reflected in the source code
116-
directly. Anytime a change is accepted, Kai will automatically rerun a partial
117-
analysis of the codebase that has changed to update whether an incident was
118-
resolved.
155+
Once the fix is generated, you can see a list of files that will be changed, and you are given the option to view, accept, or reject those changes. You can view this from an in-view diff editor via the analysis view, or in the `Konveyor Resolutions` pane. When you accept these changes, the changes are updated in the source code directly. Anytime you accept a change, Kai will automatically rerun a partial analysis of the updated codebase with the fix for an incident that was resolved.
119156

120-
## Guided Scenario
157+
## Guided scenario
121158

122-
Now that you understand how to get started with Kai, we suggest running through
123-
a [guided scenario](./scenarios/README.md) to get a better idea of how Kai can assist
124-
with the migration of an application.
159+
Now that you understand how to get started with Kai, we suggest that you go through
160+
a [guided scenario](./scenarios/README.md) to get a better idea of how Kai can assist with the migration of an application.

docs/images/edit-custom-target.png

41.5 KB
Loading

docs/images/resolve-issues.png

131 KB
Loading

docs/images/start-rpc-server.png

43.1 KB
Loading

0 commit comments

Comments
 (0)