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

Feature: s3 sns notification #6838

Merged
merged 4 commits into from Sep 22, 2023

Conversation

maederm
Copy link
Contributor

@maederm maederm commented Sep 20, 2023

Implement missing s3 sns notifications.

  • Feature is added
  • The linter is happy
  • Tests are added
  • All tests pass, existing and new

I created a new test file because I couldn't find any tests that test the notifications themselves (the ones in test_s3.py test the configuration options, but not the implementation of send_event).
I'm not sure if need to update the function docs from models.py and the s3.rst, just edited both to be sure.

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #6838 (38438d1) into master (179a228) will increase coverage by 0.00%.
Report is 2 commits behind head on master.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #6838   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files         816      816           
  Lines       80076    80094   +18     
=======================================
+ Hits        77037    77056   +19     
+ Misses       3039     3038    -1     
Flag Coverage Δ
servertests 37.05% <66.66%> (+0.04%) ⬆️
unittests 96.15% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
moto/s3/models.py 97.01% <ø> (ø)
moto/s3/notifications.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@maederm
Copy link
Contributor Author

maederm commented Sep 21, 2023

I'm not sure what my changes have to do with terraform failing.

=== CONT  TestAccAPIGatewayV2Authorizer_HTTPAPILambdaRequestAuthorizer_initialMissingCacheTTL
=== NAME  TestAccAPIGatewayV2Authorizer_HTTPAPILambdaRequestAuthorizer_initialZeroCacheTTL
    testing_new.go:88: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: waiting for EC2 VPC (vpc-7ffe1a55) delete: operation error EC2: DescribeVpcs, https response error StatusCode: 400, RequestID: , decomposing response: read tcp [::1]:50438->[::1]:4566: use of closed network connection

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

Hi @maederm, thanks for the PR! The logic looks good to me.

Can you move the test case into test_s3/test_s3_lambda_integration? The name is a misnomer, but that file contains all other bucket notification tests

@bblommers
Copy link
Collaborator

I'm not sure what my changes have to do with terraform failing.

Probably a intermittent failure - don't worry about that.

Other notifications are tested there as well
Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

LGTM - thank you @maederm!

@bblommers bblommers added this to the 4.2.3 milestone Sep 22, 2023
@bblommers bblommers merged commit f878aaf into getmoto:master Sep 22, 2023
82 checks passed
@moto-payments-app
Copy link

Hi @maederm,

Thank you for contributing to Moto!

To show our thanks, we'd like to share some of the donations that we've received with you. PR's like this are the big reason that Moto is as successful as it is - so it's only fair that you, as a contributor, gets to share the spoils.

We've created a companion website with more information:
https://payments.getmoto.org/

Feel free to open a bug or discussion if you run into any problems:
https://github.com/getmoto/payments

@bblommers bblommers modified the milestones: 4.2.3, 4.2.4 Sep 22, 2023
@github-actions
Copy link
Contributor

This is now part of moto >= 4.2.4.dev18

@maederm maederm deleted the feature/s3-sns-notification branch September 26, 2023 15:54
toshyak pushed a commit to toshyak/moto that referenced this pull request Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants