Validate handler paths during sst dev deployment#6681
Open
anatolzak wants to merge 3 commits intoanomalyco:devfrom
Open
Validate handler paths during sst dev deployment#6681anatolzak wants to merge 3 commits intoanomalyco:devfrom
anatolzak wants to merge 3 commits intoanomalyco:devfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #6680
Summary
ValidateHandlermethod to theRuntimeinterface, implemented across all runtimes (Node, Python, Go, Rust, Worker)Runtime.AddTargetRPC now validates handler paths before registering targets, sosst devcatches invalid handlers during deployment instead of at invocation timebundlecase inCollection.Build, which previously skipped all checkssst devso this was not an issue previously, but addedValidateHandlerfor consistency with the other runtimesBefore/After
Videos below demonstrate the developer experience for each runtime when an invalid handler path is provided. Previously, when you ran
sst dev, no error appeared during deployment if you specified an invalid handler path (e.g., a non-existent file). The error only became apparent when you invoked the function. Now, the error is displayed immediately during deployment.Lambda Node.JS
Before:
before-nodejs.mp4
After:
after-nodejs.mp4
Lambda Golang
Before:
before-golang.mp4
After:
after-golang.mp4
Lambda Python
Before:
before-python.mp4
After:
after-python.mp4
Lambda Rust
Before:
before-rust.mp4
After:
after-rust.mp4
Cloudflare Workers
Workers already performed a build step during sst dev so this was not an issue previously, but added ValidateHandler for consistency with the other runtimes.
after-worker.mp4
Test plan
sst devwith invalid handler path — verify error surfaces during deployment (Node, Python, Go, Rust, Workers)sst devwith valid handler path — verify no regression (Node, Python, Go, Rust, Workers)sst deploywith invalid handler — verify existing behavior unchanged (Node, Python, Go, Rust, Workers)non/existent.aws-rust-lambda), but SST deploy did not throw any errors. SST essentially treated it as if you had provided the following handler:.aws-rust-lambda. Now,sst deploywill throw an error in the same way thatsst devcurrently does for invalid handlers.sst deploywith valid handler path — verify no regression (Node, Python, Go, Rust, Workers)