Skip to content

Commit 1d9ff5f

Browse files
authored
fix(amazonq): hide auto-scans for builder id aws#4863
1 parent 38dc3f4 commit 1d9ff5f

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

packages/core/src/codewhisperer/ui/statusBarMenu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function getAmazonQCodeWhispererNodes() {
7171

7272
// Security scans
7373
createSeparator('Security Scans'),
74-
createAutoScans(autoScansEnabled),
74+
...(AuthUtil.instance.isBuilderIdInUse() ? [] : [createAutoScans(autoScansEnabled)]),
7575
createSecurityScan(),
7676

7777
// Amazon Q + others

packages/core/src/test/codewhisperer/commands/basicCommands.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
createReconnect,
4242
createSecurityScan,
4343
createSelectCustomization,
44+
createSeparator,
4445
createSettingsNode,
4546
createSignIn,
4647
createSignout,
@@ -389,6 +390,31 @@ describe('CodeWhisperer-basicCommands', function () {
389390

390391
await listCodeWhispererCommands.execute()
391392
})
393+
394+
it('should not show auto-scans if using builder id', async function () {
395+
sinon.stub(AuthUtil.instance, 'isConnected').returns(true)
396+
sinon.stub(AuthUtil.instance, 'isBuilderIdInUse').returns(true)
397+
398+
getTestWindow().onDidShowQuickPick(async e => {
399+
e.assertItems([
400+
createSeparator('Inline Suggestions'),
401+
createAutoSuggestions(false),
402+
createOpenReferenceLog(),
403+
createGettingStarted(),
404+
createSeparator('Security Scans'),
405+
createSecurityScan(),
406+
createSeparator('Other Features'),
407+
switchToAmazonQNode(),
408+
createSeparator('Connect / Help'),
409+
...genericItems(),
410+
createSeparator(),
411+
createSettingsNode(),
412+
createSignout(),
413+
])
414+
e.dispose() // skip needing to select an item to continue
415+
})
416+
await listCodeWhispererCommands.execute()
417+
})
392418
})
393419

394420
describe('applySecurityFix', function () {

0 commit comments

Comments
 (0)