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

Add warning for multiple functions having same handler #5638

Merged
merged 6 commits into from Jan 1, 2019

Conversation

Projects
None yet
4 participants
@exoego
Copy link
Contributor

exoego commented Dec 30, 2018

What did you implement:

Closes #4414

How did you implement it:

Add warning to Service#validate.

Warning messages will be like

A handler "foo.functionA" is duplicated in functions: functionA, functionB.

How can we verify it:

Run test.

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

@exoego exoego force-pushed the exoego:same-handler-warning branch from 213b85e to e15f367 Dec 30, 2018

@exoego exoego force-pushed the exoego:same-handler-warning branch from e15f367 to 58f3cc2 Dec 30, 2018

@horike37
Copy link
Member

horike37 left a comment

Thanks again @exoego 👍
This works as expected and adding one minor comment for warning message style. Please check it

const handlerName = arg[0];
const functionGroup = arg[1].map(func => func.name);
const warnMessage = [
`A handler "${handlerName}" is duplicated in functions: `,

This comment has been minimized.

@horike37

horike37 Dec 31, 2018

Member

Please add Warning: prefix like this
2018-12-31 15 09 31

This comment has been minimized.

@exoego

exoego Dec 31, 2018

Contributor

Done in e2722a7

@dschep

dschep approved these changes Dec 31, 2018

Copy link
Member

dschep left a comment

lgtm! :shipit:

@horike37

This comment has been minimized.

Copy link
Member

horike37 commented Jan 1, 2019

@exoego
Thanks for updating 👍
LGTM.

@horike37 horike37 merged commit 43b8415 into serverless:master Jan 1, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 90.813%
Details

@exoego exoego deleted the exoego:same-handler-warning branch Jan 1, 2019

dschep added a commit that referenced this pull request Jan 9, 2019

v1.36.0 release!
 - [Log AWS SDK calls in debug mode](#5604)
 - [Added currently supported regions for GCP functions](#5601)
 - [Update Cloudflare Templates](#5620)
 - [AWS: Validate rate/cron syntax before Deploy](#5635)
 - [Fix error log output](#5378)
 - [Support for native async/await in AWS Lambda for aws-nodejs-typescript template ](#5607)
 - [aws-csharp create template uses handler-specific artifact](#5411)
 - [change behaviour on initial stack create failed](#5631)
 - [Add warning for multiple functions having same handler](#5638)
 - [AWS: Add API Gateway stage name validation.](#5639)

@dschep dschep referenced this pull request Jan 9, 2019

Merged

v1.36.0 release! #5670

@shortjared shortjared added this to the 1.36.0 milestone Jan 9, 2019

@horike37 horike37 referenced this pull request Jan 21, 2019

Closed

Add option to configure duplicate-handlers warnings #5729

7 of 7 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment