Skip to content

Warn if function conditions are not met #224

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

Merged
merged 2 commits into from
Apr 15, 2020
Merged

Conversation

mraerino
Copy link
Contributor

@mraerino mraerino commented Apr 14, 2020

Summary

I recently discovered that we do not deploy go functions with invalid permissions set.
This made me want to introduce a warning for it.

DeployWarner is an interface that consumers of this library can choose to implement on top of DeployObserver. Therefore this is not breaking.

Test plan

I did not choose to implement a test because this is only a log output.

Cute animal

@mraerino mraerino requested a review from a team as a code owner April 14, 2020 11:27
@netlify
Copy link

netlify bot commented Apr 14, 2020

Deploy preview for open-api ready!

Built with commit 337aa07

https://deploy-preview-224--open-api.netlify.com

file, err := newFunctionFile(filePath, i, goRuntime, observer)
if err != nil {
return nil, err
}
functions.Add(file.Name, file)
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious if there is a case that function directory could have some files that are not zip nor js nor go legitimately

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 think this walks the temporary dir from zisi, therefore only files that zisi picked up should be there

Copy link
Contributor

@keiko713 keiko713 left a comment

Choose a reason for hiding this comment

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

looks good 🎉

@mraerino mraerino merged commit fc80f78 into master Apr 15, 2020
@mraerino mraerino deleted the feat/func-deploy-warnings branch April 15, 2020 02:07
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.

2 participants