From a9c86860a43df8ce2fc954584088894ceb5f1be9 Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Mon, 8 Sep 2025 16:35:20 +0200 Subject: [PATCH 1/2] style: adjust localstack aws profile --- package.json | 2 +- src/plugins/setup.ts | 4 ++-- src/utils/configure-aws.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7fe6ee5..f89537e 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ }, { "command": "localstack.configureAwsProfiles", - "title": "Configure \"localstack\" AWS Profiles", + "title": "Configure AWS Profile \"localstack\"", "category": "LocalStack" } ], diff --git a/src/plugins/setup.ts b/src/plugins/setup.ts index bb6b826..f6a39d6 100644 --- a/src/plugins/setup.ts +++ b/src/plugins/setup.ts @@ -220,7 +220,7 @@ export default createPlugin( ///////////////////////////////////////////////////////////////////// progress.report({ - message: "Configuring AWS profiles...", + message: "Configuring AWS profile...", }); await minDelay( configureAwsProfiles({ @@ -232,7 +232,7 @@ export default createPlugin( void commands.executeCommand("localstack.refreshStatusBar"); progress.report({ - message: 'Finished configuring "localstack" AWS profiles.', + message: 'Finished configuring the "localstack" AWS profile.', }); await minDelay(Promise.resolve()); diff --git a/src/utils/configure-aws.ts b/src/utils/configure-aws.ts index d12c117..c1f5e37 100644 --- a/src/utils/configure-aws.ts +++ b/src/utils/configure-aws.ts @@ -316,7 +316,7 @@ export async function configureAwsProfiles(options: { // if everything in place, show user that no changes were made and return if (options?.notifyNoChangesMade) { window.showInformationMessage( - 'The "localstack" AWS profiles were already present, so no changes were made.', + 'The "localstack" AWS profile was already present, so no changes were made.', ); } options.telemetry?.track({ @@ -332,7 +332,7 @@ export async function configureAwsProfiles(options: { }); return; } else { - // profiles are there but need adjustment + // profile is there but needs adjustment // in testing, we always override if (options?.forceOverride) { overrideDecision = "Override"; @@ -346,7 +346,7 @@ export async function configureAwsProfiles(options: { } } } else { - // if any of the profiles don't exist, we need to create it + // we need to create it overrideDecision = "Override"; } @@ -464,7 +464,7 @@ export async function checkIsProfileConfigured(): Promise { return false; } - return true; // Both profiles exist and are properly configured + return true; // profile exists in both files and is properly configured } catch (error) { return false; } From cb08d0e77f7c979f65f6ee5d596ccb702f4ce90a Mon Sep 17 00:00:00 2001 From: Anisa Oshafi Date: Mon, 8 Sep 2025 18:23:17 +0200 Subject: [PATCH 2/2] Address feedback --- src/plugins/setup.ts | 3 ++- src/utils/configure-aws.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/setup.ts b/src/plugins/setup.ts index f6a39d6..41d4fcd 100644 --- a/src/plugins/setup.ts +++ b/src/plugins/setup.ts @@ -232,7 +232,8 @@ export default createPlugin( void commands.executeCommand("localstack.refreshStatusBar"); progress.report({ - message: 'Finished configuring the "localstack" AWS profile.', + message: + 'Finished configuring the AWS profile named "localstack".', }); await minDelay(Promise.resolve()); diff --git a/src/utils/configure-aws.ts b/src/utils/configure-aws.ts index c1f5e37..ecb599c 100644 --- a/src/utils/configure-aws.ts +++ b/src/utils/configure-aws.ts @@ -44,7 +44,7 @@ async function overrideSelection( } const fileList = filesToModify.join(" and "); const selection = await window.showWarningMessage( - `The "localstack" AWS profile in ${fileList} exists, but does not match the expected properties. Do you want to override it?`, + `The AWS profile named "localstack" in ${fileList} exists, but does not match the expected properties. Do you want to override it?`, "Override", ); return selection; @@ -180,7 +180,7 @@ async function configureAwsConfigProfile( } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); window.showErrorMessage( - `Failed to configure the "localstack" AWS profile in [${awsConfigFilenameReadable}]: ${errorMessage}`, + `Failed to configure the AWS profile named "localstack" in [${awsConfigFilenameReadable}]: ${errorMessage}`, ); } } @@ -238,7 +238,7 @@ async function configureCredentialsProfile( } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); window.showErrorMessage( - `Failed to configure the "localstack" AWS profile in [${awsCredentialsFilenameReadable}]: ${errorMessage}`, + `Failed to configure the AWS profile named "localstack" in [${awsCredentialsFilenameReadable}]: ${errorMessage}`, ); } return false; @@ -316,7 +316,7 @@ export async function configureAwsProfiles(options: { // if everything in place, show user that no changes were made and return if (options?.notifyNoChangesMade) { window.showInformationMessage( - 'The "localstack" AWS profile was already present, so no changes were made.', + 'The AWS profile named "localstack" was already present, so no changes were made.', ); } options.telemetry?.track({ @@ -383,7 +383,7 @@ export async function configureAwsProfiles(options: { ), ]); window.showInformationMessage( - 'Successfully added the "localstack" AWS profile to "~/.aws/config" and "~/.aws/credentials".', + 'Successfully added the AWS profile named "localstack" to "~/.aws/config" and "~/.aws/credentials".', ); options.telemetry?.track({ name: "aws_profile_configured", @@ -405,7 +405,7 @@ export async function configureAwsProfiles(options: { overrideDecision, ); window.showInformationMessage( - 'Successfully added the "localstack" AWS profile to "~/.aws/config".', + 'Successfully added the AWS profile named "localstack" to "~/.aws/config".', ); options.telemetry?.track({ name: "aws_profile_configured", @@ -427,7 +427,7 @@ export async function configureAwsProfiles(options: { overrideDecision, ); window.showInformationMessage( - 'Successfully added the "localstack" AWS profile to "~/.aws/credentials".', + 'Successfully added the AWS profile named "localstack" to "~/.aws/credentials".', ); options.telemetry?.track({ name: "aws_profile_configured",