Skip to content

Commit 9fe0ff0

Browse files
committed
feat: rename 'pact_publication' trigger type to 'publication'
1 parent 84e3eb9 commit 9fe0ff0

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Sequel.migration do
2+
up do
3+
from(:triggered_webhooks).where(trigger_type: 'pact_publication').update(trigger_type: 'publication')
4+
end
5+
6+
down do
7+
from(:triggered_webhooks).where(trigger_type: 'publication').update(trigger_type: 'pact_publication')
8+
end
9+
end

lib/pact_broker/webhooks/triggered_webhook.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module PactBroker
66
module Webhooks
77
class TriggeredWebhook < Sequel::Model(:triggered_webhooks)
88

9-
TRIGGER_TYPE_PUBLICATION = 'pact_publication'
9+
TRIGGER_TYPE_PUBLICATION = 'publication'
1010
TRIGGER_TYPE_USER = 'user'
1111

1212
STATUS_NOT_RUN = 'not_run'.freeze

spec/lib/pact_broker/api/decorators/pact_webhooks_status_decorator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module Decorators
6161
it "includes the triggered webhooks properties" do
6262
expect(subject[:_embedded][:triggeredWebhooks].first).to include(
6363
status: 'success',
64-
triggerType: 'pact_publication',
64+
triggerType: 'publication',
6565
attemptsMade: 1,
6666
attemptsRemaining: 2
6767
)

spec/lib/pact_broker/webhooks/repository_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ module Webhooks
335335
.create_pact
336336
end
337337

338-
subject { Repository.new.create_triggered_webhook '1234', td.webhook, td.pact, 'pact_publication' }
338+
subject { Repository.new.create_triggered_webhook '1234', td.webhook, td.pact, 'publication' }
339339

340340
it "creates a TriggeredWebhook" do
341341
expect(subject.webhook_uuid ).to eq td.webhook.uuid
342342
expect(subject.consumer).to eq td.consumer
343343
expect(subject.provider).to eq td.provider
344344
expect(subject.trigger_uuid).to eq '1234'
345-
expect(subject.trigger_type).to eq 'pact_publication'
345+
expect(subject.trigger_type).to eq 'publication'
346346
end
347347

348348
it "sets the webhook" do

0 commit comments

Comments
 (0)