From 89271f1ea61ff741bd42157730a553f035b07206 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 8 Dec 2023 10:44:00 +1100 Subject: [PATCH] chore: copy back changes from pactflow --- lib/pact_broker/api/decorators/extended_pact_decorator.rb | 7 ++++++- lib/pact_broker/api/pact_broker_urls.rb | 2 +- lib/pact_broker/api/resources/base_resource.rb | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/pact_broker/api/decorators/extended_pact_decorator.rb b/lib/pact_broker/api/decorators/extended_pact_decorator.rb index aa5568c7b..23daac697 100644 --- a/lib/pact_broker/api/decorators/extended_pact_decorator.rb +++ b/lib/pact_broker/api/decorators/extended_pact_decorator.rb @@ -1,5 +1,10 @@ require "pact_broker/api/decorators/pact_decorator" +# Pactflow notes: +# This decorator was added for Pactflow, but we needed to change it so much that there +# is a separate class in pact_broker_fork/lib/pactflow/api/decorators/extended_pact_decorator.rb now +# and this one isn't used. + module PactBroker module Api module Decorators @@ -47,4 +52,4 @@ def head_tags end end end -end \ No newline at end of file +end diff --git a/lib/pact_broker/api/pact_broker_urls.rb b/lib/pact_broker/api/pact_broker_urls.rb index 81aa06755..c6bd1d72b 100644 --- a/lib/pact_broker/api/pact_broker_urls.rb +++ b/lib/pact_broker/api/pact_broker_urls.rb @@ -287,7 +287,7 @@ def webhooks_url base_url "#{base_url}/webhooks" end - def webhook_url uuid, base_url + def webhook_url uuid, base_url = "" "#{base_url}/webhooks/#{uuid}" end diff --git a/lib/pact_broker/api/resources/base_resource.rb b/lib/pact_broker/api/resources/base_resource.rb index 1b4f5da4c..c91468496 100644 --- a/lib/pact_broker/api/resources/base_resource.rb +++ b/lib/pact_broker/api/resources/base_resource.rb @@ -207,7 +207,7 @@ def invalid_json? def find_pacticipant name, role pacticipant_service.find_pacticipant_by_name(name).tap do | pacticipant | if pacticipant.nil? - set_json_error_message("No #{role} with name '#{name}' found", title: "Not found", type: "not_found", status: 404) + set_json_error_message("No #{role} with name '#{name}' found", title: "Not found", type: "not-found", status: 404) end end end