Skip to content

Make webhook Response Body detailed when webhook is inactive #26814

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

Closed
wants to merge 1 commit into from
Closed

Make webhook Response Body detailed when webhook is inactive #26814

wants to merge 1 commit into from

Conversation

Young-Lord
Copy link

@Young-Lord Young-Lord commented Aug 30, 2023

Currently, when user click Test Delivery for an inactivate webhook, Gitea will refuse to send the webhook. However, the Response or anywhere else (except log on server) doesn't describe the reason, and may make user think that the webhook server is crashed.
This PR writes error message Hook delivery skipped as webhook is inactive. to Response Body, so that user can know the status clearly.

Comparison

Current behavior

Current page when webhook is inactivate, showing empty Response Headers and Response Body

Expected behavior

Page displayed after this PR, Response Body is set as above

Closes #26824

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 30, 2023
@puni9869
Copy link
Member

Thanks for your contribution, could you create an ISSUE for this pr, for a discussion to take this PR forward

@techknowlogick
Copy link
Member

Thanks for this PR. Instead of adding content to the webhook response body, could you instead:

  1. Disable the "Test Delivery" button
  2. Add an on-hover tooltip to let users know that test deliveries are disabled
  3. same for the "retry" webhook button
  4. display an "error flash" if someone bypasses the disabled button and does an HTTP POST of the form

If you need any help, or pointers on where to start please comment here and we can help out :)

@Young-Lord
Copy link
Author

Sorry, currently I have no time to finish a pr of such scale. The only thing I can do is to post some relative links so that others may implement all these features.
Also, I'm not clear about how should I show the error flash for a POST request.

$('#test-delivery').on('click', function () {

<button class="ui teal tiny button" id="test-delivery" data-tooltip-content="{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</button>

@Young-Lord
Copy link
Author

One more thing: Can we allow Test delivery even when Webhook is inactive? When debugging, this might be useful.

@yardenshoham
Copy link
Member

Replaced by #27211

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test Delivery for inactive webhook behaves confusing
5 participants