Skip to content

AWS API Gateway: Fix API Gateway naming convention - #8339

Merged
medikoo merged 5 commits into
serverless:masterfrom
fabsrc:2918-api-gateway-naming
Oct 19, 2020
Merged

medikoo merged 5 commits into
serverless:masterfrom
fabsrc:2918-api-gateway-naming

Conversation

@fabsrc

@fabsrc fabsrc commented Oct 3, 2020 •

Copy link
Copy Markdown
Contributor

The naming of API Gateway will be changed from ${stage}-${service} to ${service}-${stage} in the next major version.

This commit adds a deprecation notice and an option to already adapt to this this convetion.

Adresses: #2918

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #8339 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8339   +/-   ##
=======================================
  Coverage   88.01%   88.01%           
=======================================
  Files         249      249           
  Lines        9306     9306           
=======================================
  Hits         8191     8191           
  Misses       1115     1115           
Impacted Files Coverage Δ
lib/plugins/aws/lib/naming.js 98.15% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc34140...786852b. Read the comment docs.

@medikoo medikoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @fabsrc for giving that a spin!

Sorry for not having that clear in origin issue, but we cannot introduce breaking changes just like that. All breaking changes are first introduced as deprecation, and then when new major is about to be released we issue a PR's that make changes actually breaking.

I've updated the main description of #2918 with implementation proposal. Please see notes over there, on how it should be approached.

Thank you!

@medikoo medikoo added bug/design Functionality design flaw deprecation Deprecation proposal (breaking with next major) cat/aws-event-api-gateway labels Oct 5, 2020
@fabsrc fabsrc changed the title bug(AWS API Gateway): Change order in naming of API Gateway bug(AWS API Gateway): Add deprecation for API Gateway naming convention Oct 10, 2020
@codecov-io

codecov-io commented Oct 10, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #8339 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8339      +/-   ##
==========================================
+ Coverage   88.02%   88.05%   +0.02%     
==========================================
  Files         249      249              
  Lines        9278     9290      +12     
