pact_broker 2.85.0 → 2.88.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/trigger_pact_docs_update.yml +22 -0
- data/CHANGELOG.md +67 -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/db/migrations/20210929_increase_event_context_column_size.rb +14 -0
- data/docker-compose-ci-mysql.yml +1 -0
- data/docker-compose-test.yml +2 -0
- data/docs/CONFIGURATION.md +255 -66
- data/docs/api/WEBHOOKS.md +789 -0
- data/docs/configuration.yml +166 -101
- data/lib/db.rb +0 -1
- data/lib/pact/doc/interaction_view_model.rb +2 -2
- data/lib/pact/doc/markdown/consumer_contract_renderer.rb +1 -1
- data/lib/pact_broker/api/contracts/configuration.rb +33 -0
- data/lib/pact_broker/api/contracts/publish_contracts_schema.rb +35 -16
- data/lib/pact_broker/api/contracts/webhook_contract.rb +24 -2
- data/lib/pact_broker/api/decorators/matrix_decorator.rb +3 -1
- data/lib/pact_broker/api/decorators/pact_decorator.rb +12 -0
- data/lib/pact_broker/api/decorators/verification_decorator.rb +9 -3
- data/lib/pact_broker/api/decorators/webhook_decorator.rb +27 -4
- data/lib/pact_broker/api/pact_broker_urls.rb +30 -6
- data/lib/pact_broker/api/resources/all_webhooks.rb +2 -2
- data/lib/pact_broker/api/resources/default_base_resource.rb +5 -1
- data/lib/pact_broker/api/resources/environment.rb +4 -4
- data/lib/pact_broker/api/resources/environments.rb +1 -1
- data/lib/pact_broker/api/resources/index.rb +7 -1
- data/lib/pact_broker/api/resources/metadata_resource_methods.rb +33 -3
- data/lib/pact_broker/api/resources/pact_version.rb +4 -0
- data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +1 -1
- data/lib/pact_broker/api/resources/publish_contracts.rb +1 -1
- data/lib/pact_broker/api/resources/verification.rb +5 -2
- data/lib/pact_broker/api/resources/webhook_execution.rb +7 -3
- data/lib/pact_broker/api/resources/webhook_execution_methods.rb +23 -17
- data/lib/pact_broker/api.rb +6 -0
- data/lib/pact_broker/application_context.rb +5 -0
- 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/db/delete_overwritten_data.rb +41 -23
- data/lib/pact_broker/deployments/deployed_version.rb +1 -0
- data/lib/pact_broker/deployments/deployed_version_service.rb +1 -0
- data/lib/pact_broker/deployments/environment_service.rb +7 -2
- data/lib/pact_broker/deployments/released_version_service.rb +1 -0
- data/lib/pact_broker/doc/controllers/app.rb +1 -0
- data/lib/pact_broker/doc/views/can-i-deploy.markdown +2 -1
- data/lib/pact_broker/doc/views/index/publish-contracts.markdown +38 -9
- data/lib/pact_broker/doc/views/pacticipant/label.markdown +12 -0
- data/lib/pact_broker/doc/views/provider-pacts-for-verification.markdown +7 -7
- data/lib/pact_broker/doc/views/webhooks.markdown +17 -0
- data/lib/pact_broker/domain/index_item.rb +9 -0
- data/lib/pact_broker/domain/pacticipant.rb +4 -0
- data/lib/pact_broker/domain/verification.rb +19 -4
- data/lib/pact_broker/domain/webhook.rb +5 -5
- data/lib/pact_broker/domain/webhook_pacticipant.rb +6 -0
- data/lib/pact_broker/index/service.rb +4 -4
- data/lib/pact_broker/locale/en.yml +4 -1
- data/lib/pact_broker/matrix/head_row.rb +1 -1
- data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +5 -3
- 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/pacticipants/repository.rb +1 -1
- data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +0 -1
- data/lib/pact_broker/pacts/metadata.rb +7 -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 +5 -4
- data/lib/pact_broker/pacts/repository.rb +50 -47
- data/lib/pact_broker/pacts/service.rb +5 -5
- data/lib/pact_broker/string_refinements.rb +1 -1
- data/lib/pact_broker/test/http_test_data_builder.rb +40 -10
- data/lib/pact_broker/test/test_data_builder.rb +28 -5
- data/lib/pact_broker/ui/helpers/url_helper.rb +12 -0
- data/lib/pact_broker/ui/view_models/index_item.rb +15 -1
- data/lib/pact_broker/ui/view_models/index_item_branch_head.rb +39 -0
- data/lib/pact_broker/ui/view_models/index_item_provider_branch_head.rb +39 -0
- data/lib/pact_broker/ui/views/dashboard/show.haml +14 -7
- data/lib/pact_broker/verifications/repository.rb +5 -2
- data/lib/pact_broker/verifications/service.rb +7 -4
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/abbreviate_number.rb +8 -4
- data/lib/pact_broker/versions/branch_head.rb +0 -2
- data/lib/pact_broker/versions/branch_version.rb +1 -0
- data/lib/pact_broker/versions/repository.rb +0 -1
- data/lib/pact_broker/webhooks/event_listener.rb +4 -2
- data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +18 -3
- data/lib/pact_broker/webhooks/repository.rb +10 -4
- data/lib/pact_broker/webhooks/trigger_service.rb +1 -1
- data/lib/pact_broker/webhooks/webhook.rb +71 -8
- data/lib/webmachine/describe_routes.rb +62 -0
- data/public/stylesheets/index.css +5 -0
- data/script/data/auto-create-things-for-tags.rb +1 -0
- data/script/data/branches.rb +1 -1
- data/script/data/contract-published-requiring-verification.rb +0 -1
- data/script/data/verify-pact-for-multiple-selectors.rb +30 -0
- data/script/docs/generate-api-docs.rb +117 -0
- data/script/docs/generate-configuration-docs.rb +24 -3
- data/script/docs/regenerate-api-docs.sh +11 -0
- 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/approvals/docs_webhooks_executing_a_saved_webhook_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_executing_a_saved_webhook_post.approved.json +43 -0
- data/spec/fixtures/approvals/docs_webhooks_executing_an_unsaved_webhook_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_executing_an_unsaved_webhook_post.approved.json +63 -0
- data/spec/fixtures/approvals/docs_webhooks_logs_of_triggered_webhook_get.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_logs_of_triggered_webhook_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_pact_webhooks_get.approved.json +45 -0
- data/spec/fixtures/approvals/docs_webhooks_pact_webhooks_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_pact_publication_get.approved.json +52 -0
- data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_pact_publication_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_verification_publication_get.approved.json +32 -0
- data/spec/fixtures/approvals/docs_webhooks_triggered_webhooks_for_verification_publication_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhook_get.approved.json +74 -0
- data/spec/fixtures/approvals/docs_webhooks_webhook_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhook_put.approved.json +77 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_a_provider_get.approved.json +41 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_a_provider_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_and_provider_get.approved.json +45 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_and_provider_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_get.approved.json +41 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_for_consumer_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_get.approved.json +45 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_options.approved.json +20 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_post.approved.json +78 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_status_get.approved.json +79 -0
- data/spec/fixtures/approvals/docs_webhooks_webhooks_status_options.approved.json +20 -0
- data/spec/fixtures/approvals/get_provider_pacts_for_verification.approved.json +1 -2
- data/spec/fixtures/approvals/publish_contract_no_branch.approved.json +1 -2
- data/spec/fixtures/approvals/publish_contract_nothing_exists.approved.json +1 -2
- data/spec/fixtures/approvals/publish_contract_nothing_exists_with_webhook.approved.json +1 -2
- data/spec/fixtures/approvals/publish_contract_verification_already_exists.approved.json +1 -2
- data/spec/fixtures/approvals/publish_contract_with_validation_error.approved.json +1 -2
- data/spec/fixtures/invalid-publish-contract-body.json +38 -0
- data/spec/fixtures/verification.json +4 -0
- data/spec/integration/pact_metdata_spec.rb +105 -0
- data/spec/integration/webhooks/contract_publication_spec.rb +68 -0
- data/spec/integration/webhooks/contract_requiring_verification_published_spec.rb +67 -0
- data/spec/integration/webhooks/pact_publication_spec.rb +51 -0
- data/spec/integration/webhooks_documentation_spec.rb +348 -0
- data/spec/lib/pact/doc/markdown/consumer_contract_renderer_spec.rb +2 -2
- data/spec/lib/pact_broker/api/contracts/publish_contracts_schema_spec.rb +13 -0
- data/spec/lib/pact_broker/api/contracts/webhook_contract_spec.rb +50 -0
- data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +1 -1
- data/spec/lib/pact_broker/api/decorators/verification_decorator_spec.rb +15 -7
- data/spec/lib/pact_broker/api/decorators/verification_summary_decorator_spec.rb +4 -2
- data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +18 -0
- data/spec/lib/pact_broker/api/resources/triggered_webhook_logs_spec.rb +6 -5
- data/spec/lib/pact_broker/config/runtime_configuration_documentation_spec.rb +30 -0
- data/spec/lib/pact_broker/deployments/environment_service_spec.rb +22 -1
- data/spec/lib/pact_broker/domain/webhook_spec.rb +35 -0
- data/spec/lib/pact_broker/matrix/head_row_spec.rb +9 -5
- data/spec/lib/pact_broker/matrix/parse_can_i_deploy_query_spec.rb +13 -0
- 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_find_for_verification_spec.rb +4 -5
- data/spec/lib/pact_broker/pacts/repository_spec.rb +33 -0
- data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +1 -1
- data/spec/lib/pact_broker/verifications/service_spec.rb +22 -8
- data/spec/lib/pact_broker/versions/abbreviate_number_spec.rb +2 -1
- data/spec/lib/pact_broker/webhooks/render_spec.rb +3 -2
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +158 -15
- data/spec/lib/pact_broker/webhooks/webhook_spec.rb +8 -5
- data/spec/support/documentation.rb +64 -0
- data/spec/support/rack_helpers.rb +1 -1
- data/tasks/db.rake +4 -1
- data/tasks/development.rake +14 -13
- metadata +89 -12
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b886a748e8133256c6b1a48f018263b18abe3e907878bd659941529791052b72
|
4
|
+
data.tar.gz: a236b15253a54764939b260d80aa77e1c3635448ce486606f6013df9f864029d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cededddf5b3eacacd0bc3347bb3350156d2acb5bd29bfd0f43b2a234470ec7a592f4a0b41c167d47f9ec25815092d5bdde16d688b4ded08cce6c1c57008683b3
|
7
|
+
data.tar.gz: 683226ee8e28b2055a0e99623c7b2fbbb0bc959308eee60d00f5f255a23411331818c236082f23f56ac4752bd32b63fbe37a702747ce99300e3980dbaa5d4262
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: Trigger update to docs.pact.io
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
paths:
|
8
|
+
- '**/*.md'
|
9
|
+
repository_dispatch:
|
10
|
+
types:
|
11
|
+
- gem-released
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
build:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
steps:
|
17
|
+
- name: Trigger docs.pact.io update workflow
|
18
|
+
uses: peter-evans/repository-dispatch@v1
|
19
|
+
with:
|
20
|
+
token: ${{ secrets.GHTOKENFORTRIGGERINGPACTDOCSUPDATE }}
|
21
|
+
repository: pact-foundation/docs.pact.io
|
22
|
+
event-type: pact-broker-docs-updated
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,70 @@
|
|
1
|
+
<a name="v2.88.0"></a>
|
2
|
+
### v2.88.0 (2021-10-11)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* include relations for each consumer version that a pact version belongs to when retrieved using the URL from the 'pacts for verification' response ([3458c9e5](/../../commit/3458c9e5))
|
7
|
+
|
8
|
+
#### Bug Fixes
|
9
|
+
|
10
|
+
* use the decoded path info rather than the encoded one when creating the pact info ([dd30a1a2](/../../commit/dd30a1a2))
|
11
|
+
* edge case in webhook description rendering with participants specified by labels (#512) ([7e6a78d8](/../../commit/7e6a78d8))
|
12
|
+
|
13
|
+
* **matrix**
|
14
|
+
* prevent long version names overlfow the table (#511) ([3c279556](/../../commit/3c279556))
|
15
|
+
|
16
|
+
<a name="v2.87.0"></a>
|
17
|
+
### v2.87.0 (2021-10-05)
|
18
|
+
|
19
|
+
#### Features
|
20
|
+
|
21
|
+
* **matrix**
|
22
|
+
* preselect the consumer version when clicking through to matrix page from integration dashboard ([b550b470](/../../commit/b550b470))
|
23
|
+
|
24
|
+
* **dashboard**
|
25
|
+
* show tooltip explaining auto created branches ([cdaf7f6e](/../../commit/cdaf7f6e))
|
26
|
+
|
27
|
+
* **can-i-deploy**
|
28
|
+
* support ignoring specific version numbers ([2ac5a946](/../../commit/2ac5a946))
|
29
|
+
* make verification results URL reference the appropriate consumer version as the pb:pact-version ([145bb37b](/../../commit/145bb37b))
|
30
|
+
|
31
|
+
* add pb:can-i-deploy-pacticipant-version-to-environment relation ([67328194](/../../commit/67328194))
|
32
|
+
|
33
|
+
* **webhooks**
|
34
|
+
* support ${pactbroker.providerVersionDescriptions} template parameter ([54a073eb](/../../commit/54a073eb))
|
35
|
+
* support ${pactbroker.buildUrl} template parameter ([9b79b33f](/../../commit/9b79b33f))
|
36
|
+
* support $pactbroker.consumerVersionBranch template parameter ([b97ba84c](/../../commit/b97ba84c))
|
37
|
+
|
38
|
+
#### Bug Fixes
|
39
|
+
|
40
|
+
* **mysql**
|
41
|
+
* increase size of event_context column ([c1596419](/../../commit/c1596419))
|
42
|
+
|
43
|
+
* correctly merge dry validation and custom validation error messages when publishing contracts ([688b1e3f](/../../commit/688b1e3f))
|
44
|
+
|
45
|
+
* **pacts for verification**
|
46
|
+
* correct logic for returning pact for main branch when no consumer version selectors are specified ([8847e442](/../../commit/8847e442))
|
47
|
+
|
48
|
+
* **db clean**
|
49
|
+
* optimise calls to identify overwritten data to delete ([aaef9e6d](/../../commit/aaef9e6d))
|
50
|
+
|
51
|
+
<a name="v2.86.0"></a>
|
52
|
+
### v2.86.0 (2021-09-17)
|
53
|
+
|
54
|
+
#### Features
|
55
|
+
|
56
|
+
* allow webhooks to match pacticipants by label (#501) ([f30a9dcc](/../../commit/f30a9dcc))
|
57
|
+
* in the webhook body for contract_published and contract_content_changed, use the latest verification from the main branch if present ([b45398bd](/../../commit/b45398bd))
|
58
|
+
* change default database_connection_validation_timeout from -1 (every request) to nil (which Sequel will set to 3600 seconds) ([0c508572](/../../commit/0c508572))
|
59
|
+
* add version details of the implementation that verified a Pact (#363) ([021a8692](/../../commit/021a8692))
|
60
|
+
|
61
|
+
<a name="v2.85.1"></a>
|
62
|
+
### v2.85.1 (2021-09-14)
|
63
|
+
|
64
|
+
#### Bug Fixes
|
65
|
+
|
66
|
+
* fix bug identifying latest verification for tagged pact ([43ac4b03](/../../commit/43ac4b03))
|
67
|
+
|
1
68
|
<a name="v2.85.0"></a>
|
2
69
|
### v2.85.0 (2021-09-13)
|
3
70
|
|
data/DEVELOPER_DOCUMENTATION.md
CHANGED
@@ -85,8 +85,6 @@ pact publication resource will be created with an incremented revision number, b
|
|
85
85
|
|
86
86
|
* `latest_pact_publications_by_consumer_versions` - This view has the same columns as `all_pact_publications`, but it only contains the latest revision of the pact for each provider/consumer/version. It maps to what a user would consider the "pact" resource ie. `/pacts/provider/PROVIDER/consumer/CONSUMER/version/VERSION`. Previous revisions are not currently exposed via the API.
|
87
87
|
|
88
|
-
The `AllPactPublications` Sequel model in the code is what is used when querying data for displaying in a response, rather than the normalised separate PactPublication and PactVersion models.
|
89
|
-
|
90
88
|
* `latest_pact_publications` - This view has the same columns as `all_pact_publications`, but it only contains the latest revision of the pact for the latest consumer version for each consumer/provider pair. It is what a user would consider the "latest pact", and maps to the resource at `/pacts/provider/PROVIDER/consumer/CONSUMER/latest`
|
91
89
|
|
92
90
|
* `latest_tagged_pact_publications` - This view has the same columns as `all_pact_publications`, plus a `tag_name` column. It is used to return the pact for the latest tagged version of a consumer.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Sequel.migration do
|
2
|
+
change do
|
3
|
+
alter_table(:webhooks) do
|
4
|
+
add_column(:consumer_label, String)
|
5
|
+
add_column(:provider_label, String)
|
6
|
+
end
|
7
|
+
|
8
|
+
# SQLite workaround - with one `alter_table` block it adds only last constraint.
|
9
|
+
alter_table(:webhooks) do
|
10
|
+
add_constraint(:consumer_label_exclusion, "consumer_id IS NULL OR (consumer_id IS NOT NULL AND consumer_label IS NULL)")
|
11
|
+
add_constraint(:provider_label_exclusion, "provider_id IS NULL OR (provider_id IS NOT NULL AND provider_label IS NULL)")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/docker-compose-ci-mysql.yml
CHANGED
data/docker-compose-test.yml
CHANGED
@@ -49,6 +49,7 @@ services:
|
|
49
49
|
- ./.rubocop:/home/.rubocop
|
50
50
|
- ./.gitignore:/home/.gitignore
|
51
51
|
- ./public:/home/public
|
52
|
+
- ./docs:/home/docs
|
52
53
|
|
53
54
|
mysql:
|
54
55
|
image: mysql:5.7.28
|
@@ -97,4 +98,5 @@ services:
|
|
97
98
|
- ./.rubocop:/home/.rubocop
|
98
99
|
- ./.gitignore:/home/.gitignore
|
99
100
|
- ./public:/home/public
|
101
|
+
- ./docs:/home/docs
|
100
102
|
|