diff --git a/packages/amazonq/src/app/amazonqScan/app.ts b/packages/amazonq/src/app/amazonqScan/app.ts index 2b237ab534e..bd12e3acd01 100644 --- a/packages/amazonq/src/app/amazonqScan/app.ts +++ b/packages/amazonq/src/app/amazonqScan/app.ts @@ -4,13 +4,7 @@ */ import * as vscode from 'vscode' -import { - AmazonQAppInitContext, - MessagePublisher, - MessageListener, - focusAmazonQPanel, - DefaultAmazonQAppInitContext, -} from 'aws-core-vscode/amazonq' +import { AmazonQAppInitContext, MessageListener } from 'aws-core-vscode/amazonq' import { AuthUtil, codeScanState, onDemandFileScanState } from 'aws-core-vscode/codewhisperer' import { ScanChatControllerEventEmitters, ChatSessionManager } from 'aws-core-vscode/amazonqScan' import { ScanController } from './chat/controller/controller' @@ -18,8 +12,6 @@ import { AppToWebViewMessageDispatcher } from './chat/views/connector/connector' import { Messenger } from './chat/controller/messenger/messenger' import { UIMessageListener } from './chat/views/actions/uiMessageListener' import { debounce } from 'lodash' -import { Commands, placeholder } from 'aws-core-vscode/shared' -import { codeReviewInChat } from './models/constants' export function init(appContext: AmazonQAppInitContext) { const scanChatControllerEventEmitters: ScanChatControllerEventEmitters = { @@ -50,8 +42,6 @@ export function init(appContext: AmazonQAppInitContext) { webViewMessageListener: new MessageListener(scanChatUIInputEventEmitter), }) - appContext.registerWebViewToAppMessagePublisher(new MessagePublisher(scanChatUIInputEventEmitter), 'review') - const debouncedEvent = debounce(async () => { const authenticated = (await AuthUtil.instance.getChatAuthState()).amazonQ === 'connected' let authenticatingSessionID = '' @@ -75,20 +65,6 @@ export function init(appContext: AmazonQAppInitContext) { return debouncedEvent() }) - if (!codeReviewInChat) { - Commands.register('aws.amazonq.security.scan-statusbar', async () => { - if (AuthUtil.instance.isConnectionExpired()) { - await AuthUtil.instance.notifyReauthenticate() - } - return focusAmazonQPanel.execute(placeholder, 'amazonq.security.scan').then(() => { - DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({ - sender: 'amazonqCore', - command: 'review', - }) - }) - }) - } - codeScanState.setChatControllers(scanChatControllerEventEmitters) onDemandFileScanState.setChatControllers(scanChatControllerEventEmitters) } diff --git a/packages/amazonq/src/app/chat/activation.ts b/packages/amazonq/src/app/chat/activation.ts index 659115d4256..7517d668497 100644 --- a/packages/amazonq/src/app/chat/activation.ts +++ b/packages/amazonq/src/app/chat/activation.ts @@ -17,7 +17,6 @@ export async function activate(context: ExtensionContext) { context.subscriptions.push( amazonq.focusAmazonQChatWalkthrough.register(), amazonq.walkthroughInlineSuggestionsExample.register(), - amazonq.walkthroughSecurityScanExample.register(), amazonq.openAmazonQWalkthrough.register(), amazonq.listCodeWhispererCommandsWalkthrough.register(), amazonq.focusAmazonQPanel.register(), diff --git a/packages/amazonq/src/lsp/chat/commands.ts b/packages/amazonq/src/lsp/chat/commands.ts index fca3a132f90..57e61198922 100644 --- a/packages/amazonq/src/lsp/chat/commands.ts +++ b/packages/amazonq/src/lsp/chat/commands.ts @@ -10,7 +10,6 @@ import { CodeScanIssue, AuthUtil } from 'aws-core-vscode/codewhisperer' import { getLogger } from 'aws-core-vscode/shared' import * as vscode from 'vscode' import * as path from 'path' -import { codeReviewInChat } from '../../app/amazonqScan/models/constants' import { telemetry, AmazonqCodeReviewTool } from 'aws-core-vscode/telemetry' /** @@ -68,11 +67,6 @@ export function registerCommands(provider: AmazonQChatViewProvider) { registerShellCommandShortCut('aws.amazonq.rejectCmdExecution', 'reject-shell-command', provider), registerShellCommandShortCut('aws.amazonq.stopCmdExecution', 'stop-shell-command', provider) ) - if (codeReviewInChat) { - globals.context.subscriptions.push( - registerGenericCommand('aws.amazonq.security.scan-statusbar', 'Review', provider) - ) - } } async function handleIssueCommand( diff --git a/packages/core/package.nls.json b/packages/core/package.nls.json index c339ffa163d..1be74632591 100644 --- a/packages/core/package.nls.json +++ b/packages/core/package.nls.json @@ -145,8 +145,6 @@ "AWS.command.amazonq.optimizeCode": "Optimize", "AWS.command.amazonq.sendToPrompt": "Send to prompt", "AWS.command.amazonq.generateUnitTests": "Generate Tests", - "AWS.command.amazonq.security.scan": "Run Project Review", - "AWS.command.amazonq.security.fileScan": "Run File Review", "AWS.command.amazonq.generateFix": "Fix", "AWS.command.amazonq.viewDetails": "View Details", "AWS.command.amazonq.explainIssue": "Explain", diff --git a/packages/core/src/amazonq/index.ts b/packages/core/src/amazonq/index.ts index e06b8ad53d9..aa266ce39dd 100644 --- a/packages/core/src/amazonq/index.ts +++ b/packages/core/src/amazonq/index.ts @@ -13,7 +13,6 @@ export { focusAmazonQChatWalkthrough, openAmazonQWalkthrough, walkthroughInlineSuggestionsExample, - walkthroughSecurityScanExample, } from './onboardingPage/walkthrough' export { api } from './extApi' export { AmazonQChatViewProvider } from './webview/webView' diff --git a/packages/core/src/amazonq/onboardingPage/walkthrough.ts b/packages/core/src/amazonq/onboardingPage/walkthrough.ts index cb56c8b2abb..50b1db642a5 100644 --- a/packages/core/src/amazonq/onboardingPage/walkthrough.ts +++ b/packages/core/src/amazonq/onboardingPage/walkthrough.ts @@ -7,7 +7,6 @@ import { focusAmazonQPanel } from '../../codewhispererChat/commands/registerComm import globals, { isWeb } from '../../shared/extensionGlobals' import { VSCODE_EXTENSION_ID } from '../../shared/extensions' import { getLogger } from '../../shared/logger/logger' -import { localize } from '../../shared/utilities/vsCodeUtils' import { Commands, placeholder } from '../../shared/vscode/commands2' import vscode from 'vscode' @@ -66,11 +65,3 @@ fake_users = [ }) } ) - -export const walkthroughSecurityScanExample = Commands.declare( - `_aws.amazonq.walkthrough.securityScanExample`, - () => async () => { - const filterText = localize('AWS.command.amazonq.security.scan', 'Run Project Review') - void vscode.commands.executeCommand('workbench.action.quickOpen', `> ${filterText}`) - } -) diff --git a/packages/core/src/amazonq/webview/ui/quickActions/generator.ts b/packages/core/src/amazonq/webview/ui/quickActions/generator.ts index 4ca8b4cc10e..4a0c5bad16c 100644 --- a/packages/core/src/amazonq/webview/ui/quickActions/generator.ts +++ b/packages/core/src/amazonq/webview/ui/quickActions/generator.ts @@ -15,58 +15,17 @@ export interface QuickActionGeneratorProps { export class QuickActionGenerator { private isGumbyEnabled: boolean - private isScanEnabled: boolean private disabledCommands: string[] constructor(props: QuickActionGeneratorProps) { this.isGumbyEnabled = props.isGumbyEnabled - this.isScanEnabled = props.isScanEnabled this.disabledCommands = props.disableCommands ?? [] } public generateForTab(tabType: TabType): QuickActionCommandGroup[] { - // TODO: Update acc to UX const quickActionCommands = [ { commands: [ - ...(!this.disabledCommands.includes('/dev') - ? [ - { - command: '/dev', - icon: MynahIcons.CODE_BLOCK, - placeholder: 'Describe your task or issue in as much detail as possible', - description: 'Generate code to make a change in your project', - }, - ] - : []), - ...(!this.disabledCommands.includes('/test') - ? [ - { - command: '/test', - icon: MynahIcons.CHECK_LIST, - placeholder: 'Specify a function(s) in the current file (optional)', - description: 'Generate unit tests for selected code', - }, - ] - : []), - ...(this.isScanEnabled && !this.disabledCommands.includes('/review') - ? [ - { - command: '/review', - icon: MynahIcons.BUG, - description: 'Identify and fix code issues before committing', - }, - ] - : []), - ...(!this.disabledCommands.includes('/doc') - ? [ - { - command: '/doc', - icon: MynahIcons.FILE, - description: 'Generate documentation', - }, - ] - : []), ...(this.isGumbyEnabled && !this.disabledCommands.includes('/transform') ? [ { diff --git a/packages/core/src/codewhisperer/ui/codeWhispererNodes.ts b/packages/core/src/codewhisperer/ui/codeWhispererNodes.ts index 28ed3952494..c1934ec6a73 100644 --- a/packages/core/src/codewhisperer/ui/codeWhispererNodes.ts +++ b/packages/core/src/codewhisperer/ui/codeWhispererNodes.ts @@ -21,7 +21,7 @@ import { selectRegionProfileCommand, } from '../commands/basicCommands' import { CodeWhispererCommandDeclarations } from '../commands/gettingStartedPageCommands' -import { CodeScansState, codeScanState, RegionProfile } from '../models/model' +import { CodeScansState, RegionProfile } from '../models/model' import { getNewCustomizationsAvailable, getSelectedCustomization } from '../util/customizationUtil' import { cwQuickPickSource } from '../commands/types' import { AuthUtil } from '../util/authUtil' @@ -70,25 +70,6 @@ export function createOpenReferenceLog(): DataQuickPickItem<'openReferenceLog'> } as DataQuickPickItem<'openReferenceLog'> } -export function createSecurityScan(): DataQuickPickItem<'securityScan'> { - const label = `Full project scan is now /review!` - const icon = codeScanState.getIconForButton() - const description = 'Open in Chat Panel' - - return { - data: 'securityScan', - label: codicon`${icon} ${label}`, - description: description, - onClick: () => - vscode.commands.executeCommand( - 'aws.amazonq.security.scan-statusbar', - placeholder, - 'cwQuickPickSource', - true - ), - } as DataQuickPickItem<'securityScan'> -} - export function createReconnect(): DataQuickPickItem<'reconnect'> { const label = localize('aws.amazonq.reconnectNode.label', 'Re-authenticate to connect') const icon = addColor(getIcon('vscode-debug-disconnect'), 'notificationsErrorIcon.foreground') diff --git a/packages/core/src/codewhisperer/ui/statusBarMenu.ts b/packages/core/src/codewhisperer/ui/statusBarMenu.ts index 46f47e35a2c..345ae641a78 100644 --- a/packages/core/src/codewhisperer/ui/statusBarMenu.ts +++ b/packages/core/src/codewhisperer/ui/statusBarMenu.ts @@ -21,7 +21,6 @@ import { createAutoScans, createSignIn, switchToAmazonQNode, - createSecurityScan, createSelectRegionProfileNode, } from './codeWhispererNodes' import { hasVendedIamCredentials, hasVendedCredentialsFromMetadata } from '../../auth/auth' @@ -52,12 +51,7 @@ function getAmazonQCodeWhispererNodes() { if (hasVendedIamCredentials()) { return [createFreeTierLimitMet(), createOpenReferenceLog()] } - return [ - createFreeTierLimitMet(), - createOpenReferenceLog(), - createSeparator('Other Features'), - createSecurityScan(), - ] + return [createFreeTierLimitMet(), createOpenReferenceLog(), createSeparator('Other Features')] } if (hasVendedIamCredentials()) { @@ -74,7 +68,6 @@ function getAmazonQCodeWhispererNodes() { // Security scans createSeparator('Code Reviews'), ...(AuthUtil.instance.isBuilderIdInUse() ? [] : [createAutoScans(autoScansEnabled)]), - createSecurityScan(), // Amazon Q + others createSeparator('Other Features'), diff --git a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts index 05164274b70..a57ff6fcea3 100644 --- a/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts +++ b/packages/core/src/test/codewhisperer/commands/basicCommands.test.ts @@ -43,7 +43,6 @@ import { createManageSubscription, createOpenReferenceLog, createReconnect, - createSecurityScan, createSelectCustomization, createSeparator, createSettingsNode, @@ -506,7 +505,6 @@ describe('CodeWhisperer-basicCommands', function () { createOpenReferenceLog(), createGettingStarted(), createSeparator('Code Reviews'), - createSecurityScan(), createSeparator('Other Features'), switchToAmazonQNode(), createSeparator('Connect / Help'),