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(elasticloadbalancerV2): logicalId supports switch from addTargetGroups (under feature flag) #29513

Merged
merged 14 commits into from
Apr 3, 2024

Conversation

ahammond
Copy link
Contributor

@ahammond ahammond commented Mar 16, 2024

Issue ELBv2 logicalId inconsistency of ApplicationListenerRule logicalIds

Mitigates #29496

Reason for this change

People using ALBs who need to migrate from the addTargetGroups() convenience method to the lower level addAction() method should not be blocked due to inconsistent logicalId's. Further, the logicalIds should be consistent going forward.

Description of changes

There are two feature flags, one which sets a migration compat mode and another which fixed the behaviour to be consistent.

Description of how you validated changes

Unit testing.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team March 16, 2024 00:03
@github-actions github-actions bot added bug This issue is a bug. p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels Mar 16, 2024
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.

@ahammond ahammond changed the title fix(ElasticLoadBalancerV2): consistent logicalIds (under feature flag) fix(aws-elasticloadbalancerV2): consistent logicalIds (under feature flag) Mar 16, 2024
@ahammond ahammond changed the title fix(aws-elasticloadbalancerV2): consistent logicalIds (under feature flag) fix(elasticloadbalancerV2): consistent logicalIds (under feature flag) Mar 16, 2024
@ahammond
Copy link
Contributor Author

ahammond commented Mar 25, 2024

Exemption Request: Per https://github.com/ahammond/aws-cdk/blob/62be9c7a06e3191ea8ada225eb69c626d22033e4/INTEGRATION_TESTS.md#L32 none of the conditions which require an integration test pertain.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Mar 25, 2024
@ahammond ahammond force-pushed the logicalId-consistency branch 2 times, most recently from fe2d9cc to 143a485 Compare March 26, 2024 20:17
@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 Mar 26, 2024
Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution @ahammond! The changes look good to me overall but I've just let some comments regarding theENABLE_ALBV2_EXTERNALAPPLICATIONLISTENER_ADDTARGETGROUP_CONSISTENT_LOGICALID feature flag as well as some wording changes.

We apologize for the delay in reviewing your PR. We'll make sure this gets prioritized and hopefully merged as part of the 2.136.0 release this week. We appreciate your patience.

@@ -309,3 +309,29 @@ _cdk.json_
}
}
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add the feature flag to the FEATURE_FLAGS.md file.

packages/aws-cdk-lib/cx-api/README.md Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
@paulhcsun paulhcsun added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Apr 2, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 2, 2024 00:45

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

@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 Apr 2, 2024
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
@mergify mergify bot dismissed paulhcsun’s stale review April 2, 2024 14:48

Pull request has been modified.

@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 Apr 2, 2024
ahammond and others added 4 commits April 2, 2024 08:51
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
Co-authored-by: paulhcsun <47882901+paulhcsun@users.noreply.github.com>
@ahammond ahammond changed the title fix(elasticloadbalancerV2): consistent logicalIds (under feature flag) fix(elasticloadbalancerV2): logicalId supports switch from addTargetGroups (under feature flag) Apr 2, 2024
Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

Just adding a new line to keep the spacing consistent here.

packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

Just adding a new line to keep the spacing consistent here.

Copy link
Contributor

@paulhcsun paulhcsun left a comment

Choose a reason for hiding this comment

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

Nice work @ahammond, thanks again for the contribution. Looking forward to this fix being part of the next release!

@paulhcsun
Copy link
Contributor

@Mergifyio update

@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 Apr 3, 2024
Copy link
Contributor

mergify bot commented Apr 3, 2024

update

✅ Branch has been successfully updated

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Apr 3, 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).

@mergify mergify bot merged commit 8e3848c into aws:main Apr 3, 2024
9 checks passed
@ahammond ahammond deleted the logicalId-consistency branch April 3, 2024 18:18
@scanlonp
Copy link
Contributor

scanlonp commented Apr 3, 2024

Hey @ahammond, saw that the recommended value for this feature flag is false. This makes me question if we need a feature flag or not. I see feature flags as a way to change default behavior while staying backwards compatible. If you only need this behavior some of the time, I would think setting a property is the way to go.

Is adding an optional prop to AddApplicationActionProps that controls how the suffix is generated possible?

@ahammond
Copy link
Contributor Author

ahammond commented Apr 3, 2024

@scanlonp I don't have a strong feeling either way here.

@scanlonp
Copy link
Contributor

scanlonp commented Apr 4, 2024

Got it. I saw @TheRealAmazonKendra commented on your related PR. I think there has been a concerted effort to limit our feature flags, and properties looks like the best path here, so let's go with properties.

@scanlonp
Copy link
Contributor

scanlonp commented Apr 4, 2024

Going to revert this specific PR, but I will be attentive to your two PRs so that we can get them in quickly for you.

mergify bot pushed a commit that referenced this pull request Apr 4, 2024
…ddTargetGroups (under feature flag)" (#29716)

Reverts #29513

We will want to use a property to achieve the desired behavior instead of a feature flag since we are not changing the default behavior.
@ahammond
Copy link
Contributor Author

@scanlonp to clarify, I don't care how it is solved, I care that it is solved. We are now 4 weeks since this fix was initially pushed. Regarding the props based PR I pushed on Fri Apr 5th, I addressed the comments on Monday Apr 8th in the morning. FYI, as a workaround we have bundled the entire aws-cdk-lib package into one of our internal libs and are using patch-package to apply a hack-around. This is incredibly fragile and I would like to get us back to stock ASAP.

mergify bot pushed a commit that referenced this pull request Apr 17, 2024
…icationListener.addAction() (#29746)

### Issue # (if applicable)

Closes #29496

### Reason for this change

See #29513 (props based solution instead of feature-flag)

### Description of changes

Adds a `removeSuffix` property to addAction method to address problems due to logicalId inconsistency.

### Description of how you validated changes

UTs. Per IT document, integration tests are not necessary.

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. valued-contributor [Pilot] contributed between 6-12 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants