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

Return HTTP status code 500 if the build fails #166

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

Baldinof
Copy link
Contributor

@Baldinof Baldinof commented Dec 6, 2021

Hi!

Currently if during the webhook call something bad happens, the HTTP status code will be 200, and the body will contains the command exit code.

This makes hard for the webhook consumers to know if it failed.

With this PR, if the webhhok URL contains a query parameter fail_on_error, it will return a 500 response.

@ramunasd
Copy link
Collaborator

ramunasd commented Dec 6, 2021

I would suggest to return error status code instead adding params to query.

@Baldinof
Copy link
Contributor Author

Baldinof commented Dec 6, 2021

I am not sure I understand you, what do you mean by return error status code? The process exit status is already in the response body.

We could always return 500 in case of an exit status code !== 0, but it could break existing integrations.

@ramunasd
Copy link
Collaborator

ramunasd commented Dec 6, 2021

So let's return 500 in case of error.

@Baldinof Baldinof force-pushed the webhook_500_on_error branch from 70aa459 to 1aeadf7 Compare December 6, 2021 20:04
@ramunasd ramunasd changed the title Add a query param on webhooks to return 500 if the build fails Return HTTP status code 500 if the build fails Dec 7, 2021
@ramunasd ramunasd added this to the 3.5 milestone Dec 7, 2021
@ramunasd ramunasd merged commit 939e83f into project-satisfy:master Dec 7, 2021
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.

2 participants