Skip to content

Commit e110478

Browse files
laileni-awsaws-toolkit-automationtobixleaXiaoxuanLu
authored
feat(lambda): Add Finch CLI installation to AppBuilder walkthrough (#8229)
- migrating this PR: aws/aws-toolkit-vscode-staging#2248 --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: aws-ides-bot <[email protected]> Co-authored-by: aws-toolkit-automation <[email protected]> Co-authored-by: tobixlea <[email protected]> Co-authored-by: Sherry Lu <[email protected]>
1 parent 5ca03d3 commit e110478

File tree

7 files changed

+103
-8
lines changed

7 files changed

+103
-8
lines changed

packages/amazonq/package.json

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,26 +1387,61 @@
13871387
"fontCharacter": "\\f1e0"
13881388
}
13891389
},
1390-
"aws-schemas-registry": {
1390+
"aws-sagemakerunifiedstudio-catalog": {
13911391
"description": "AWS Contributed Icon",
13921392
"default": {
13931393
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
13941394
"fontCharacter": "\\f1e1"
13951395
}
13961396
},
1397-
"aws-schemas-schema": {
1397+
"aws-sagemakerunifiedstudio-spaces": {
13981398
"description": "AWS Contributed Icon",
13991399
"default": {
14001400
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14011401
"fontCharacter": "\\f1e2"
14021402
}
14031403
},
1404-
"aws-stepfunctions-preview": {
1404+
"aws-sagemakerunifiedstudio-spaces-dark": {
14051405
"description": "AWS Contributed Icon",
14061406
"default": {
14071407
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
14081408
"fontCharacter": "\\f1e3"
14091409
}
1410+
},
1411+
"aws-sagemakerunifiedstudio-symbol-int": {
1412+
"description": "AWS Contributed Icon",
1413+
"default": {
1414+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1415+
"fontCharacter": "\\f1e4"
1416+
}
1417+
},
1418+
"aws-sagemakerunifiedstudio-table": {
1419+
"description": "AWS Contributed Icon",
1420+
"default": {
1421+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1422+
"fontCharacter": "\\f1e5"
1423+
}
1424+
},
1425+
"aws-schemas-registry": {
1426+
"description": "AWS Contributed Icon",
1427+
"default": {
1428+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1429+
"fontCharacter": "\\f1e6"
1430+
}
1431+
},
1432+
"aws-schemas-schema": {
1433+
"description": "AWS Contributed Icon",
1434+
"default": {
1435+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1436+
"fontCharacter": "\\f1e7"
1437+
}
1438+
},
1439+
"aws-stepfunctions-preview": {
1440+
"description": "AWS Contributed Icon",
1441+
"default": {
1442+
"fontPath": "./resources/fonts/aws-toolkit-icons.woff",
1443+
"fontCharacter": "\\f1e8"
1444+
}
14101445
}
14111446
},
14121447
"walkthroughs": [

packages/core/package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@
476476
"AWS.toolkit.lambda.walkthrough.title": "Get started building your application",
477477
"AWS.toolkit.lambda.walkthrough.description": "Your quick guide to build an application visually, iterate locally, and deploy to the cloud!",
478478
"AWS.toolkit.lambda.walkthrough.toolInstall.title": "Complete installation",
479-
"AWS.toolkit.lambda.walkthrough.toolInstall.description": "Manage your AWS services and resources with the AWS Command Line Interface (AWS CLI). \n\n[Install AWS CLI](command:aws.toolkit.installAWSCLI)\n\nBuild locally, invoke, and deploy your functions with the Serverless Application Model (SAM) CLI. \n\n[Install SAM CLI](command:aws.toolkit.installSAMCLI)\n\nDocker is an optional, third party tool that assists with local AWS Lambda runtime emulation. Docker is required to invoke Lambda functions on your local machine. \n\n[Install Docker (optional)](command:aws.toolkit.installDocker)\n\nEmulate your AWS cloud services locally with LocalStack to streamline testing in VS Code and CI environments. [Learn more](https://docs.localstack.cloud/aws/). \n\n[Install LocalStack (optional)](command:aws.toolkit.installLocalStack)",
479+
"AWS.toolkit.lambda.walkthrough.toolInstall.description.windows": "Manage your AWS services and resources with the AWS Command Line Interface (AWS CLI). \n\n[Install AWS CLI](command:aws.toolkit.installAWSCLI)\n\nBuild locally, invoke, and deploy your functions with the Serverless Application Model (SAM) CLI. \n\n[Install SAM CLI](command:aws.toolkit.installSAMCLI)\n\nDocker is an optional, third party tool that assists with local AWS Lambda runtime emulation. Docker is required to invoke Lambda functions on your local machine. \n\n[Install Docker (optional)](command:aws.toolkit.installDocker)\n\nEmulate your AWS cloud services locally with LocalStack to streamline testing in VS Code and CI environments. [Learn more](https://docs.localstack.cloud/aws/). \n\n[Install LocalStack (optional)](command:aws.toolkit.installLocalStack)",
480+
"AWS.toolkit.lambda.walkthrough.toolInstall.description": "Manage your AWS services and resources with the AWS Command Line Interface (AWS CLI). \n\n[Install AWS CLI](command:aws.toolkit.installAWSCLI)\n\nBuild locally, invoke, and deploy your functions with the Serverless Application Model (SAM) CLI. \n\n[Install SAM CLI](command:aws.toolkit.installSAMCLI)\n\nDocker is an optional, third party tool that assists with local AWS Lambda runtime emulation. Docker is required to invoke Lambda functions on your local machine. \n\n[Install Docker (optional)](command:aws.toolkit.installDocker)\n\nEmulate your AWS cloud services locally with LocalStack to streamline testing in VS Code and CI environments. [Learn more]((https://docs.localstack.cloud/aws/). \n\n[Install LocalStack (optional)](command:aws.toolkit.installLocalStack)\n\nFinch is an open source tool for local container development. Finch aims to help promote innovative upstream container projects by making it easy to install and use them. [Learn more](https://runfinch.com/) \n\n[Install Finch (optional)](command:aws.toolkit.installFinch)",
480481
"AWS.toolkit.lambda.walkthrough.chooseTemplate.title": "Choose your application template",
481482
"AWS.toolkit.lambda.walkthrough.chooseTemplate.description": "Select a starter application, visually compose an application from scratch, open an existing application, or browse more application examples. \n\nInfrastructure Composer allows you to visually compose modern applications in the cloud. It will define the necessary permissions between resources when you drag a connection between them. \n\n[Initialize your project](command:aws.toolkit.lambda.initializeWalkthroughProject)",
482483
"AWS.toolkit.lambda.walkthrough.step1.title": "Iterate locally",

packages/core/src/awsService/appBuilder/activation.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ async function registerAppBuilderCommands(context: ExtContext): Promise<void> {
150150
Commands.register('aws.toolkit.installLocalStack', async () => {
151151
await installLocalStackExtension(source)
152152
}),
153+
Commands.register('aws.toolkit.installFinch', async () => {
154+
await getOrInstallCliWrapper('finch', source)
155+
}),
153156
Commands.register('aws.toolkit.lambda.setWalkthroughToAPI', async () => {
154157
await setWalkthrough('API')
155158
}),

packages/core/src/shared/telemetry/vscodeTelemetry.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
{
22
"types": [
3+
{
4+
"name": "toolId",
5+
"type": "string",
6+
"description": "The tool being installed",
7+
"allowedValues": [
8+
"session-manager-plugin",
9+
"dotnet-lambda-deploy",
10+
"dotnet-deploy-cli",
11+
"aws-cli",
12+
"sam-cli",
13+
"docker",
14+
"finch"
15+
]
16+
},
317
{
418
"name": "amazonQProfileRegion",
519
"type": "string",

packages/core/src/shared/utilities/cliUtils.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ interface Cli {
5555
exec?: string
5656
}
5757

58-
export type AwsClis = Extract<ToolId, 'session-manager-plugin' | 'aws-cli' | 'sam-cli' | 'docker'>
58+
export type AwsClis = Extract<ToolId, 'session-manager-plugin' | 'aws-cli' | 'sam-cli' | 'docker' | 'finch'>
5959

6060
/**
6161
* CLIs and their full filenames and download paths for their respective OSes
@@ -170,6 +170,21 @@ export const awsClis: { [cli in AwsClis]: Cli } = {
170170
manualInstallLink: 'https://docs.docker.com/desktop',
171171
exec: 'docker',
172172
},
173+
// Currently Finch is available for MacOS and Linux; Windows support will be added if/when available
174+
finch: {
175+
command: {
176+
unix: ['finch', path.join('/', 'usr', 'bin', 'finch'), path.join('/', 'usr', 'local', 'bin', 'finch')],
177+
},
178+
source: {
179+
macos: {
180+
x86: 'https://github.com/runfinch/finch/releases/download/v1.11.0/Finch-v1.11.0-x86_64.pkg',
181+
arm: 'https://github.com/runfinch/finch/releases/download/v1.11.0/Finch-v1.11.0-aarch64.pkg',
182+
},
183+
},
184+
name: 'Finch',
185+
manualInstallLink: 'https://runfinch.com/docs/getting-started/installation/',
186+
exec: 'finch',
187+
},
173188
}
174189

175190
/**
@@ -185,7 +200,7 @@ export async function installCli(
185200
): Promise<string | never> {
186201
const cliToInstall = awsClis[cli]
187202
if (!cliToInstall) {
188-
throw new InstallerError(`Invalid not found for CLI: ${cli}`)
203+
throw new InstallerError(`Installer not found for CLI: ${cli}`)
189204
}
190205
let result: Result = 'Succeeded'
191206
let reason: string = ''
@@ -247,10 +262,11 @@ export async function installCli(
247262
case 'aws-cli':
248263
case 'sam-cli':
249264
case 'docker':
265+
case 'finch':
250266
cliPath = await installGui(cli, tempDir, progress, timeout)
251267
break
252268
default:
253-
throw new InstallerError(`Invalid not found for CLI: ${cli}`)
269+
throw new InstallerError(`Installer not found for CLI: ${cli}`)
254270
}
255271
} finally {
256272
timeout.dispose()

packages/core/src/test/awsService/appBuilder/walkthrough.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ const scenarios: TestScenario[] = [
5151
platform: 'win32',
5252
shouldSucceed: true,
5353
},
54+
{
55+
toolID: 'finch',
56+
platform: 'win32',
57+
shouldSucceed: false,
58+
},
5459
{
5560
toolID: 'aws-cli',
5661
platform: 'darwin',
@@ -66,6 +71,11 @@ const scenarios: TestScenario[] = [
6671
platform: 'darwin',
6772
shouldSucceed: true,
6873
},
74+
{
75+
toolID: 'finch',
76+
platform: 'darwin',
77+
shouldSucceed: true,
78+
},
6979
{
7080
toolID: 'aws-cli',
7181
platform: 'linux',
@@ -81,6 +91,11 @@ const scenarios: TestScenario[] = [
8191
platform: 'linux',
8292
shouldSucceed: false,
8393
},
94+
{
95+
toolID: 'finch',
96+
platform: 'linux',
97+
shouldSucceed: false,
98+
},
8499
]
85100

86101
describe('AppBuilder Walkthrough', function () {

packages/toolkit/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4546,14 +4546,25 @@
45464546
"description": "%AWS.toolkit.lambda.walkthrough.description%",
45474547
"when": "workspacePlatform != webworker",
45484548
"steps": [
4549+
{
4550+
"id": "toolInstallWindows",
4551+
"title": "%AWS.toolkit.lambda.walkthrough.toolInstall.title%",
4552+
"description": "%AWS.toolkit.lambda.walkthrough.toolInstall.description.windows%",
4553+
"media": {
4554+
"image": "./resources/walkthrough/appBuilder/install.png",
4555+
"altText": "Showing GUI installer"
4556+
},
4557+
"when": "isWindows"
4558+
},
45494559
{
45504560
"id": "toolInstall",
45514561
"title": "%AWS.toolkit.lambda.walkthrough.toolInstall.title%",
45524562
"description": "%AWS.toolkit.lambda.walkthrough.toolInstall.description%",
45534563
"media": {
45544564
"image": "./resources/walkthrough/appBuilder/install.png",
45554565
"altText": "Showing GUI installer"
4556-
}
4566+
},
4567+
"when": "!isWindows"
45574568
},
45584569
{
45594570
"id": "chooseTemplate",

0 commit comments

Comments
 (0)