-
Notifications
You must be signed in to change notification settings - Fork 429
feat(parser): support for S3 Event Notifications via EventBridge #1982
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
feat(parser): support for S3 Event Notifications via EventBridge #1982
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
hey @ivica-k - THANK YOU, excited to review your first PR shortly. I've just added |
2b9a3a3
to
8461f50
Compare
hey @ivica-k - reviewing it now... let's break this into two PRs: one for Parser and one for Event Source Data Classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! The only changes we'll need to ensure this works as expected are:
- A real event generated under
tests/events
(replace accountID/resource name with dummy ones) - S3 Object Notification Example - Test for Parser to guarantee mandatory vs optional field work as expected and don't fail at runtime with validation error: S3 Model test example
Lemme know if you need any help with it!
8461f50
to
280a90e
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #1982 +/- ##
========================================
Coverage 97.44% 97.45%
========================================
Files 146 146
Lines 6660 6685 +25
Branches 478 478
========================================
+ Hits 6490 6515 +25
Misses 134 134
Partials 36 36
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
There's only one medium change to make and I'm doing that now to speed up the merge -
With that in mind (if it's any clearer), we first test the parent model I've changed the exports and the docs, I'll work on the tests. PS: Parser testing suite is something I'd love to redo entirely |
What I've changed
Last items to review on Monday
If we don't speak again, have a fantastic weekend @ivica-k !! |
Damn, it would have been easier for you to make the whole PR from scratch than to fix my things... Thank you for the great explanation of changes and have a great weekend :) If it makes any difference, I agree with your point about testing the envelope; as you said, |
Not at all @ivica-k - getting the events, the structure, and kick starting everything is paramount... we can't thank you enough ;-) We'll finish on Monday and move to the data classes to see if we can fix that super odd GH Actions checkout issue. 🙏 |
Hey @heitorlessa I feel bad that you're doing all of these commits; is there a chance I could participate at this point? |
Let me ping you on Discord and we can do it together - I didn't really need do this a50116c, but I figured this is the best opportunity to start paying some tech debt I always wanted to (I don't like the way tests are done in Parser). There's one last thing I'm doing now which is making sure Mypy works. |
Okay finished, mind having a review to see if I missed anything? What have I done?
Special note. Never feel bad about this. We wouldn't be this far without your help. There's also so many competing priorities that if you hadn't started this PR we wouldn't even touch this feature until later in the year, even more so that I'm so happy we paid two tech debts that will pave the road for a better code base. Typically, if there's an issue related I'd ask any contributor to kindly factor these in, but we haven't created an issue to cover these tech debts hence why I did it. |
Explanation on the typing (in case you aren't familiar with mypy) AnyInheritedModel = Union[Type[BaseModel], BaseModel]
RawDictOrModel = Union[Dict[str, Any], AnyInheritedModel]
class EventBridgeModel(BaseModel):
...
detail: RawDictOrModel If a customer now wants to bring their own model, this won't trigger a Mypy issue anymore: class Order(BaseModel):
payment_id: str
class OrderEventBridge(EventBridgeModel):
detail: Order What's even better... a customer can even use the superset class Order(BaseModel):
payment_id: str
class OrderEventBridge(EventBridgeModel):
detail: Json[Order] |
@ivica-k thanks for jumping on a call with me - as we've just agreed, I'll merge this now as soon as CI checks pass, and we can move on to the data class PR one. |
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Issue number: #1656
Summary
Changes
adds support for S3 event notifications through EventBridge
User experience
Prints:
Notes
I made this PR while code changes are half done to make the discussion about further changes easier. Tests and documentation will be added later, once these functional changes are deemed good.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgement
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.