-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
✨ webhook notifications #296
Conversation
camply/notifications/webhook.py
Outdated
---------- | ||
campsites: List[AvailableCampsite] | ||
""" | ||
self.send_message(message=campsites) |
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.
I recommend adding an envelope around campsites
, which allows for sibling data to be added in the future without making a backward incompatible change to the model.
So this:
self.send_message(message=campsites)
could be
self.send_message(message={"campsites": campsites})
which lets you hang non-campsite metadata or others if needed
self.send_message(message={"campsites": campsites, "notification_id": "blah"})
.. and the client need not change anything.
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.
Yeah, that's a good idea. I addressed this and added a timestamp
field as well.
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.
Very nice, you work quickly! I made one suggestion to avoid backward incompatible model changes in the future.
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.
LGTM!
# [v0.30.0](v0.29.0...v0.30.0) (2023-09-13) ## ✨ New Features - [`3ab5333`](3ab5333) webhook notifications (#296) (Issues: [`#296`](#296)) [skip ci]
🎉 This PR is included in version 0.30.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Send notifications to a webhook endpoint
Resolves #295