Skip to content

Conversation

praneetap
Copy link
Contributor

@praneetap praneetap commented Feb 27, 2020

Issue #, if available:

Description of changes:

Description of how you validated changes:
End to end tested
Checklist:

  • Write/update tests
  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected
  • Add/update example to examples/2016-10-31

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@praneetap praneetap changed the title feat: custom domains in HTTP API feat: custom domains in HTTP API (WIP) Feb 27, 2020
@praneetap praneetap changed the title feat: custom domains in HTTP API (WIP) feat: custom domains in HTTP API Feb 27, 2020
@alexw91
Copy link

alexw91 commented Feb 27, 2020

Codecov Report

Merging #1472 into develop will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1472      +/-   ##
===========================================
- Coverage    94.39%   94.35%   -0.05%     
===========================================
  Files           78       78              
  Lines         4714     4819     +105     
  Branches       948      969      +21     
===========================================
+ Hits          4450     4547      +97     
- Misses         121      125       +4     
- Partials       143      147       +4     

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 4a991a0...6fcacc4. Read the comment docs.

Choose a reason for hiding this comment

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

nit: is the empty "" needed after must be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just Black being annoying. will fix

Choose a reason for hiding this comment

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

minor question: I thought if route53.get("IpV6") is True: statement would be enough. Is it needed to add not None check?

Copy link
Contributor

Choose a reason for hiding this comment

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

What are the possible values? If it's only booleans, then if route53.getI("IpV6"): is sufficient by itself.

Choose a reason for hiding this comment

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

Can you update the test by adding condition here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, not sure what you mean? Condition is set on the Api and the Function resource.

Choose a reason for hiding this comment

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

I wanted to see if conditions work for Domain property

Copy link

@ShreyaGangishetty ShreyaGangishetty left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Is Domain supported in globals?

@praneetap
Copy link
Contributor Author

Overall looks good to me. Is Domain supported in globlas?

yes. updated a test to use globals instead

@ShreyaGangishetty
Copy link

Overall looks good to me. Is Domain supported in globlas?

yes. updated a test to use globals instead

Can we add Domain here https://github.com/awslabs/serverless-application-model/blob/develop/docs/globals.rst for HttpApi?

@codecov-io
Copy link

codecov-io commented Feb 29, 2020

Codecov Report

Merging #1472 into develop will decrease coverage by 0.03%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1472      +/-   ##
===========================================
- Coverage    94.15%   94.11%   -0.04%     
===========================================
  Files           78       78              
  Lines         4789     4897     +108     
  Branches       967      988      +21     
===========================================
+ Hits          4509     4609     +100     
- Misses         130      134       +4     
- Partials       150      154       +4
Impacted Files Coverage Δ
samtranslator/plugins/globals/globals.py 99.05% <ø> (ø) ⬆️
samtranslator/model/sam_resources.py 94.29% <100%> (+0.09%) ⬆️
samtranslator/model/apigatewayv2.py 94.73% <100%> (+0.98%) ⬆️
samtranslator/model/api/http_api_generator.py 92.53% <91.75%> (-0.67%) ⬇️

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 c5221fc...fbd3f80. Read the comment docs.

Copy link
Contributor

@keetonian keetonian 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. Conditions look to be handled correctly, and the translation looks good. Just a few other smaller things to address.

# Assign the OpenApi back to template
self.definition_body = editor.openapi

def _construct_api_domain(self, http_api):
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is about 100 lines long, and is conceptually difficult to grasp. Could you break the components apart? It looks like this could be split into Domain, BasePath, and RouteSettings methods.

@alexw91
Copy link

alexw91 commented Mar 3, 2020

Codecov Report

Merging #1472 into develop will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1472      +/-   ##
===========================================
- Coverage    94.15%   94.10%   -0.06%     
===========================================
  Files           78       78              
  Lines         4789     4900     +111     
  Branches       967      988      +21     
===========================================
+ Hits          4509     4611     +102     
- Misses         130      134       +4     
- Partials       150      155       +5     

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 c5221fc...38da4f0. Read the comment docs.

)
if "HostedZoneId" in route53:
record_set_group.HostedZoneId = route53.get("HostedZoneId")
if "HostedZoneName" in route53 and "HostedZoneId" not in route53:
Copy link
Contributor

Choose a reason for hiding this comment

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

if "HostedZoneName" in route53 and "HostedZoneId" not in route53: -> elif "HostedZoneName" in route53:

@ShreyaGangishetty ShreyaGangishetty merged commit 9df2c8a into aws:develop Mar 3, 2020
ShreyaGangishetty pushed a commit to ShreyaGangishetty/serverless-application-model that referenced this pull request Mar 3, 2020
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.

5 participants