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

6653 serverless functions store and use environment variables in serverless function scripts #7390

Conversation

martmull
Copy link
Contributor

@martmull martmull commented Oct 2, 2024

image
image

@martmull martmull marked this pull request as ready for review October 2, 2024 12:37
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request implements significant changes to support environment variables in serverless function scripts and enhances the overall serverless function management system.

  • Introduced multi-file support in SettingsServerlessFunctionCodeEditorTab.tsx and CodeEditor.tsx, allowing for separate environment files and improved code organization
  • Removed sourceCodeHash field from serverless function schema and related components, indicating a shift in tracking function changes
  • Added new download method to StorageDriver interface and implemented in LocalDriver and S3Driver, enhancing file management capabilities
  • Refactored LambdaDriver and LocalDriver to support environment variables, improve build processes, and enhance error handling
  • Replaced single file compilation with project-based compilation in compile-typescript.ts, enabling more complex TypeScript projects for serverless functions

29 file(s) reviewed, 15 comment(s)
Edit PR Review Bot Settings

Copy link
Contributor

@Devessier Devessier left a comment

Choose a reason for hiding this comment

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

Excellent job, @martmull, as usual. The serverless functions feature is complex, but you can manage it perfectly. The scope of the feature goes from creating a smooth UX within a code editor to executing arbitrary code safely. Good job!

I wrote some comments about little things. Feel free to reach out to me if I wasn't clear enough.

@Devessier Devessier self-requested a review October 3, 2024 10:08
Copy link
Contributor

@Devessier Devessier left a comment

Choose a reason for hiding this comment

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

Great job! 😄 🎉

Comment on lines 131 to 140
const onEnvFileChange = (value: string) => {
if (
!isDefined(currentFile) ||
currentFile.path !== '.env' ||
!isDefined(monacoInstance)
) {
return;
}
setEnvFileLib(value);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay 😮 👌

@martmull martmull force-pushed the 6653-serverless-functions-store-and-use-environment-variables-in-serverless-function-scripts branch from 4f30c4f to 2c1e431 Compare October 3, 2024 11:47
@martmull martmull merged commit 62fe1d0 into main Oct 3, 2024
7 of 13 checks passed
@martmull martmull deleted the 6653-serverless-functions-store-and-use-environment-variables-in-serverless-function-scripts branch October 3, 2024 11:56
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.

Serverless Functions: Store and use environment variables in serverless function scripts
2 participants