Skip to content
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

Merged
merged 6 commits into from
Feb 20, 2025

Conversation

Vandita2020
Copy link
Contributor

@Vandita2020 Vandita2020 commented Feb 17, 2025

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
Screenshot 2025-02-16 at 7 33 29 PM

From Command Palette
Screenshot 2025-02-16 at 5 10 37 PM

From Lambda in AWS Explorer
Screenshot 2025-02-18 at 3 22 54 PM

From the link in Getting Started Walkthrough
Screenshot 2025-02-18 at 3 36 42 PM

Quick Pick

Pattern selection
Screenshot 2025-02-16 at 7 28 25 PM

Runtime selection
Screenshot 2025-02-16 at 7 28 33 PM

IaC selection
Screenshot 2025-02-16 at 7 28 39 PM

Project location selection
Screenshot 2025-02-16 at 5 12 04 PM

Project Name
Screenshot 2025-02-16 at 5 12 19 PM


  • 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.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Vandita2020 Vandita2020 requested a review from a team as a code owner February 17, 2025 01:18
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.
  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@Vandita2020 Vandita2020 force-pushed the entrypoints branch 2 times, most recently from 0dadc3c to bb4eeef Compare February 17, 2025 03:28
@roger-zhangg
Copy link
Member

roger-zhangg commented Feb 17, 2025

I didn't see the runtime version search (like python3.9). And could you add a scrnshot on the template preview functionality?

@seshubaws
Copy link
Contributor

Can you add tests as well?

Comment on lines 158 to 159
const projectRoot = path.resolve(__dirname, '../../../../../')
const metadataPath = path.join(projectRoot, 'src', 'awsService', 'appBuilder', 'models', 'metadata.json')
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check that

Copy link
Contributor

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)

@Vandita2020
Copy link
Contributor Author

I didn't see the runtime version search (like python3.9). And could you add a scrnshot on the template preview functionality?

@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.
I'll open another PR for the template preview in the web-view

@Vandita2020 Vandita2020 force-pushed the entrypoints branch 3 times, most recently from a9985e4 to 7ce29c3 Compare February 18, 2025 22:02
@Vandita2020
Copy link
Contributor Author

Can you add tests as well?

@seshubaws, I'll do it later once the basic implementation is completed.

public override async run(): Promise<CreateServerlessLandWizardForm | undefined> {
try {
// Load metadata from JSON file
const projectRoot = path.resolve(__dirname, '../../../../../')
Copy link
Contributor

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

Copy link
Contributor Author

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')

getLogger().error(
localize(
'AWS.serverlessland.initWizard.general.error',
'Error creating new SAM Application. {0}',
Copy link
Contributor

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"

Copy link
Contributor Author

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

Comment on lines 158 to 159
const projectRoot = path.resolve(__dirname, '../../../../../')
const metadataPath = path.join(projectRoot, 'src', 'awsService', 'appBuilder', 'models', 'metadata.json')
Copy link
Contributor

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)

public override async run(): Promise<CreateServerlessLandWizardForm | undefined> {
try {
// Load metadata from JSON file
const projectRoot = path.resolve(__dirname, '../../../../../')
Copy link
Contributor

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

Copy link
Contributor Author

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.

@jpinkney-aws jpinkney-aws merged commit 68c864f into aws:feature/serverlessland Feb 20, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants