-
Notifications
You must be signed in to change notification settings - Fork 749
feat(lambda): Building Quick Pick structure and Entrypoints #6592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(lambda): Building Quick Pick structure and Entrypoints #6592
Conversation
|
0dadc3c to
bb4eeef
Compare
|
I didn't see the runtime version search (like python3.9). And could you add a scrnshot on the template preview functionality? |
packages/core/src/awsService/appBuilder/wizards/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/wizards/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
|
Can you add tests as well? |
| const projectRoot = path.resolve(__dirname, '../../../../../') | ||
| const metadataPath = path.join(projectRoot, 'src', 'awsService', 'appBuilder', 'models', 'metadata.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work when the extension is compiled and loaded through a VSIX or through the official marketplace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll check that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still part of the latest version. Did you try it with the built extension? I think we can change it later, but we need to make sure we test the right case. (I feel there should be another proper way of reading the file instead of just going up directories starting on __dirname, but maybe I'm wrong and this is the way)
packages/core/src/awsService/appBuilder/wizards/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/wizards/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
@roger-zhangg, there will be no specific runtime version search for this project. As the serverless land does not provide options to select from runtime version. |
a9985e4 to
7ce29c3
Compare
@seshubaws, I'll do it later once the basic implementation is completed. |
7ce29c3 to
9e2ebad
Compare
| public override async run(): Promise<CreateServerlessLandWizardForm | undefined> { | ||
| try { | ||
| // Load metadata from JSON file | ||
| const projectRoot = path.resolve(__dirname, '../../../../../') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the best way to get the root? I'd rather have an absolute path rather than this relative way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path.resolve() function does return an absolute file path.
Previously, when executing the below line of code, an additional /dist directory was being prepended to the path before the src directory, resulting in a metadata not found error.
const metadataPath = path.resolve(__dirname, './serverlessland-metadata.json')
packages/core/src/awsService/appBuilder/serverlessLand/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/serverlessLand/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
| getLogger().error( | ||
| localize( | ||
| 'AWS.serverlessland.initWizard.general.error', | ||
| 'Error creating new SAM Application. {0}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I imagine we'll change this message later to not say "SAM"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll handle error and metrics together for the whole project separately
packages/core/src/awsService/appBuilder/serverlessLand/serverlessLandMain.ts
Show resolved
Hide resolved
| const projectRoot = path.resolve(__dirname, '../../../../../') | ||
| const metadataPath = path.join(projectRoot, 'src', 'awsService', 'appBuilder', 'models', 'metadata.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still part of the latest version. Did you try it with the built extension? I think we can change it later, but we need to make sure we test the right case. (I feel there should be another proper way of reading the file instead of just going up directories starting on __dirname, but maybe I'm wrong and this is the way)
packages/core/src/awsService/appBuilder/serverlessLand/serverlessLandWizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/serverlessLand/metadataManager.ts
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/serverlessLand/metadataManager.ts
Outdated
Show resolved
Hide resolved
| public override async run(): Promise<CreateServerlessLandWizardForm | undefined> { | ||
| try { | ||
| // Load metadata from JSON file | ||
| const projectRoot = path.resolve(__dirname, '../../../../../') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to double check, is the metadata.json getting copied to the correct location when you build it? Usually you would need modify copyFiles to move it IIRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is something I'm currently working on. Will correct that in next PR.
packages/core/src/awsService/appBuilder/serverlessLand/wizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/serverlessLand/wizard.ts
Outdated
Show resolved
Hide resolved
packages/core/src/awsService/appBuilder/serverlessLand/wizard.ts
Outdated
Show resolved
Hide resolved
68c864f
into
aws:feature/serverlessland
## Problem Adding entry points and Quick Pick structure for Serverless Land integration project. The attached images demonstrate the functionality. The `metadata.json` file is currently a sample, but it will be modified to include the exact list of patterns. ## Solution ### **EntryPoints** From AWS Application Builder <img width="698" alt="Screenshot 2025-02-16 at 7 33 29 PM" src="https://github.com/user-attachments/assets/1b0b563e-e6f3-414e-ad7d-b895c172b5f3" /> From Command Palette <img width="920" alt="Screenshot 2025-02-16 at 5 10 37 PM" src="https://github.com/user-attachments/assets/773c2727-344c-4100-8ee5-09efb52809f7" /> From Lambda in AWS Explorer <img width="481" alt="Screenshot 2025-02-18 at 3 22 54 PM" src="https://github.com/user-attachments/assets/b4b9a9f8-1e34-44ed-8b6d-0aeaac03e7a0" /> From the link in Getting Started Walkthrough <img width="669" alt="Screenshot 2025-02-18 at 3 36 42 PM" src="https://github.com/user-attachments/assets/f57a3b20-41df-4845-bbb8-c253bf8db592" /> ### **Quick Pick** Pattern selection <img width="893" alt="Screenshot 2025-02-16 at 7 28 25 PM" src="https://github.com/user-attachments/assets/1844dd2e-f996-4d54-a9f2-bae9af4eee84" /> Runtime selection <img width="917" alt="Screenshot 2025-02-16 at 7 28 33 PM" src="https://github.com/user-attachments/assets/73532262-70b1-412a-92e3-7ad12075ecb1" /> IaC selection <img width="907" alt="Screenshot 2025-02-16 at 7 28 39 PM" src="https://github.com/user-attachments/assets/92c093ce-8e0f-42b5-91f9-f0672dbce9f9" /> Project location selection <img width="921" alt="Screenshot 2025-02-16 at 5 12 04 PM" src="https://github.com/user-attachments/assets/c24b1b99-834b-4e1a-b34a-062ad927bafa" /> Project Name <img width="909" alt="Screenshot 2025-02-16 at 5 12 19 PM" src="https://github.com/user-attachments/assets/423165bb-ad59-4c15-b6da-582a44de8753" /> --- - 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: Vandita Patidar <[email protected]>
## Problem Adding entry points and Quick Pick structure for Serverless Land integration project. The attached images demonstrate the functionality. The `metadata.json` file is currently a sample, but it will be modified to include the exact list of patterns. ## Solution ### **EntryPoints** From AWS Application Builder <img width="698" alt="Screenshot 2025-02-16 at 7 33 29 PM" src="https://github.com/user-attachments/assets/1b0b563e-e6f3-414e-ad7d-b895c172b5f3" /> From Command Palette <img width="920" alt="Screenshot 2025-02-16 at 5 10 37 PM" src="https://github.com/user-attachments/assets/773c2727-344c-4100-8ee5-09efb52809f7" /> From Lambda in AWS Explorer <img width="481" alt="Screenshot 2025-02-18 at 3 22 54 PM" src="https://github.com/user-attachments/assets/b4b9a9f8-1e34-44ed-8b6d-0aeaac03e7a0" /> From the link in Getting Started Walkthrough <img width="669" alt="Screenshot 2025-02-18 at 3 36 42 PM" src="https://github.com/user-attachments/assets/f57a3b20-41df-4845-bbb8-c253bf8db592" /> ### **Quick Pick** Pattern selection <img width="893" alt="Screenshot 2025-02-16 at 7 28 25 PM" src="https://github.com/user-attachments/assets/1844dd2e-f996-4d54-a9f2-bae9af4eee84" /> Runtime selection <img width="917" alt="Screenshot 2025-02-16 at 7 28 33 PM" src="https://github.com/user-attachments/assets/73532262-70b1-412a-92e3-7ad12075ecb1" /> IaC selection <img width="907" alt="Screenshot 2025-02-16 at 7 28 39 PM" src="https://github.com/user-attachments/assets/92c093ce-8e0f-42b5-91f9-f0672dbce9f9" /> Project location selection <img width="921" alt="Screenshot 2025-02-16 at 5 12 04 PM" src="https://github.com/user-attachments/assets/c24b1b99-834b-4e1a-b34a-062ad927bafa" /> Project Name <img width="909" alt="Screenshot 2025-02-16 at 5 12 19 PM" src="https://github.com/user-attachments/assets/423165bb-ad59-4c15-b6da-582a44de8753" /> --- - 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: Vandita Patidar <[email protected]>
Problem
Adding entry points and Quick Pick structure for Serverless Land integration project. The attached images demonstrate the functionality. The
metadata.jsonfile is currently a sample, but it will be modified to include the exact list of patterns.Solution
EntryPoints
From AWS Application Builder

From Command Palette

From Lambda in AWS Explorer

From the link in Getting Started Walkthrough

Quick Pick
Pattern selection

Runtime selection

IaC selection

Project location selection

Project Name

feature/xbranches will not be squash-merged at release time.