pact_broker 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/db/migrations/39_add_triggered_webhooks_fk_to_execution.rb +1 -1
- data/db/migrations/42_delete_orphan_webhook_data.rb +20 -0
- data/lib/db.rb +1 -0
- data/lib/pact_broker/api/resources/pacticipant_resource_methods.rb +10 -7
- data/lib/pact_broker/api/resources/webhook.rb +1 -0
- data/lib/pact_broker/app.rb +1 -0
- data/lib/pact_broker/configuration.rb +12 -2
- data/lib/pact_broker/db.rb +8 -0
- data/lib/pact_broker/locale/en.yml +2 -2
- data/lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names.rb +0 -2
- data/lib/pact_broker/pacts/merger.rb +3 -0
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/execution.rb +2 -0
- data/lib/pact_broker/webhooks/repository.rb +5 -3
- data/lib/pact_broker/webhooks/service.rb +1 -1
- data/lib/pact_broker/webhooks/webhook.rb +4 -0
- data/spec/features/create_pacticipant_spec.rb +30 -0
- data/spec/features/publish_pact_spec.rb +26 -0
- data/spec/lib/pact_broker/messages_spec.rb +1 -5
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +26 -10
- data/spec/migrations/42_delete_ophan_webhook_data_spec.rb +98 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9029e88952b1175c690a65568eb507d2acf08c81
|
4
|
+
data.tar.gz: adf028a7f196fb7e78ae80cec9733fa8eecfc3fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9454daa54e8d1abe94458d753376f76a3381d7d02041671649426dcd2de243a0f0e6557d18ebec40b4db803b23ae0b70811f9fb19aea1bec7799f30e025f1b2
|
7
|
+
data.tar.gz: 0efc0461b3d6a84ea6a78ead513ad850427acb31a8c21c6a3f18ac3c741119554037b041f2d9751fec51e88118c137db7f1cff4e6347da5bf769d6437d3cd1e4
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
<a name="v2.6.0"></a>
|
2
|
+
### v2.6.0 (2017-10-06)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* add configuration option for check_for_potential_duplicate_pacticipant_names ([6ab3fda](/../../commit/6ab3fda))
|
7
|
+
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* add webhook_retry_schedule and semver_formats to list of configuration options that can be saved to the database ([5bab062](/../../commit/5bab062))
|
11
|
+
* delete related triggered webhooks when webhook is deleted ([48f9853](/../../commit/48f9853))
|
12
|
+
* use strict mode when using mysql ([f991e15](/../../commit/f991e15))
|
13
|
+
|
1
14
|
<a name="v2.5.1"></a>
|
2
15
|
### v2.5.1 (2017-09-26)
|
3
16
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
|
3
|
+
Sequel.migration do
|
4
|
+
up do
|
5
|
+
from(:triggered_webhooks).where(webhook_id: nil).each do | triggered_webhook |
|
6
|
+
from(:webhook_executions).where(triggered_webhook_id: triggered_webhook[:id]).delete
|
7
|
+
from(:triggered_webhooks).where(id: triggered_webhook[:id]).delete
|
8
|
+
end
|
9
|
+
|
10
|
+
from(:webhook_executions).where(webhook_id: nil, triggered_webhook_id: nil).delete
|
11
|
+
end
|
12
|
+
|
13
|
+
# TODO
|
14
|
+
# alter_table(:triggered_webhooks) do
|
15
|
+
# set_column_not_null(:webhook_id)
|
16
|
+
# end
|
17
|
+
|
18
|
+
down do
|
19
|
+
end
|
20
|
+
end
|
data/lib/db.rb
CHANGED
@@ -30,6 +30,7 @@ module DB
|
|
30
30
|
con.extension(:connection_validator)
|
31
31
|
con.pool.connection_validation_timeout = -1 #Check the connection on every request
|
32
32
|
con.timezone = :utc
|
33
|
+
con.run("SET sql_mode='STRICT_TRANS_TABLES';") if db_credentials[:adapter].to_s =~ /mysql/
|
33
34
|
con
|
34
35
|
end
|
35
36
|
|
@@ -5,15 +5,18 @@ module PactBroker
|
|
5
5
|
module PacticipantResourceMethods
|
6
6
|
|
7
7
|
def potential_duplicate_pacticipants? pacticipant_names
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
if PactBroker.configuration.check_for_potential_duplicate_pacticipant_names
|
9
|
+
messages = pacticipant_service.messages_for_potential_duplicate_pacticipants pacticipant_names, base_url
|
10
|
+
if messages.any?
|
11
|
+
response.body = messages.join("\n")
|
12
|
+
response.headers['Content-Type'] = 'text/plain'
|
13
|
+
end
|
14
|
+
messages.any?
|
15
|
+
else
|
16
|
+
false
|
12
17
|
end
|
13
|
-
messages.any?
|
14
18
|
end
|
15
|
-
|
16
19
|
end
|
17
20
|
end
|
18
21
|
end
|
19
|
-
end
|
22
|
+
end
|
data/lib/pact_broker/app.rb
CHANGED
@@ -63,6 +63,7 @@ module PactBroker
|
|
63
63
|
PactBroker::DB.connection = configuration.database_connection
|
64
64
|
PactBroker::DB.connection.timezone = :utc
|
65
65
|
PactBroker::DB.validate_connection_config if configuration.validate_database_connection_config
|
66
|
+
PactBroker::DB.set_mysql_strict_mode_if_mysql
|
66
67
|
Sequel.datetime_class = DateTime
|
67
68
|
Sequel.database_timezone = :utc # Store all dates in UTC, assume any date without a TZ is UTC
|
68
69
|
Sequel.application_timezone = :local # Convert dates to localtime when retrieving from database
|
@@ -11,11 +11,20 @@ module PactBroker
|
|
11
11
|
|
12
12
|
class Configuration
|
13
13
|
|
14
|
-
SAVABLE_SETTING_NAMES = [
|
14
|
+
SAVABLE_SETTING_NAMES = [
|
15
|
+
:order_versions_by_date,
|
16
|
+
:use_case_sensitive_resource_names,
|
17
|
+
:enable_public_badge_access,
|
18
|
+
:shields_io_base_url,
|
19
|
+
:check_for_potential_duplicate_pacticipant_names,
|
20
|
+
:webhook_retry_schedule,
|
21
|
+
:semver_formats
|
22
|
+
]
|
15
23
|
|
16
24
|
attr_accessor :log_dir, :database_connection, :auto_migrate_db, :use_hal_browser, :html_pact_renderer
|
17
25
|
attr_accessor :validate_database_connection_config, :enable_diagnostic_endpoints, :version_parser
|
18
26
|
attr_accessor :use_case_sensitive_resource_names, :order_versions_by_date
|
27
|
+
attr_accessor :check_for_potential_duplicate_pacticipant_names
|
19
28
|
attr_accessor :semver_formats
|
20
29
|
attr_accessor :enable_public_badge_access, :shields_io_base_url
|
21
30
|
attr_accessor :webhook_retry_schedule
|
@@ -48,8 +57,9 @@ module PactBroker
|
|
48
57
|
# Not recommended to set this to true unless there is no way to
|
49
58
|
# consistently extract an orderable object from the consumer application version number.
|
50
59
|
config.order_versions_by_date = false
|
51
|
-
config.semver_formats = ["%M.%m.%p%s%d","%M.%m", "%M"]
|
60
|
+
config.semver_formats = ["%M.%m.%p%s%d", "%M.%m", "%M"]
|
52
61
|
config.webhook_retry_schedule = [10, 60, 120, 300, 600, 1200] #10 sec, 1 min, 2 min, 5 min, 10 min, 20 min => 38 minutes
|
62
|
+
config.check_for_potential_duplicate_pacticipant_names = true
|
53
63
|
config
|
54
64
|
end
|
55
65
|
|
data/lib/pact_broker/db.rb
CHANGED
@@ -24,5 +24,13 @@ module PactBroker
|
|
24
24
|
def self.validate_connection_config
|
25
25
|
PactBroker::DB::ValidateEncoding.(connection)
|
26
26
|
end
|
27
|
+
|
28
|
+
def self.set_mysql_strict_mode_if_mysql
|
29
|
+
connection.run("SET sql_mode='STRICT_TRANS_TABLES';") if mysql?
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.mysql?
|
33
|
+
connection.adapter_scheme =~ /mysql/
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
@@ -28,8 +28,8 @@ en:
|
|
28
28
|
If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.
|
29
29
|
If the pact is intended to be for a new consumer or provider, please manually create "%{new_name}" using the following command, and then re-publish the pact:
|
30
30
|
$ curl -v -XPOST -H "Content-Type: application/json" -d "{\"name\": \"%{new_name}\"}" %{create_pacticipant_url}
|
31
|
-
If the pact broker requires authentication,
|
32
|
-
|
31
|
+
If the pact broker requires basic authentication, add '-u <username:password>' to the command.
|
32
|
+
To disable this check, set `check_for_potential_duplicate_pacticipant_names` to false in the configuration.
|
33
33
|
"400":
|
34
34
|
title: 400 Malformed Request
|
35
35
|
message: The request was malformed and could not be processed.
|
@@ -19,6 +19,9 @@ module PactBroker
|
|
19
19
|
|
20
20
|
# Accepts two hashes representing pacts, outputs a merged hash
|
21
21
|
# Does not make any guarantees about order of interactions
|
22
|
+
# TODO: should not modify original!
|
23
|
+
# TODO: is not checking response for equality!
|
24
|
+
# TODO: should have separate tests!
|
22
25
|
def merge_pacts original_json, additional_json
|
23
26
|
original, additional = [original_json, additional_json].map{|str| JSON.parse(str, PACT_PARSING_OPTIONS) }
|
24
27
|
|
data/lib/pact_broker/version.rb
CHANGED
@@ -27,6 +27,8 @@ module PactBroker
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
# For a brief time, the code was released with a direct relationship between
|
31
|
+
# webhook and execution. Need to make sure any existing data is handled properly.
|
30
32
|
class DeprecatedExecution < Sequel::Model(:webhook_executions)
|
31
33
|
associate(:many_to_one, :provider, :class => "PactBroker::Domain::Pacticipant", :key => :provider_id, :primary_key => :id)
|
32
34
|
associate(:many_to_one, :consumer, :class => "PactBroker::Domain::Pacticipant", :key => :consumer_id, :primary_key => :id)
|
@@ -104,9 +104,11 @@ module PactBroker
|
|
104
104
|
Execution.where(id: execution_ids).delete
|
105
105
|
end
|
106
106
|
|
107
|
-
def
|
108
|
-
TriggeredWebhook.where(webhook: Webhook.where(uuid: uuid)).
|
109
|
-
|
107
|
+
def delete_triggered_webhooks_by_webhook_uuid uuid
|
108
|
+
triggered_webhook_ids = TriggeredWebhook.where(webhook: Webhook.where(uuid: uuid)).select_for_subquery(:id)
|
109
|
+
Execution.where(triggered_webhook_id: triggered_webhook_ids).delete
|
110
|
+
DeprecatedExecution.where(webhook_id: Webhook.where(uuid: uuid).select_for_subquery(:id)).delete
|
111
|
+
TriggeredWebhook.where(id: triggered_webhook_ids).delete
|
110
112
|
end
|
111
113
|
|
112
114
|
def delete_triggered_webhooks_by_pact_publication_ids pact_publication_ids
|
@@ -11,6 +11,10 @@ module PactBroker
|
|
11
11
|
associate(:many_to_one, :consumer, :class => "PactBroker::Domain::Pacticipant", :key => :consumer_id, :primary_key => :id)
|
12
12
|
one_to_many :headers, :class => "PactBroker::Webhooks::WebhookHeader", :reciprocal => :webhook
|
13
13
|
|
14
|
+
dataset_module do
|
15
|
+
include PactBroker::Repositories::Helpers
|
16
|
+
end
|
17
|
+
|
14
18
|
def before_destroy
|
15
19
|
WebhookHeader.where(webhook_id: id).destroy
|
16
20
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'support/test_data_builder'
|
2
|
+
|
3
|
+
describe "Creating a pacticipant" do
|
4
|
+
let(:path) { "/pacticipants" }
|
5
|
+
let(:headers) { {'CONTENT_TYPE' => 'application/json'} }
|
6
|
+
let(:response_body) { JSON.parse(last_response.body, symbolize_names: true)}
|
7
|
+
let(:pacticipant_hash) { {name: 'Foo Thing'}}
|
8
|
+
|
9
|
+
subject { post path, pacticipant_hash.to_json, headers; last_response }
|
10
|
+
|
11
|
+
it "returns a 201 response" do
|
12
|
+
subject
|
13
|
+
expect(last_response.status).to be 201
|
14
|
+
end
|
15
|
+
|
16
|
+
it "returns the Location header" do
|
17
|
+
subject
|
18
|
+
expect(last_response.headers['Location']).to eq 'http://example.org/pacticpants/Foo%20Thing'
|
19
|
+
end
|
20
|
+
|
21
|
+
it "returns a JSON Content Type" do
|
22
|
+
subject
|
23
|
+
expect(last_response.headers['Content-Type']).to eq 'application/hal+json;charset=utf-8'
|
24
|
+
end
|
25
|
+
|
26
|
+
it "returns the newly created webhook" do
|
27
|
+
subject
|
28
|
+
expect(response_body).to include pacticipant_hash
|
29
|
+
end
|
30
|
+
end
|
@@ -46,4 +46,30 @@ describe "Publishing a pact" do
|
|
46
46
|
expect(subject).to be_a_json_error_response "does not match"
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
context "when the pacticipant name is an almost duplicate of an existing pacticipant name" do
|
51
|
+
before do
|
52
|
+
TestDataBuilder.new.create_pacticipant("A Provider Service")
|
53
|
+
end
|
54
|
+
|
55
|
+
context "when duplicate checking is on" do
|
56
|
+
before do
|
57
|
+
PactBroker.configuration.check_for_potential_duplicate_pacticipant_names = true
|
58
|
+
end
|
59
|
+
|
60
|
+
it "returns a 409" do
|
61
|
+
expect(subject.status).to eq 409
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
context "when duplicate checking is off" do
|
66
|
+
before do
|
67
|
+
PactBroker.configuration.check_for_potential_duplicate_pacticipant_names = false
|
68
|
+
end
|
69
|
+
|
70
|
+
it "returns a 201" do
|
71
|
+
expect(subject.status).to eq 201
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
49
75
|
end
|
@@ -3,8 +3,6 @@ require 'pact_broker/messages'
|
|
3
3
|
|
4
4
|
module PactBroker
|
5
5
|
module Messages
|
6
|
-
|
7
|
-
|
8
6
|
describe "#potential_duplicate_pacticipant_message" do
|
9
7
|
let(:new_name) { 'Contracts' }
|
10
8
|
let(:fred) { double('Contracts Service', name: 'Contracts Service') }
|
@@ -19,14 +17,12 @@ The name "Contracts" is very similar to the following existing consumers/provide
|
|
19
17
|
If you meant to specify one of the above names, please correct the pact configuration, and re-publish the pact.
|
20
18
|
If the pact is intended to be for a new consumer or provider, please manually create "Contracts" using the following command, and then re-publish the pact:
|
21
19
|
$ curl -v -XPOST -H "Content-Type: application/json" -d "{\\\"name\\\": \\\"Contracts\\\"}" http://example.org/pacticipants
|
22
|
-
If the pact broker requires authentication, include the '-u' flag with the proper credentials:
|
23
|
-
$ curl -v -XPOST -u <username>:<password> -H "Content-Type: application/json" -d "{\\\"name\\\": \\\"Contracts\\\"}" http://example.org/pacticipants
|
24
20
|
EOS
|
25
21
|
}
|
26
22
|
subject { Messages.potential_duplicate_pacticipant_message new_name, potential_duplicate_pacticipants, 'http://example.org' }
|
27
23
|
|
28
24
|
it "returns a message" do
|
29
|
-
expect(subject).to
|
25
|
+
expect(subject).to start_with expected_message
|
30
26
|
end
|
31
27
|
end
|
32
28
|
end
|
@@ -354,7 +354,7 @@ module PactBroker
|
|
354
354
|
end
|
355
355
|
end
|
356
356
|
|
357
|
-
describe "
|
357
|
+
describe "delete_triggered_webhooks_by_webhook_uuid" do
|
358
358
|
let(:td) { TestDataBuilder.new }
|
359
359
|
|
360
360
|
before do
|
@@ -365,22 +365,38 @@ module PactBroker
|
|
365
365
|
.create_webhook
|
366
366
|
.create_triggered_webhook
|
367
367
|
.create_deprecated_webhook_execution
|
368
|
+
.create_webhook_execution
|
369
|
+
.create_webhook
|
370
|
+
.create_triggered_webhook
|
371
|
+
.create_deprecated_webhook_execution
|
372
|
+
.create_webhook_execution
|
373
|
+
end
|
374
|
+
|
375
|
+
let(:webhook_id) { Webhook.find(uuid: td.webhook.uuid).id }
|
376
|
+
subject { Repository.new.delete_triggered_webhooks_by_webhook_uuid td.webhook.uuid }
|
377
|
+
|
378
|
+
it "deletes the related triggered webhooks" do
|
379
|
+
expect { subject }.to change {
|
380
|
+
TriggeredWebhook.where(id: td.triggered_webhook.id).count
|
381
|
+
}.from(1).to(0)
|
368
382
|
end
|
369
383
|
|
370
|
-
|
384
|
+
it "does not delete the unrelated triggered webhooks" do
|
385
|
+
expect { subject }.to_not change {
|
386
|
+
TriggeredWebhook.exclude(id: td.triggered_webhook.id).count
|
387
|
+
}
|
388
|
+
end
|
371
389
|
|
372
|
-
it "
|
373
|
-
webhook_id = Webhook.find(uuid: td.webhook.uuid).id
|
390
|
+
it "deletes the related deprecated webhook executions" do
|
374
391
|
expect { subject }.to change {
|
375
|
-
|
376
|
-
}.
|
392
|
+
DeprecatedExecution.count
|
393
|
+
}.by(-2)
|
377
394
|
end
|
378
395
|
|
379
|
-
it "
|
380
|
-
webhook_id = Webhook.find(uuid: td.webhook.uuid).id
|
396
|
+
it "deletes the related webhook executions" do
|
381
397
|
expect { subject }.to change {
|
382
|
-
|
383
|
-
}.
|
398
|
+
Execution.count
|
399
|
+
}.by(-2)
|
384
400
|
end
|
385
401
|
end
|
386
402
|
|
@@ -0,0 +1,98 @@
|
|
1
|
+
describe 'creating triggered webhooks from webhook executions (migrate 36-41)', migration: true do
|
2
|
+
before do
|
3
|
+
PactBroker::Database.migrate(41)
|
4
|
+
end
|
5
|
+
|
6
|
+
let(:before_now) { DateTime.new(2016, 1, 1) }
|
7
|
+
let(:now) { DateTime.new(2018, 2, 2) }
|
8
|
+
let!(:consumer) { create(:pacticipants, {name: 'Consumer', created_at: now, updated_at: now}) }
|
9
|
+
let!(:provider) { create(:pacticipants, {name: 'Provider', created_at: now, updated_at: now}) }
|
10
|
+
let!(:consumer_version) { create(:versions, {number: '1.2.3', order: 1, pacticipant_id: consumer[:id], created_at: now, updated_at: now}) }
|
11
|
+
let!(:pact_version) { create(:pact_versions, {content: {some: 'json'}.to_json, sha: '1234', consumer_id: consumer[:id], provider_id: provider[:id], created_at: now}) }
|
12
|
+
let!(:pact_publication) do
|
13
|
+
create(:pact_publications, {
|
14
|
+
consumer_version_id: consumer_version[:id],
|
15
|
+
provider_id: provider[:id],
|
16
|
+
revision_number: 1,
|
17
|
+
pact_version_id: pact_version[:id],
|
18
|
+
created_at: (now - 1)
|
19
|
+
})
|
20
|
+
end
|
21
|
+
let!(:webhook) do
|
22
|
+
create(:webhooks, {
|
23
|
+
uuid: '1234',
|
24
|
+
method: 'GET',
|
25
|
+
url: 'http://www.example.org',
|
26
|
+
consumer_id: consumer[:id],
|
27
|
+
provider_id: provider[:id],
|
28
|
+
is_json_request_body: false,
|
29
|
+
created_at: now
|
30
|
+
})
|
31
|
+
end
|
32
|
+
let!(:triggered_webhook) do
|
33
|
+
create(:triggered_webhooks, {
|
34
|
+
trigger_uuid: '12345',
|
35
|
+
trigger_type: 'publication',
|
36
|
+
pact_publication_id: pact_publication[:id],
|
37
|
+
webhook_id: webhook[:id],
|
38
|
+
webhook_uuid: webhook[:uuid],
|
39
|
+
consumer_id: consumer[:id],
|
40
|
+
provider_id: provider[:id],
|
41
|
+
status: 'success',
|
42
|
+
created_at: now,
|
43
|
+
updated_at: now
|
44
|
+
})
|
45
|
+
end
|
46
|
+
let!(:webhook_execution) do
|
47
|
+
create(:webhook_executions, {
|
48
|
+
triggered_webhook_id: triggered_webhook[:id],
|
49
|
+
success: true,
|
50
|
+
logs: 'logs',
|
51
|
+
created_at: now
|
52
|
+
})
|
53
|
+
end
|
54
|
+
|
55
|
+
let!(:orphan_triggered_webhook) do
|
56
|
+
create(:triggered_webhooks, {
|
57
|
+
trigger_uuid: '12345',
|
58
|
+
trigger_type: 'publication',
|
59
|
+
pact_publication_id: pact_publication[:id],
|
60
|
+
webhook_id: nil,
|
61
|
+
webhook_uuid: webhook[:uuid],
|
62
|
+
consumer_id: consumer[:id],
|
63
|
+
provider_id: provider[:id],
|
64
|
+
status: 'success',
|
65
|
+
created_at: now,
|
66
|
+
updated_at: now
|
67
|
+
})
|
68
|
+
end
|
69
|
+
|
70
|
+
let!(:orphan_webhook_execution) do
|
71
|
+
create(:webhook_executions, {
|
72
|
+
triggered_webhook_id: orphan_triggered_webhook[:id],
|
73
|
+
success: true,
|
74
|
+
logs: 'logs',
|
75
|
+
created_at: now
|
76
|
+
})
|
77
|
+
end
|
78
|
+
|
79
|
+
let!(:deprecated_orphan_webhook_execution) do
|
80
|
+
create(:webhook_executions, {
|
81
|
+
triggered_webhook_id: nil,
|
82
|
+
webhook_id: nil,
|
83
|
+
success: true,
|
84
|
+
logs: 'logs',
|
85
|
+
created_at: now
|
86
|
+
})
|
87
|
+
end
|
88
|
+
|
89
|
+
subject { PactBroker::Database.migrate(42) }
|
90
|
+
|
91
|
+
it "deletes the orphan triggered webhooks" do
|
92
|
+
expect { subject }.to change { database[:triggered_webhooks].count }.by(-1)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "deletes the orphan webhook executions" do
|
96
|
+
expect { subject }.to change { database[:webhook_executions].count }.by(-2)
|
97
|
+
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -490,6 +490,7 @@ files:
|
|
490
490
|
- db/migrations/39_add_triggered_webhooks_fk_to_execution.rb
|
491
491
|
- db/migrations/40_create_latest_triggered_webhooks_view.rb
|
492
492
|
- db/migrations/41_migrate_execution_data.rb
|
493
|
+
- db/migrations/42_delete_orphan_webhook_data.rb
|
493
494
|
- db/migrations/migration_helper.rb
|
494
495
|
- db/pact_broker_database.sqlite3
|
495
496
|
- db/test/backwards_compatibility/.rspec
|
@@ -761,6 +762,7 @@ files:
|
|
761
762
|
- script/seed.rb
|
762
763
|
- script/update-hal-browser
|
763
764
|
- script/webhook-server.ru
|
765
|
+
- spec/features/create_pacticipant_spec.rb
|
764
766
|
- spec/features/create_webhook_spec.rb
|
765
767
|
- spec/features/delete_label_spec.rb
|
766
768
|
- spec/features/delete_pact_spec.rb
|
@@ -905,6 +907,7 @@ files:
|
|
905
907
|
- spec/migrations/34_latest_tagged_pacts_spec.rb
|
906
908
|
- spec/migrations/34_pact_revisions_spec.rb
|
907
909
|
- spec/migrations/41_migrate_execution_data_spec.rb
|
910
|
+
- spec/migrations/42_delete_ophan_webhook_data_spec.rb
|
908
911
|
- spec/service_consumers/pact_helper.rb
|
909
912
|
- spec/service_consumers/provider_states_for_pact_broker_client.rb
|
910
913
|
- spec/spec_helper.rb
|
@@ -984,6 +987,7 @@ signing_key:
|
|
984
987
|
specification_version: 4
|
985
988
|
summary: See description
|
986
989
|
test_files:
|
990
|
+
- spec/features/create_pacticipant_spec.rb
|
987
991
|
- spec/features/create_webhook_spec.rb
|
988
992
|
- spec/features/delete_label_spec.rb
|
989
993
|
- spec/features/delete_pact_spec.rb
|
@@ -1128,6 +1132,7 @@ test_files:
|
|
1128
1132
|
- spec/migrations/34_latest_tagged_pacts_spec.rb
|
1129
1133
|
- spec/migrations/34_pact_revisions_spec.rb
|
1130
1134
|
- spec/migrations/41_migrate_execution_data_spec.rb
|
1135
|
+
- spec/migrations/42_delete_ophan_webhook_data_spec.rb
|
1131
1136
|
- spec/service_consumers/pact_helper.rb
|
1132
1137
|
- spec/service_consumers/provider_states_for_pact_broker_client.rb
|
1133
1138
|
- spec/spec_helper.rb
|