Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canceling fix generation doesn't do anything #178

Closed
pranavgaikwad opened this issue Jan 8, 2025 · 1 comment · Fixed by #204
Closed

Canceling fix generation doesn't do anything #178

pranavgaikwad opened this issue Jan 8, 2025 · 1 comment · Fixed by #204
Assignees
Labels
bug Something isn't working

Comments

@pranavgaikwad
Copy link
Contributor

When you press the Cancel button when generating a fix, nothing happens.

Image
@pranavgaikwad pranavgaikwad added the bug Something isn't working label Jan 8, 2025
@sjd78
Copy link
Member

sjd78 commented Jan 9, 2025

Some analysis

This button is display on the "Konveyor Analysis View". The webview will send a CANCEL_SOLUTION webview messages, but the message in not current handled in the extension (vscode/src/webviewMessageHandler.ts).

The message will need to be implemented.

The getSolution implementation doesn't currently include an abort signal / option:

/**
* Request the server to __getCodeplanAgentSolution__
*
* Will only run if the sever state is: `running`
*/
public async getSolution(
state: ExtensionState,
incident: Incident,
violation: Violation,
): Promise<void> {
// TODO: Ensure serverState is running
if (!this.rpcConnection) {
vscode.window.showErrorMessage("RPC connection is not established.");
return;
}
this.fireSolutionStateChange(true);
const enhancedIncident = {
...incident,
ruleset_name: violation.category || "default_ruleset",
violation_name: violation.description || "default_violation",
};
const maxPriority = getConfigMaxPriority();
const maxDepth = getConfigMaxDepth();
const maxIterations = getConfigMaxIterations();
try {
const request = {
file_path: "",
incidents: [enhancedIncident],
max_priority: maxPriority,
max_depth: maxDepth,
max_iterations: maxIterations,
};
this.outputChannel.appendLine(
`getCodeplanAgentSolution request: ${JSON.stringify(request, null, 2)}`,
);
const response: SolutionResponse = await this.rpcConnection!.sendRequest(
"getCodeplanAgentSolution",
request,
);
vscode.commands.executeCommand("konveyor.loadSolution", response, {
incident,
violation,
});
} catch (err: any) {
this.outputChannel.appendLine(`Error during getSolution: ${err.message}`);
vscode.window.showErrorMessage("Get solution failed. See the output channel for details.");
}
this.fireSolutionStateChange(false);
}

Proper fix

Fixing this properly would require implementing #149 (which would require konveyor/kai#525)

For now

Simply remove the Cancel button all together until #149 is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants