Skip to content

Commit 92ce0fe

Browse files
committed
Add buttons to restart and view logs in case of CLI unavailability on license check
If there is no valid CLI path at this point then something wrong happened to CLI _between_ CLI installation step and license check, otherwise setup would have exited before. This is unlikely situation that would probably only happen if the user or any other 3rd party program tampers with localstack installation while authentication work is happening in the step before. However, it's a good idea to add two buttons to re-run the wizard and show logs! Added both. Also adds telemetry `setup_ended` event with failed state. In this case we can't really say that license check has failed because the setup didn't get to it yet. However, overall the setup has failed even if any individual step has not, therefore the event says so, thus indicating a possibility of an external error.
1 parent 0d019cb commit 92ce0fe

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

src/plugins/setup.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,34 @@ export default createPlugin(
239239
const cliPath =
240240
cliStatusTracker.cliPath() ?? (await getValidCliPath());
241241
if (!cliPath) {
242-
void window.showErrorMessage(
243-
"Could not access the LocalStack CLI.",
242+
telemetry.track(
243+
get_setup_ended(
244+
cliStatus,
245+
authenticationStatus,
246+
"CANCELLED",
247+
"CANCELLED",
248+
"FAILED",
249+
origin_trigger,
250+
await readAuthToken(),
251+
),
244252
);
253+
void window
254+
.showErrorMessage(
255+
"Could not access the LocalStack CLI.",
256+
{
257+
title: "Restart Setup",
258+
command: "localstack.setup",
259+
},
260+
{
261+
title: "View Logs",
262+
command: "localstack.viewLogs",
263+
},
264+
)
265+
.then((selection) => {
266+
if (selection) {
267+
void commands.executeCommand(selection.command);
268+
}
269+
});
245270
return;
246271
}
247272

src/utils/telemetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function get_setup_ended(
220220
authentication_status: "COMPLETED" | "SKIPPED" | "CANCELLED",
221221
license_setup_status: "COMPLETED" | "SKIPPED" | "CANCELLED",
222222
aws_profile_status: "COMPLETED" | "SKIPPED" | "CANCELLED",
223-
overall_status: "CANCELLED" | "COMPLETED",
223+
overall_status: "CANCELLED" | "COMPLETED" | "FAILED",
224224
origin: "manual_trigger" | "extension_startup",
225225
auth_token: string = "",
226226
): Events {

0 commit comments

Comments
 (0)