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

✨ webhook notifications #296

Merged
merged 2 commits into from
Sep 13, 2023
Merged

✨ webhook notifications #296

merged 2 commits into from
Sep 13, 2023

Conversation

juftin
Copy link
Owner

@juftin juftin commented Sep 12, 2023

Description

Send notifications to a webhook endpoint

Resolves #295

----------
campsites: List[AvailableCampsite]
"""
self.send_message(message=campsites)
Copy link

@zdwolfe zdwolfe Sep 12, 2023

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.

Copy link
Owner Author

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.

Copy link

@zdwolfe zdwolfe left a 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.

Copy link

@zdwolfe zdwolfe left a comment

Choose a reason for hiding this comment

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

LGTM!

@juftin juftin merged commit 3ab5333 into main Sep 13, 2023
8 checks passed
@juftin juftin deleted the feat/webhook_notifications branch September 13, 2023 02:17
github-actions bot added a commit that referenced this pull request Sep 13, 2023
# [v0.30.0](v0.29.0...v0.30.0) (2023-09-13)

## ✨ New Features
- [`3ab5333`](3ab5333)  webhook notifications (#296) (Issues: [`#296`](#296))

[skip ci]
@juftin
Copy link
Owner Author

juftin commented Sep 13, 2023

🎉 This PR is included in version 0.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic webhook notification
2 participants