-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(ec2): export NatGatewayProvider for consistency with NatInstanceProvider #28810
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Clarification Request: this change is somewhere between a feature and a bug fix (actual change is tiny).
|
Applying a bit more thought, I think this is a bug fix more than a feature - the change to actual functionality is the addition of a single |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
# Conflicts: # packages/aws-cdk-lib/aws-ec2/test/vpc.test.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits but looks good to me.
Hmm, not totally sure how I feel about this one, not because anything you've done here is invalid but because it looks to me like the error here was exporting the other function, not the lack of export on this one. We can't undo the export because that would be a breaking change, but I'm not sure if it's better to have it consistently wrong in both places or inconsistent. |
packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-gateway-provider.ts
Outdated
Show resolved
Hide resolved
Array.isArray(vpc); | ||
Array.isArray(natGatewayProvider.configuredGateways); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based the test on https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.nat-instances.lit.ts, which includes the assertions
I've seen folks be confused by the current inconsistency. In the design of the CDK docs, the natural way (for me) to find the implementations of an abstract class (such as I think I agree that it would be best to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen folks be confused by the current inconsistency. In the design of the CDK docs, the natural way (for me) to find the implementations of an abstract class (such as NatProvider) is to view the classes listed in Implemented by. Currently this misses NatGatewayProvider, but includes NatInstanceProvider. The new NatInstanceProviderV2, which was added since I raised this CR, is also exported.
I think I agree that it would be best to export none of them (and add a usage note to the docs of NatProvider), but that's not an option now, and I think exporting one but not the other (current situation) is worse than exporting all (this CR).
Fair point.
YOLO
Pull request has been modified.
Drat. This failing test has nothing to do with your change and everything to do with how long your waiting on this approval. I'll fix it. |
Ack - I recall getting integ tests working in my environment was a bit of a chore, so happy to let you do it this time 😁 |
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YOLO Again. I should probably stop saying that in official PR reviews... ¯\(ツ)/¯
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Export
NatGatewayProvider
for two reasons: to allow instantiation withnew
, and to make docs present it as an implementation ofNatProvider
.Also added a unit test for the same "functionality" for
NatInstanceProvider
, for symmetry with the added test forNatGatewayProvider
.Unit test and integration test for new functionality added.
Closes #28372.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license