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

fix(ec2): export NatGatewayProvider for consistency with NatInstanceProvider #28810

Merged
merged 15 commits into from
Jul 31, 2024

Conversation

crh23
Copy link
Contributor

@crh23 crh23 commented Jan 22, 2024

Export NatGatewayProvider for two reasons: to allow instantiation with new, and to make docs present it as an implementation of NatProvider.
Also added a unit test for the same "functionality" for NatInstanceProvider, for symmetry with the added test for NatGatewayProvider.
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

@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Jan 22, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team January 22, 2024 13:11
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@crh23 crh23 changed the title feat(aws-ec2) export NatGatewayProvider for consistency with NatInstanceProvider feat(aws-ec2): export NatGatewayProvider for consistency with NatInstanceProvider Jan 22, 2024
@crh23
Copy link
Contributor Author

crh23 commented Jan 22, 2024

Clarification Request: this change is somewhere between a feature and a bug fix (actual change is tiny).

  1. Should I relabel it as a bug fix?
  2. If not, is a README change required? The enabled functionality is very minor, and the previously-available version isn't in the README currently (closest is "Using NAT instances")

@aws-cdk-automation aws-cdk-automation added the pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run label Jan 22, 2024
@crh23 crh23 changed the title feat(aws-ec2): export NatGatewayProvider for consistency with NatInstanceProvider feat(ec2): export NatGatewayProvider for consistency with NatInstanceProvider Jan 22, 2024
@crh23 crh23 marked this pull request as ready for review January 22, 2024 13:39
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 26, 2024
@crh23 crh23 changed the title feat(ec2): export NatGatewayProvider for consistency with NatInstanceProvider fix(ec2): export NatGatewayProvider for consistency with NatInstanceProvider Jan 30, 2024
@crh23
Copy link
Contributor Author

crh23 commented Jan 30, 2024

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 export, and it seems unintentional that that wasn't already present. Labels will probably be all messed up, sorry

@aws-cdk-automation aws-cdk-automation dismissed their stale review January 30, 2024 16:45

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation
Copy link
Collaborator

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
Copy link
Contributor

@msambol msambol left a 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.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 21, 2024
@TheRealAmazonKendra
Copy link
Contributor

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.

Comment on lines 26 to 27
Array.isArray(vpc);
Array.isArray(natGatewayProvider.configuredGateways);
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 these for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@crh23
Copy link
Contributor Author

crh23 commented Apr 17, 2024

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.

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).

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a 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

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review July 31, 2024 17:15

Pull request has been modified.

@TheRealAmazonKendra
Copy link
Contributor

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.

@crh23
Copy link
Contributor Author

crh23 commented Jul 31, 2024

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 😁
(assuming that is what the issue is)

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review July 31, 2024 18:53

Pull request has been modified.

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a 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... ¯\(ツ)

Copy link
Contributor

mergify bot commented Jul 31, 2024

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 08579ca
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit fbc28bc into aws:main Jul 31, 2024
10 checks passed
Copy link
Contributor

mergify bot commented Jul 31, 2024

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).

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-ec2: Export NatGatewayProvider
4 participants