Skip to content

Commit d90c455

Browse files
committed
feat(webhooks): return a 200 status for webhook test execution response even when execution has failed
1 parent 9ab66df commit d90c455

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/pact_broker/api/resources/webhook_execution.rb

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ def process_post
1616
webhook_execution_result = webhook_service.test_execution(webhook, webhook_options)
1717
response.headers['Content-Type'] = 'application/hal+json;charset=utf-8'
1818
response.body = post_response_body webhook_execution_result
19-
if webhook_execution_result.success?
20-
true
21-
else
22-
response.headers[PactBroker::DO_NOT_ROLLBACK] = 'true'
23-
500
24-
end
19+
true
2520
end
2621

2722
def resource_exists?

spec/lib/pact_broker/api/resources/webhook_execution_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ module Resources
7575
context "when execution is not successful" do
7676
let(:success) { false }
7777

78-
it "returns a 500 JSON response" do
78+
it "returns a 200 JSON response" do
7979
subject
80-
expect(last_response.status).to eq 500
80+
expect(last_response.status).to eq 200
8181
end
8282

8383
it "includes the execution result JSON in the body" do

0 commit comments

Comments
 (0)