pact_broker 2.85.1 → 2.86.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release_gem.yml +1 -1
- data/.github/workflows/trigger_pact_docs_update.yml +22 -0
- data/CHANGELOG.md +10 -0
- data/DEVELOPER_DOCUMENTATION.md +0 -2
- data/db/migrations/20210914_add_labels_to_webhooks.rb +14 -0
- data/db/migrations/20210915_add_verified_by_to_verification.rb +6 -0
- data/docker-compose-ci-mysql.yml +1 -0
- data/docs/CONFIGURATION.md +255 -66
- data/docs/configuration.yml +166 -101
- data/lib/db.rb +0 -1
- data/lib/pact_broker/api/contracts/webhook_contract.rb +24 -2
- data/lib/pact_broker/api/decorators/verification_decorator.rb +4 -0
- data/lib/pact_broker/api/decorators/webhook_decorator.rb +27 -4
- data/lib/pact_broker/api/pact_broker_urls.rb +4 -0
- data/lib/pact_broker/api/resources/all_webhooks.rb +2 -2
- data/lib/pact_broker/config/runtime_configuration.rb +4 -0
- data/lib/pact_broker/config/runtime_configuration_database_methods.rb +1 -1
- data/lib/pact_broker/db/clean.rb +1 -2
- data/lib/pact_broker/doc/views/pacticipant/label.markdown +12 -0
- data/lib/pact_broker/doc/views/webhooks.markdown +17 -0
- data/lib/pact_broker/domain/pacticipant.rb +4 -0
- data/lib/pact_broker/domain/verification.rb +16 -4
- data/lib/pact_broker/domain/webhook.rb +5 -5
- data/lib/pact_broker/domain/webhook_pacticipant.rb +6 -0
- data/lib/pact_broker/locale/en.yml +1 -0
- data/lib/pact_broker/matrix/head_row.rb +1 -1
- data/lib/pact_broker/matrix/quick_row.rb +0 -1
- data/lib/pact_broker/matrix/repository.rb +0 -1
- data/lib/pact_broker/matrix/row.rb +2 -2
- data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +0 -1
- data/lib/pact_broker/pacts/pact_publication.rb +7 -0
- data/lib/pact_broker/pacts/pact_publication_clean_selector_dataset_module.rb +19 -0
- data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +30 -2
- data/lib/pact_broker/pacts/pact_version.rb +24 -1
- data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +2 -2
- data/lib/pact_broker/pacts/repository.rb +50 -47
- data/lib/pact_broker/test/http_test_data_builder.rb +37 -10
- data/lib/pact_broker/test/test_data_builder.rb +22 -5
- data/lib/pact_broker/verifications/repository.rb +5 -2
- data/lib/pact_broker/verifications/service.rb +4 -1
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/event_listener.rb +4 -2
- data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +1 -0
- data/lib/pact_broker/webhooks/repository.rb +10 -4
- data/lib/pact_broker/webhooks/webhook.rb +66 -8
- data/script/data/verify-pact-for-multiple-selectors.rb +30 -0
- data/script/docs/generate-configuration-docs.rb +24 -3
- data/script/generate-erd +55 -0
- data/spec/features/create_webhook_spec.rb +55 -10
- data/spec/features/get_pact_spec.rb +2 -3
- data/spec/fixtures/verification.json +4 -0
- data/spec/integration/webhooks/pact_publication_spec.rb +51 -0
- data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +50 -0
- data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +8 -1
- data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +3 -1
- data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/config/runtime_configuration_documentation_spec.rb +30 -0
- data/spec/lib/pact_broker/deployments/environment_service_spec.rb +1 -1
- data/spec/lib/pact_broker/matrix/head_row_spec.rb +9 -5
- data/spec/lib/pact_broker/pacts/{latest_tagged_pact_publications_spec.rb → pact_publication_clean_selector_dataset_module_spec.rb} +7 -9
- data/spec/lib/pact_broker/pacts/pact_version_spec.rb +32 -0
- data/spec/lib/pact_broker/pacts/repository_spec.rb +33 -0
- data/spec/lib/pact_broker/verifications/service_spec.rb +16 -2
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +158 -15
- data/spec/lib/pact_broker/webhooks/webhook_spec.rb +8 -5
- metadata +16 -11
- data/lib/pact_broker/pacts/all_pact_publications.rb +0 -158
- data/lib/pact_broker/pacts/latest_pact_publications.rb +0 -48
- data/lib/pact_broker/pacts/latest_pact_publications_by_consumer_version.rb +0 -26
- data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +0 -45
- data/lib/pact_broker/verifications/latest_verification_for_pact_version.rb +0 -39
- data/spec/lib/pact_broker/verifications/latest_verification_for_pact_version_spec.rb +0 -18
@@ -1,39 +0,0 @@
|
|
1
|
-
require "pact_broker/domain/verification"
|
2
|
-
|
3
|
-
# TODO delete this when AllPactPublications is deleted
|
4
|
-
|
5
|
-
module PactBroker
|
6
|
-
module Verifications
|
7
|
-
class LatestVerificationForPactVersion < PactBroker::Domain::Verification
|
8
|
-
set_dataset(:latest_verifications_for_pact_versions)
|
9
|
-
|
10
|
-
# this view doesn't have a consumer_id
|
11
|
-
def consumer
|
12
|
-
PactBroker::Domain::Pacticipant.find(id: PactBroker::Pacts::AllPactPublications
|
13
|
-
.where(pact_version_id: pact_version_id)
|
14
|
-
.limit(1).select(:consumer_id))
|
15
|
-
end
|
16
|
-
|
17
|
-
# this view doesn't have a provider_id
|
18
|
-
def provider
|
19
|
-
PactBroker::Domain::Pacticipant.find(id: PactBroker::Pacts::AllPactPublications
|
20
|
-
.where(pact_version_id: pact_version_id)
|
21
|
-
.limit(1).select(:provider_id))
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# Table: latest_verifications_for_pact_versions
|
28
|
-
# Columns:
|
29
|
-
# id | integer |
|
30
|
-
# number | integer |
|
31
|
-
# success | boolean |
|
32
|
-
# build_url | text |
|
33
|
-
# pact_version_id | integer |
|
34
|
-
# execution_date | timestamp without time zone |
|
35
|
-
# created_at | timestamp without time zone |
|
36
|
-
# provider_version_id | integer |
|
37
|
-
# provider_version_number | text |
|
38
|
-
# provider_version_order | integer |
|
39
|
-
# test_results | text |
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "pact_broker/verifications/latest_verification_for_pact_version"
|
2
|
-
|
3
|
-
module PactBroker
|
4
|
-
module Verifications
|
5
|
-
describe LatestVerificationForPactVersion do
|
6
|
-
before do
|
7
|
-
td.create_pact_with_hierarchy("Foo", "1", "Bar")
|
8
|
-
.create_verification(provider_version: "2")
|
9
|
-
end
|
10
|
-
|
11
|
-
subject { LatestVerificationForPactVersion.first }
|
12
|
-
|
13
|
-
its(:"consumer.name") { is_expected.to eq "Foo" }
|
14
|
-
its(:"provider.name") { is_expected.to eq "Bar" }
|
15
|
-
its(:"provider_version.number") { is_expected.to eq "2" }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|