Skip to content

Commit 94eb819

Browse files
author
David Hasani
committed
remove agree to local build form
1 parent 485b96a commit 94eb819

File tree

4 files changed

+8
-49
lines changed

4 files changed

+8
-49
lines changed

packages/core/src/amazonqGumby/chat/controller/controller.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,6 @@ export class GumbyController {
395395
transformByQState.setCustomDependencyVersionFilePath('')
396396
this.promptJavaHome('source', message.tabID)
397397
break
398-
case ButtonActions.AGREE_TO_LOCAL_BUILD:
399-
await this.prepareLanguageUpgradeProject(message) // build project locally right after user agrees to do so
400-
break
401398
case ButtonActions.VIEW_TRANSFORMATION_HUB:
402399
await vscode.commands.executeCommand(GumbyCommands.FOCUS_TRANSFORMATION_HUB, CancelActionPositions.Chat)
403400
break
@@ -552,39 +549,34 @@ export class GumbyController {
552549
})
553550
}
554551

555-
private async prepareLanguageUpgradeProject(message: any) {
552+
private async prepareLanguageUpgradeProject(tabID: string) {
556553
// build project locally
557554
try {
558555
this.sessionStorage.getSession().conversationState = ConversationState.COMPILING
559-
this.messenger.sendCompilationInProgress(message.tabID)
556+
this.messenger.sendCompilationInProgress(tabID)
560557
await compileProject()
561558
} catch (err: any) {
562-
this.messenger.sendUnrecoverableErrorResponse('could-not-compile-project', message.tabID)
559+
this.messenger.sendUnrecoverableErrorResponse('could-not-compile-project', tabID)
563560
// reset state to allow "Start a new transformation" button to work
564561
this.sessionStorage.getSession().conversationState = ConversationState.IDLE
565562
throw err
566563
}
567564

568-
this.messenger.sendCompilationFinished(message.tabID)
565+
this.messenger.sendCompilationFinished(tabID)
569566

570567
// since compilation can potentially take a long time, double check auth
571568
const authState = await AuthUtil.instance.getChatAuthState()
572569
if (authState.amazonQ !== 'connected') {
573-
void this.messenger.sendAuthNeededExceptionMessage(authState, message.tabID)
570+
void this.messenger.sendAuthNeededExceptionMessage(authState, tabID)
574571
this.sessionStorage.getSession().isAuthenticating = true
575572
return
576573
}
577574

578575
// give user a non-blocking warning if build file appears to contain absolute paths
579576
await parseBuildFile()
580577

581-
this.messenger.sendAsyncEventProgress(
582-
message.tabID,
583-
true,
584-
undefined,
585-
GumbyNamedMessages.JOB_SUBMISSION_STATUS_MESSAGE
586-
)
587-
this.messenger.sendJobSubmittedMessage(message.tabID)
578+
this.messenger.sendAsyncEventProgress(tabID, true, undefined, GumbyNamedMessages.JOB_SUBMISSION_STATUS_MESSAGE)
579+
this.messenger.sendJobSubmittedMessage(tabID)
588580
this.sessionStorage.getSession().conversationState = ConversationState.JOB_SUBMITTED
589581
await startTransformByQ()
590582
}
@@ -705,7 +697,7 @@ export class GumbyController {
705697
const pathToJavaHome = extractPath(data.message)
706698
if (pathToJavaHome) {
707699
transformByQState.setTargetJavaHome(pathToJavaHome)
708-
this.messenger.sendPermissionToBuildMessage(data.tabID)
700+
await this.prepareLanguageUpgradeProject(data.tabID) // build right after we get target JDK path
709701
} else {
710702
this.messenger.sendUnrecoverableErrorResponse('invalid-java-home', data.tabID)
711703
}

packages/core/src/amazonqGumby/chat/controller/messenger/messenger.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -346,35 +346,6 @@ export class Messenger {
346346
)
347347
}
348348

349-
public sendPermissionToBuildMessage(tabID: string) {
350-
const message = CodeWhispererConstants.buildLocallyChatMessage
351-
352-
const buttons: ChatItemButton[] = []
353-
buttons.push({
354-
keepCardAfterClick: false,
355-
text: 'Agree',
356-
id: ButtonActions.AGREE_TO_LOCAL_BUILD,
357-
position: 'outside',
358-
})
359-
buttons.push({
360-
keepCardAfterClick: false,
361-
text: 'No, stop the transformation',
362-
id: ButtonActions.CANCEL_TRANSFORMATION_FORM,
363-
position: 'outside',
364-
})
365-
366-
this.dispatcher.sendChatMessage(
367-
new ChatMessage(
368-
{
369-
message,
370-
messageType: 'ai-prompt',
371-
buttons,
372-
},
373-
tabID
374-
)
375-
)
376-
}
377-
378349
public sendAsyncEventProgress(
379350
tabID: string,
380351
inProgress: boolean,

packages/core/src/amazonqGumby/chat/controller/messenger/messengerUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export enum ButtonActions {
2222
SELECT_SQL_CONVERSION_METADATA_FILE = 'gumbySQLConversionMetadataTransformFormConfirm',
2323
SELECT_CUSTOM_DEPENDENCY_VERSION_FILE = 'gumbyCustomDependencyVersionTransformFormConfirm',
2424
CONTINUE_TRANSFORMATION_FORM = 'gumbyTransformFormContinue',
25-
AGREE_TO_LOCAL_BUILD = 'gumbyAgreeToLocalBuild',
2625
CONFIRM_DEPENDENCY_FORM = 'gumbyTransformDependencyFormConfirm',
2726
CANCEL_DEPENDENCY_FORM = 'gumbyTransformDependencyFormCancel',
2827
CONFIRM_JAVA_HOME_FORM = 'gumbyJavaHomeFormConfirm',

packages/core/src/codewhisperer/models/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,9 +587,6 @@ export const buildSucceededChatMessage = 'I was able to build your project and w
587587
export const buildSucceededNotification =
588588
'Amazon Q was able to build your project and will start transforming your code soon.'
589589

590-
export const buildLocallyChatMessage =
591-
'I will build your project on this machine throughout the transformation process.'
592-
593590
export const absolutePathDetectedMessage = (numPaths: number, buildFile: string, listOfPaths: string) =>
594591
`I detected ${numPaths} potential absolute file path(s) in your ${buildFile} file: **${listOfPaths}**. Absolute file paths might cause issues when I build your code. Any errors will show up in the build log.`
595592

0 commit comments

Comments
 (0)