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

Add granular webhooks #152

Merged
merged 6 commits into from
Jun 20, 2024
Merged

Conversation

Thinkscape
Copy link
Contributor

Why

The original implementation would call the webhooks for both success and failure. Without checking the contents of the JSON body a health check service would be unable to distinguish between those two.

Typical healthcheck provider would expect different endpoints for success, start, progress and failure (if the latter is are supported at all).

Here's one example: https://healthchecks.io/docs/signaling_failures/

What

This extends the webhook support to be friendlier with dead-man-switch health check services.

It adds 3 more optional env vars and will call the specified endpoints as needed.

env var description
WEBHOOK_ERROR_URL URL to be called in case backup fails. Default disabled.
WEBHOOK_PRE_BACKUP_URL URL to be called when backup starts. Default disabled.
WEBHOOK_POST_BACKUP_URL URL to be called when backup completes successfully. Default disabled.

Backwards compatibility

The original WEBHOOK_URL and its behaviour is untouched, so this change is 100% backwards compatible.

@prodrigestivill
Copy link
Owner

Awesome, thank you for your work.

I just simplified both cases as a single one, just as style change.
In any case, great work.

@prodrigestivill prodrigestivill merged commit 9f88e3b into prodrigestivill:main Jun 20, 2024
2 of 3 checks passed
@Thinkscape Thinkscape deleted the patch-1 branch July 1, 2024 04:01
@Thinkscape
Copy link
Contributor Author

Legend. Thanks!

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.

None yet

2 participants