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

chore: use processedOptions #834

Merged

Conversation

CorentinDoue
Copy link
Contributor

@CorentinDoue CorentinDoue commented May 17, 2021

What did you implement:

Closes #833

Use processed options as suggested by @medikoo in serverless/serverless#9452 to improve the support for non-AWS providers

How did you implement it:

The raw options are now overridden by the processed options from serverless.processedInput.options during the initialize hook. (The first to be called at runtime)

How can we verify it:

Example with the command sls invoke local -f myFunctionName on GCP.
Before:
Screenshot from 2021-05-17 17-26-47
After:
Screenshot from 2021-05-17 17-27-02

I also tested it on an existing AWS project to check it broke nothing.

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

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

This looks ok to me, thanks for the contribution @CorentinDoue.
Can you see how to fix the serverless v1 build?

@CorentinDoue
Copy link
Contributor Author

Can you see how to fix the serverless v1 build

I think serverless.processedInput does not exist with serverless v1. I will add an if to handle the retrocompatibility

@CorentinDoue CorentinDoue force-pushed the chore/use-processed-options branch from 9004807 to ca53403 Compare May 18, 2021 13:55
@CorentinDoue CorentinDoue requested a review from j0k3r May 18, 2021 13:57
Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

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

Thanks!

@j0k3r j0k3r added this to the 5.5.1 milestone May 18, 2021
@j0k3r j0k3r merged commit ddd8dd9 into serverless-heaven:master May 18, 2021
@CorentinDoue CorentinDoue deleted the chore/use-processed-options branch May 19, 2021 08:08
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.

Use processed options to improve non-AWS provider support
2 participants