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: validate edge function signature at build time #200

Merged
merged 15 commits into from
Nov 18, 2022

Conversation

jackiewmacharia
Copy link
Contributor

🎉 Thanks for sending this pull request! 🎉

Please make sure the title is clear and descriptive.

If you are fixing a typo or documentation, please skip these instructions.

Otherwise please fill in the sections below.

Which problem is this pull request solving?

Example: I'm always frustrated when [...]

List other issues or pull requests related to this problem

This fixes https://github.com/netlify/pod-compute/issues/249

Describe the solution you've chosen

Example: I've fixed this by [...]

Describe alternatives you've considered

Example: Another solution would be [...]

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • The status checks are successful (continuous integration). Those can be seen below.

A picture of a cute animal (not mandatory but encouraged)

@jackiewmacharia jackiewmacharia changed the title Feat/validate edge function at build time feat: validate edge function at build time Nov 16, 2022
@jackiewmacharia jackiewmacharia changed the title feat: validate edge function at build time feat: validate edge function signature at build time Nov 16, 2022
@jackiewmacharia jackiewmacharia marked this pull request as ready for review November 16, 2022 15:45
@jackiewmacharia jackiewmacharia requested a review from a team November 16, 2022 15:45
@jackiewmacharia
Copy link
Contributor Author

A couple of thoughts/pointers on this:

  • I've added the default export validation to the config setup so we only run this block once. This ties this code to config export feature flag and options.
  • I've set it to error on for default export related errors so as to fail at build time.
  • There might be a way to separate validation from getFunctionConfig by moving this block and the config error logger to a validator util. If this is ok, I'm glad to do this in this PR.

deno/config.ts Outdated Show resolved Hide resolved
node/config.ts Outdated Show resolved Hide resolved
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

I left a few small comments, but otherwise looking great!

node/config.ts Outdated Show resolved Hide resolved
node/config.ts Outdated Show resolved Hide resolved
node/config.ts Outdated Show resolved Hide resolved
node/config.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

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

🚀

@jackiewmacharia jackiewmacharia merged commit 2f81b01 into main Nov 18, 2022
@jackiewmacharia jackiewmacharia deleted the feat/validate-edge-function-at-build-time branch November 18, 2022 09:36
Skn0tt pushed a commit to netlify/build that referenced this pull request Apr 23, 2024
…ndler#200)

* feat: validate edge function signature at build time
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.

None yet

2 participants