Skip to content

Commit d15ee2e

Browse files
committed
refactor: cleanup minor problems
1 parent 0bc81d9 commit d15ee2e

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

packages/core/src/shared/awsClientBuilderV3.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ export interface AwsClient {
5454
middlewareStack: {
5555
add: MiddlewareStack<any, MetadataBearer>['add']
5656
}
57-
send: (command: AwsCommand<object, object>, options?: any) => Promise<any>
57+
send<InputType extends object, OutputType extends object>(
58+
command: AwsCommand<InputType, OutputType>,
59+
options?: any
60+
): Promise<OutputType>
5861
destroy: () => void
5962
}
6063

packages/core/src/shared/clients/codecatalystClient.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ import { DevSettings } from '../settings'
100100
import { getServiceEnvVarConfig } from '../vscode/env'
101101
import { AwsCommand } from '../awsClientBuilderV3'
102102
import { ClientWrapper } from './clientWrapper'
103-
import { StandardRetryStrategy } from '@smithy/util-retry'
104103
import { ServiceException } from '@aws-sdk/smithy-client'
105104
import { AccessDeniedException } from '@aws-sdk/client-sso-oidc'
106105
import { TokenIdentityProvider } from '@aws-sdk/types'
@@ -221,16 +220,14 @@ function toBranch(
221220
function createCodeCatalystClientV3(
222221
tokenProvider: TokenIdentityProvider,
223222
regionCode: string,
224-
endpoint: string,
225-
maxRetries: number
223+
endpoint: string
226224
): CodeCatalystSDKClient {
227225
return globals.sdkClientBuilderV3.createAwsService({
228226
serviceClient: CodeCatalystSDKClient,
229227
clientOptions: {
230228
region: regionCode,
231229
endpoint: endpoint,
232230
token: tokenProvider,
233-
retryStrategy: new StandardRetryStrategy(maxRetries),
234231
},
235232
})
236233
}
@@ -262,10 +259,9 @@ export async function createClient(
262259
connection: SsoConnection,
263260
regionCode = getCodeCatalystConfig().region,
264261
endpoint = getCodeCatalystConfig().endpoint,
265-
maxRetries: number = 5,
266262
authOptions: AuthOptions = {}
267263
): Promise<CodeCatalystClient> {
268-
const sdkv3Client = createCodeCatalystClientV3(getTokenProvider(connection), regionCode, endpoint, maxRetries)
264+
const sdkv3Client = createCodeCatalystClientV3(getTokenProvider(connection), regionCode, endpoint)
269265
const c = new CodeCatalystClientInternal(connection, sdkv3Client, regionCode)
270266
try {
271267
await c.verifySession()

packages/core/src/testE2E/codecatalyst/client.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
192192
assert.strictEqual(actualDevEnv.org.name, spaceName)
193193
assert.strictEqual(actualDevEnv.alias, differentDevEnvSettings.alias)
194194
assert.strictEqual(actualDevEnv.instanceType, 'dev.standard1.medium')
195-
assert.strictEqual(actualDevEnv.persistentStorage && actualDevEnv.persistentStorage.sizeInGiB, 32)
195+
assert.ok(actualDevEnv.persistentStorage && actualDevEnv.persistentStorage.sizeInGiB === 32)
196196
})
197197

198198
it.skip('creates a Dev Environment using an existing branch', async function () {
@@ -429,9 +429,7 @@ describe('Test how this codebase uses the CodeCatalyst API', function () {
429429
*/
430430
async function createTestCodeCatalystClient(auth: Auth): Promise<CodeCatalystClient> {
431431
const conn = await useCodeCatalystSsoConnection(auth)
432-
// Add retries for tests since many may be running in parallel in github CI.
433-
// AWS SDK adds jitter automatically.
434-
return await createCodeCatalystClient(conn, undefined, undefined, 5)
432+
return await createCodeCatalystClient(conn, undefined, undefined)
435433
}
436434

437435
/**

0 commit comments

Comments
 (0)