==========================================
+ Hits         8167     8180      +13     
+ Misses       1111     1110       -1     
Impacted Files Coverage Δ
lib/plugins/aws/provider/awsProvider.js 93.06% <ø> (ø)
lib/plugins/aws/lib/naming.js 98.19% <100.00%> (+0.03%) ⬆️
lib/plugins/aws/lib/monitorStack.js 100.00% <0.00%> (ø)
lib/plugins/aws/package/compile/events/s3/index.js 100.00% <0.00%> (ø)
...ins/aws/package/compile/events/apiGateway/index.js 100.00% <0.00%> (ø)
lib/plugins/aws/invokeLocal/index.js 68.62% <0.00%> (+0.08%) ⬆️
.../package/compile/events/websockets/lib/validate.js 97.56% <0.00%> (+0.33%) ⬆️
...ckage/compile/events/websockets/lib/permissions.js 100.00% <0.00%> (+5.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 661caad...e614199. Read the comment docs.

@fabsrc

fabsrc commented Oct 10, 2020

Copy link
Copy Markdown
Contributor Author

Hey @medikoo.

Thanks for the detailed description how to implement this. Makes a lot of sense to do it that way.
I added the deprecation notice and an option to enable the new convention already.

Could you please have another look?

@medikoo medikoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @fabsrc ! That looks really good. I've proposed few final improvements

Comment thread lib/plugins/aws/lib/naming.js Resolved
Comment thread lib/plugins/aws/provider/awsProvider.js Resolved
Comment thread lib/plugins/aws/provider/awsProvider.js Resolved
@fabsrc
fabsrc requested a review from medikoo October 13, 2020 18:16

@medikoo medikoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @fabsrc, looks very good. Just few last style suggestions

Comment thread lib/plugins/aws/lib/naming.js Resolved
@fabsrc
fabsrc requested a review from medikoo October 14, 2020 18:58

@medikoo medikoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@fabsrc thanks for update. Can you rebase with master? Currently PR has some conflicts and is not in mergeable state

The naming of API Gateway will be changed from `${stage}-${service}` to `${service}-${stage}` in the next major version.

This commit adds a deprecation notice and an option to already adapt to this this convetion.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #8339 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8339      +/-   ##
==========================================
+ Coverage   88.00%   88.05%   +0.04%     
==========================================
  Files         249      249              
  Lines        9264     9290      +26     
==========================================
+ Hits         8153     8180      +27     
+ Misses       1111     1110       -1     
Impacted Files Coverage Δ
lib/plugins/aws/provider/awsProvider.js 93.06% <ø> (-0.37%) ⬇️
lib/plugins/aws/lib/naming.js 98.19% <100.00%> (+0.03%) ⬆️
...s/package/compile/events/apiGateway/lib/apiKeys.js 94.73% <0.00%> (-5.27%) ⬇️
...age/compile/events/apiGateway/lib/usagePlanKeys.js 97.14% <0.00%> (-2.86%) ⬇️
...plugins/aws/package/compile/events/stream/index.js 98.00% <0.00%> (-0.12%) ⬇️
lib/classes/ConfigSchemaHandler/index.js 90.17% <0.00%> (+0.61%) ⬆️
...s/package/compile/events/apiGateway/lib/restApi.js 97.87% <0.00%> (+14.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0394025...ef56afc. Read the comment docs.

@fabsrc
fabsrc requested a review from medikoo October 16, 2020 17:35
@medikoo medikoo changed the title bug(AWS API Gateway): Add deprecation for API Gateway naming convention AWS API Gateway: Fix API Gateway naming convention Oct 19, 2020

@medikoo medikoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @fabsrc !

@medikoo
medikoo merged commit 8566135 into serverless:master Oct 19, 2020
@fabsrc
fabsrc deleted the 2918-api-gateway-naming branch October 24, 2020 17:05
@Poonaka

Poonaka commented Nov 16, 2020

Copy link
Copy Markdown

Will there be a way to keep the old naming convention in future releases?

@medikoo

medikoo commented Nov 16, 2020

Copy link
Copy Markdown
Contributor

Will there be a way to keep the old naming convention in future releases?

Thanks for asking. Currently we want to drop support for old naming intermittently with new version, still we're open for feedback on that.

Do you find it problematic if v3 will not support old naming?

@Poonaka

Poonaka commented Nov 16, 2020

Copy link
Copy Markdown

Will there be a way to keep the old naming convention in future releases?

Thanks for asking. Currently we want to drop support for old naming intermittently with new version, still we're open for feedback on that.

Do you find it problematic if v3 will not support old naming?

We used serverless to setup some Cognito user pools and lambda triggers that occasionally need to be updated. Just wondering how we will migrate to the new naming convention without serverless deleting the user pools.

@fabsrc

fabsrc commented Nov 16, 2020

Copy link
Copy Markdown
Contributor Author

Will there be a way to keep the old naming convention in future releases?

I think by explicitly setting the name of the API Gateway in the provider settings (provider.apiName) you can keep the old convention. E.g.

provider:
  name: aws
  apiName: ${opt:stage, 'dev'}-${self:service.name}

@Poonaka

Poonaka commented Nov 16, 2020

Copy link
Copy Markdown

Will there be a way to keep the old naming convention in future releases?

I think by explicitly setting the name of the API Gateway in the provider settings (provider.apiName) you can keep the old convention. E.g.

provider:
  name: aws
  apiName: ${opt:stage, 'dev'}-${self:service.name}

Perfect, we will give that a shot. Thanks!

@medikoo

medikoo commented Nov 17, 2020

Copy link
Copy Markdown
Contributor

@fabsrc that's a great hint. Also using apiName will turn off the deprecation notice. So that technically the recommended way to carry on without change in next major. I'll add that info to deprecation notes

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

Labels

bug/design Functionality design flaw cat/aws-event-api-gateway deprecation Deprecation proposal (breaking with next major)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants