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(s3-notifications): unable to delete the existing S3 event notifications #29022

Closed
wants to merge 6 commits into from

Conversation

sarangarav
Copy link
Contributor

@sarangarav sarangarav commented Feb 7, 2024

Issue # (if applicable)

Reason for this change

Fix to address the issues deleting the existing S3 event notifications and adding new event notifications on top of existing notifications.

Description of changes

We fixed the hashing logic used to identify old vs external S3 event notifications

Description of how you validated changes

Manually tested the changes

Checklist


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 p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Feb 7, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team February 7, 2024 20: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.

@sarangarav
Copy link
Contributor Author

Exemption Request

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Feb 7, 2024
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 and removed p2 labels Feb 16, 2024
@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED 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.

…tions and adding new event notifications on top of existing notifications
@sarangarav
Copy link
Contributor Author

The pull request linter fails with the following errors:

❌ Fixes must contain a change to a test file.
❌ Fixes must contain a change to an integration test file and the resulting snapshot.
❌ Breaking changes in stable modules [s3-notifications] is disallowed.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

✅ A exemption request has been requested. Please wait for a maintainer's review.

The breaking changes should be permitted to address the issues with deleting the existing S3 event notifications and adding new event notifications on top of existing notifications

@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 Mar 1, 2024
@paulhcsun paulhcsun changed the title fix(s3-notifications): bug fix to address the issues deleting the existing S3 event notifications and adding new event notifications on top of existing notifications fix(s3-notifications): unable to delete the existing S3 event notifications Mar 1, 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.

Hi @sarangarav, we don't allow any breaking changes in stable modules, however, you can still add this fix behind a feature flag: https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#feature-flags.

I'm not sure exactly how it would work for changes to the index.py file but let me check with the team and get back to you. Also have you run the integ tests for s3-notifications? And if so could you also push the test snapshots if any were changed.

@@ -45,9 +50,9 @@ def with_id(n):
for t in CONFIGURATION_TYPES:
if request_type == 'Update':
ids = [with_id(n) for n in old.get(t, [])]
Copy link
Contributor

Choose a reason for hiding this comment

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

this line can be removed

@paulhcsun paulhcsun added pr-linter/exempt-test The PR linter will not require test changes and removed pr/reviewer-clarification-requested The contributor has requested clarification on feedback, a failing build, or a failing PR Linter run labels Mar 1, 2024
@paulhcsun
Copy link
Contributor

paulhcsun commented Mar 1, 2024

Hey @sarangarav,

So the index.py file won't have any knowledge on whether or not a feature flag is enabled so what you can do is add a new property here, something like:

this.resource = new cdk.CfnResource(this, 'Resource', {
        type: 'Custom::S3BucketNotifications',
        properties: {
          ServiceToken: handler.functionArn,
          BucketName: this.bucket.bucketName,
          NotificationConfiguration: cdk.Lazy.any({ produce: () => this.renderNotificationConfiguration() }),
          Managed: managed,
		  IsFeatureFlagYouCreatedEnabled: true,
        },
      });

and then access that within the handlers() method in index.py through the props = event["ResourceProperties"] variable which will allow you to use the new logic if that property is set to true.

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the BUILD FAILING 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.

@PhilippPHoffmann
Copy link

We're experiencing this exact issue and would appreciate a fix. Please don't abandon this PR.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Mar 30, 2024
@paulhcsun paulhcsun reopened this Apr 4, 2024
@paulhcsun paulhcsun added pr-linter/do-not-close The PR linter will not close this PR while this label is present pr-linter/exempt-integ-test The PR linter will not require integ test changes and removed closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. labels Apr 4, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 43e6543
  • Result: FAILED
  • Build Logs (available for 30 days)

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

@paulhcsun
Copy link
Contributor

hey @sarangarav, are you still planning to work on this?

@paulhcsun paulhcsun removed the pr-linter/do-not-close The PR linter will not close this PR while this label is present label Apr 11, 2024
@paulhcsun
Copy link
Contributor

Going to close this for now. Feel free to open a new PR if you would like to continue to work on this fix with the suggested changes.

@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Breaking changes in stable modules [s3-notifications] is disallowed.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@paulhcsun paulhcsun closed this Apr 11, 2024
@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ Breaking changes in stable modules [s3-notifications] is disallowed.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

✅ A exemption request has been requested. Please wait for a maintainer's review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants