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(sns): race condition exists between sqs queue policy and sns subscription #21797

Merged
merged 12 commits into from
Oct 2, 2022

Conversation

jonnekaunisto
Copy link
Contributor

@jonnekaunisto jonnekaunisto commented Aug 29, 2022


Fixes #20665 by adding a dependency to sqs policy for sns subscriptions.

All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

This is a follow up to #21259, which got closed for failing for too long

@gitpod-io
Copy link

gitpod-io bot commented Aug 29, 2022

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 labels Aug 29, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team August 29, 2022 03:35
@TheRealAmazonKendra TheRealAmazonKendra changed the title fix(sns): race condition exists between sqs queue policy and sns subscription #21259 fix(sns): race condition exists between sqs queue policy and sns subscription Aug 30, 2022
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.

This cannot get merged because we can't edit the branch. I am also unable to verify that the tests run locally since I can't download the PR.

Additionally, the follow items weren't confirmed in the PR body:

Have you added the new feature to an integration test?

Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

@jonnekaunisto
Copy link
Contributor Author

@TheRealAmazonKendra

This cannot get merged because we can't edit the branch. I am also unable to verify that the tests run locally since I can't download the PR.

I'm not sure I understand the problem, how do I fix this?

Have you added the new feature to an integration test?

I marked it as completed now, I think the existing integ tests should cover it(Ex. packages/@aws-cdk/aws-stepfunctions-tasks/test/sns/publish.integ.snapshot/aws-stepfunctions-tasks-sns-publish-integ.template.json)

Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

I will work on doing that.

@TheRealAmazonKendra
Copy link
Contributor

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork

Looks like you either got this fixed or GitHub was having a hiccup of some sort when I was trying to pull this earlier.

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review September 7, 2022 20:37

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.

Looks like the merge didn't go quite right.

@jonnekaunisto
Copy link
Contributor Author

Yeah after merging it doesn't let me build anything, because I get errors like this:

/workspace/aws-cdk/packages/aws-cdk: yarn build  (25 remaining)
yarn run v1.22.19
$ cdk-build
test/diff.test.ts(265,30): error TS2749: 'StringDecoder' refers to a value, but is being used as a type here. Did you mean 'typeof StringDecoder'?
Error: /workspace/aws-cdk/node_modules/typescript/bin/tsc --build exited with error code 1

Any clue how to fix that?

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review September 9, 2022 21:26

Pull request has been modified.

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Sep 20, 2022

update

✅ Branch has been successfully updated

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.

Looks like a test is improperly formatted per

@aws-cdk/aws-sns-subscriptions:   ERROR      integ.sns-sqs.lit 1.49s
@aws-cdk/aws-sns-subscriptions:       /codebuild/output/src410239659/src/github.com/aws/aws-cdk/packages/@aws-cdk/aws-sns-subscriptions/test/sns-sqs.lit.integ.snapshot/aws-cdk-sns-sqs.template.json: Unexpected token } in JSON at position 965

This suggests that they're been manually edited, which we should not be doing here. Please run the tests with --update-on-failed and ensure that the deployment succeeds before committing the resulting change.

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 fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

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

@mergify mergify bot dismissed stale reviews from TheRealAmazonKendra and aws-cdk-automation September 27, 2022 23:37

Pull request has been modified.

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 fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

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

@jonnekaunisto
Copy link
Contributor Author

jonnekaunisto commented Sep 27, 2022

What do I need to do to fix this: Fixes must contain a change to an integration test file and the resulting snapshot.

I did update the integration test files @TheRealAmazonKendra

@TheRealAmazonKendra TheRealAmazonKendra added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Oct 2, 2022
@aws-cdk-automation aws-cdk-automation dismissed their stale review October 2, 2022 17:31

Pull Request updated. Dissmissing previous PRLinter Review.

@mergify
Copy link
Contributor

mergify bot commented Oct 2, 2022

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: a51f66a
  • 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 cf43b03 into aws:main Oct 2, 2022
@mergify
Copy link
Contributor

mergify bot commented Oct 2, 2022

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

@jonnekaunisto jonnekaunisto deleted the sns-topic-fix branch October 3, 2022 16:57
arewa pushed a commit to arewa/aws-cdk that referenced this pull request Oct 8, 2022
…cription (aws#21797)

----

Fixes aws#20665 by adding a dependency to sqs policy for sns subscriptions.
### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

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


This is a follow up to aws#21259, which got closed for failing for too long
@@ -80,8 +80,8 @@ export abstract class TopicBase extends Resource implements ITopic {
/**
* Subscribe some endpoint to this topic
*/
public addSubscription(subscription: ITopicSubscription): Subscription {
Copy link
Contributor

Choose a reason for hiding this comment

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

making a change from subscription to topicSubscription actually can cause impact this actually breaks in python if you are using named arguments because this changes the argument from subscription to topic_subscription

homakk pushed a commit to homakk/aws-cdk that referenced this pull request Dec 1, 2022
…cription (aws#21797)

----

Fixes aws#20665 by adding a dependency to sqs policy for sns subscriptions.
### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

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


This is a follow up to aws#21259, which got closed for failing for too long
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. effort/small Small work item – less than a day of effort p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition between SQS QueuePolicy and SNS Subscription
4 participants