You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(lambda): Updates for Lambda quick edit (#7656)
This PR contains updates for miscellaneous features related to the new
Lambda quick edit.
## Handling of empty directories
### Problem
Previously, having an empty directory in the Lambda quick edit flow led
to errors when trying to view the function code in the explorer or in a
workspace. An empty folder could be the result of an error during
download. The unintended bug in the code was related to how we were
checking for existence of a function saved locally.
### Solution
Check if there are any files in the directory before determining if it
exists locally. If the directory is empty, we must redownload the code
(a Lambda function cannot be empty, so we know it is unintended)
## README updates
### Problem
- A couple typographic errors
- README was opening as separate tab, not as split pane
- README was referencing "cloud deploy icon" rather than showing the
actual icon, same with the invoke icon
### Solution
- Fix errors
- Adjust README open to use `markdown.showPreviewToSide`
- Save the icons locally so we can display them in the actual README.
## Quick Edit Flow updates
### Problem
- Some non-passive metrics were being emitted on activation
- Downloading code on activation lead to race conditions with
authentication
- Downloading code on activation lead to extra slow load times
### Solution
All of this is fixed by moving things around so that there is never any
code downloaded during activation. This is beneficial because it keeps
us from doing a lot of our main functionality on activation.
Previously, opening a function in a workspace, which could be done
through a URI handler or from the explorer, would cause the extension to
restart. Once the extension restarted, at that point we would download
the code and start the watchers. These changes download the code first,
and only start the watchers on activation. Because the user doesn't need
to be authenticated to start the watchers (only to deploy), this is not
an issue for being authenticated. If it's a workspace folder, we're
assuming the function exists locally, so that's why we know we've
downloaded the code already.
The only edge case is if the local code is out of sync with what's in
the cloud; in this case, we prompt the user to overwrite their code, but
they need to go to the explorer to manually download it to avoid the
activation race conditions.
---
- 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.
Learn how to view your Lambda Function locally, iterate, and deploy changes to the AWS Cloud.
3
+
Learn how to view your Lambda function locally, iterate, and deploy changes to the AWS Cloud.
4
4
5
5
## Edit your Lambda function
6
6
@@ -9,11 +9,11 @@ Learn how to view your Lambda Function locally, iterate, and deploy changes to t
9
9
10
10
## Manage your Lambda functions
11
11
12
-
- Select the AWS icon in the left sidebar and select **EXPLORER**
12
+
- Select the AWS Toolkit icon in the left sidebar and select **EXPLORER**
13
13
- In your desired region, select the Lambda dropdown menu:
14
-
- To save and deploy a previously edited Lambda function, select the cloud deploy icon next to your Lambda function.
15
-
- To remotely invoke a function, select the play icon next to your Lambda function.
14
+
- To save and deploy a previously edited Lambda function, select the  icon next to your Lambda function.
15
+
- To remotely invoke a function, select the  icon next to your Lambda function.
16
16
17
-
## Advanced Features
17
+
## Advanced features
18
18
19
19
- To convert to a Lambda function to an AWS SAM application, select the  icon next to your Lambda function. For details on what AWS SAM is and how it can help you, see the [AWS Serverless Application Model Developer Guide](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html).
0 commit comments