pact_broker 2.84.0 → 2.87.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 +63 -0
- data/DEVELOPER_DOCUMENTATION.md +0 -2
- data/db/migrations/20210913_add_pending_to_verifications.rb +7 -0
- 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/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 +4 -4
- 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/reason_decorator.rb +2 -2
- data/lib/pact_broker/api/decorators/verification_decorator.rb +9 -3
- data/lib/pact_broker/api/decorators/verification_summary_decorator.rb +1 -2
- data/lib/pact_broker/api/decorators/webhook_decorator.rb +27 -4
- data/lib/pact_broker/api/middleware/configuration.rb +33 -0
- data/lib/pact_broker/api/pact_broker_urls.rb +35 -7
- data/lib/pact_broker/api/renderers/html_pact_renderer.rb +15 -11
- data/lib/pact_broker/api/resources/all_webhooks.rb +2 -2
- data/lib/pact_broker/api/resources/default_base_resource.rb +4 -0
- data/lib/pact_broker/api/resources/environment.rb +1 -1
- 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/pact_versions_for_branch.rb +40 -0
- 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/verifications.rb +5 -1
- data/lib/pact_broker/api/resources/webhook_execution_methods.rb +23 -17
- data/lib/pact_broker/api.rb +2 -0
- data/lib/pact_broker/app.rb +2 -0
- data/lib/pact_broker/application_context.rb +5 -0
- data/lib/pact_broker/badges/service.rb +3 -1
- 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/configuration.rb +33 -29
- 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 +4 -1
- 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/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 +28 -4
- data/lib/pact_broker/domain/webhook.rb +27 -15
- data/lib/pact_broker/domain/webhook_pacticipant.rb +6 -0
- data/lib/pact_broker/domain/webhook_request.rb +2 -2
- data/lib/pact_broker/index/service.rb +77 -26
- data/lib/pact_broker/locale/en.yml +6 -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 +11 -3
- data/lib/pact_broker/pacts/pact_publication.rb +44 -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 +68 -1
- 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 +52 -48
- 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 -11
- data/lib/pact_broker/test/test_data_builder.rb +27 -6
- data/lib/pact_broker/ui/app.rb +7 -1
- data/lib/pact_broker/ui/controllers/dashboard.rb +80 -0
- data/lib/pact_broker/ui/controllers/groups.rb +23 -8
- data/lib/pact_broker/ui/helpers/url_helper.rb +17 -1
- data/lib/pact_broker/ui/view_models/index_item.rb +64 -8
- 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/view_models/matrix_branch.rb +1 -1
- data/lib/pact_broker/ui/view_models/matrix_tag.rb +0 -1
- data/lib/pact_broker/ui/views/dashboard/show.haml +202 -0
- data/lib/pact_broker/ui/views/groups/show.html.erb +60 -14
- data/lib/pact_broker/ui/views/index/_dashboard_navbar.haml +7 -0
- data/lib/pact_broker/ui/views/index/_navbar.haml +0 -7
- data/lib/pact_broker/ui/views/index/show-with-tags.haml +3 -1
- data/lib/pact_broker/ui/views/index/show.haml +35 -13
- data/lib/pact_broker/ui/views/matrix/show.haml +7 -3
- data/lib/pact_broker/verifications/pseudo_branch_status.rb +2 -0
- data/lib/pact_broker/verifications/repository.rb +5 -2
- data/lib/pact_broker/verifications/service.rb +8 -4
- data/lib/pact_broker/version.rb +1 -1
- 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 +7 -5
- data/lib/pact_broker/webhooks/execution_configuration.rb +16 -0
- data/lib/pact_broker/webhooks/execution_configuration_creator.rb +3 -0
- data/lib/pact_broker/webhooks/job.rb +1 -1
- 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 +3 -3
- data/lib/pact_broker/webhooks/webhook.rb +71 -8
- data/lib/pact_broker/webhooks/webhook_execution_result.rb +3 -7
- data/lib/pact_broker/webhooks/webhook_request_logger.rb +4 -12
- data/lib/pact_broker/webhooks/webhook_request_template.rb +6 -8
- data/pact_broker.gemspec +4 -0
- data/public/javascripts/index.js +75 -68
- data/public/javascripts/pact.js +14 -14
- data/public/stylesheets/index.css +6 -2
- data/public/stylesheets/pact.css +11 -0
- data/script/data/auto-create-things-for-tags.rb +3 -0
- data/script/data/branches.rb +2 -2
- data/script/data/contract-published-requiring-verification.rb +0 -1
- data/script/data/environments.rb +0 -0
- data/script/data/pending.rb +26 -0
- data/script/data/tags.rb +35 -0
- data/script/data/verify-pact-for-multiple-selectors.rb +30 -0
- data/script/data/webhook.rb +22 -0
- data/script/docs/generate-configuration-docs.rb +24 -3
- data/script/generate-erd +55 -0
- data/script/seed.rb +50 -89
- data/spec/features/create_webhook_spec.rb +55 -10
- data/spec/features/delete_pact_versions_for_branch_spec.rb +34 -0
- data/spec/features/get_pact_spec.rb +2 -3
- data/spec/fixtures/approvals/modifiable_resources.approved.json +4 -0
- data/spec/fixtures/invalid-publish-contract-body.json +38 -0
- data/spec/fixtures/verification.json +4 -0
- data/spec/integration/app_spec.rb +6 -6
- 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/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/reason_decorator_spec.rb +2 -2
- 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 +6 -2
- data/spec/lib/pact_broker/api/decorators/webhook_decorator_spec.rb +4 -4
- data/spec/lib/pact_broker/api/decorators/webhook_execution_result_decorator_spec.rb +1 -1
- data/spec/lib/pact_broker/api/middleware/configuration_spec.rb +43 -0
- 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/api/resources/verifications_spec.rb +2 -3
- data/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb +1 -1
- data/spec/lib/pact_broker/badges/service_spec.rb +22 -0
- 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/domain/webhook_request_spec.rb +2 -1
- data/spec/lib/pact_broker/domain/webhook_spec.rb +15 -5
- data/spec/lib/pact_broker/index/service_spec.rb +1 -5
- data/spec/lib/pact_broker/index/service_view_spec.rb +144 -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/metadata_spec.rb +11 -2
- 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_publication_latest_verification_spec.rb +29 -0
- 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 +48 -2
- data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +12 -9
- data/spec/lib/pact_broker/verifications/pseudo_branch_status_spec.rb +9 -1
- data/spec/lib/pact_broker/verifications/service_spec.rb +24 -8
- data/spec/lib/pact_broker/webhooks/job_spec.rb +4 -4
- 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/trigger_service_spec.rb +9 -5
- data/spec/lib/pact_broker/webhooks/webhook_request_logger_spec.rb +6 -12
- data/spec/lib/pact_broker/webhooks/webhook_request_template_spec.rb +3 -2
- data/spec/lib/pact_broker/webhooks/webhook_spec.rb +8 -5
- data/spec/support/generated_markdown.md +3 -3
- data/tasks/db.rake +4 -1
- metadata +72 -14
- 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/api/resources/webhook_execution_result_spec.rb +0 -56
- 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: f376a0bea2db36abf0b4b601badefb182b836bad4c43be53063388ad65ecc1c0
|
4
|
+
data.tar.gz: 5ab7478d03702755dea935bde89173461b6221c4723c719267a9a6e8360d6e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bb19660447b2f13d2f815b6ce13b3aa27dac289ba023d4463de204fd6605c1f2d787f8e08d36c5868947ba4fa44fb277cf04a77a9e90ad1a9c5e0642d5ec269
|
7
|
+
data.tar.gz: 1a68a6c2393f42469045b4fffd1fa548b4833e66401733e75a43382103c8481f38c54d5ed4241e3f4232596b5a23dab6af6a518bad5398d8777b23137c8d9fc9
|
@@ -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,66 @@
|
|
1
|
+
<a name="v2.87.0"></a>
|
2
|
+
### v2.87.0 (2021-10-05)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* **matrix**
|
7
|
+
* preselect the consumer version when clicking through to matrix page from integration dashboard ([b550b470](/../../commit/b550b470))
|
8
|
+
|
9
|
+
* **dashboard**
|
10
|
+
* show tooltip explaining auto created branches ([cdaf7f6e](/../../commit/cdaf7f6e))
|
11
|
+
|
12
|
+
* **can-i-deploy**
|
13
|
+
* support ignoring specific version numbers ([2ac5a946](/../../commit/2ac5a946))
|
14
|
+
* make verification results URL reference the appropriate consumer version as the pb:pact-version ([145bb37b](/../../commit/145bb37b))
|
15
|
+
|
16
|
+
* add pb:can-i-deploy-pacticipant-version-to-environment relation ([67328194](/../../commit/67328194))
|
17
|
+
|
18
|
+
* **webhooks**
|
19
|
+
* support ${pactbroker.providerVersionDescriptions} template parameter ([54a073eb](/../../commit/54a073eb))
|
20
|
+
* support ${pactbroker.buildUrl} template parameter ([9b79b33f](/../../commit/9b79b33f))
|
21
|
+
* support $pactbroker.consumerVersionBranch template parameter ([b97ba84c](/../../commit/b97ba84c))
|
22
|
+
|
23
|
+
#### Bug Fixes
|
24
|
+
|
25
|
+
* **mysql**
|
26
|
+
* increase size of event_context column ([c1596419](/../../commit/c1596419))
|
27
|
+
|
28
|
+
* correctly merge dry validation and custom validation error messages when publishing contracts ([688b1e3f](/../../commit/688b1e3f))
|
29
|
+
|
30
|
+
* **pacts for verification**
|
31
|
+
* correct logic for returning pact for main branch when no consumer version selectors are specified ([8847e442](/../../commit/8847e442))
|
32
|
+
|
33
|
+
* **db clean**
|
34
|
+
* optimise calls to identify overwritten data to delete ([aaef9e6d](/../../commit/aaef9e6d))
|
35
|
+
|
36
|
+
<a name="v2.86.0"></a>
|
37
|
+
### v2.86.0 (2021-09-17)
|
38
|
+
|
39
|
+
#### Features
|
40
|
+
|
41
|
+
* allow webhooks to match pacticipants by label (#501) ([f30a9dcc](/../../commit/f30a9dcc))
|
42
|
+
* in the webhook body for contract_published and contract_content_changed, use the latest verification from the main branch if present ([b45398bd](/../../commit/b45398bd))
|
43
|
+
* change default database_connection_validation_timeout from -1 (every request) to nil (which Sequel will set to 3600 seconds) ([0c508572](/../../commit/0c508572))
|
44
|
+
* add version details of the implementation that verified a Pact (#363) ([021a8692](/../../commit/021a8692))
|
45
|
+
|
46
|
+
<a name="v2.85.1"></a>
|
47
|
+
### v2.85.1 (2021-09-14)
|
48
|
+
|
49
|
+
#### Bug Fixes
|
50
|
+
|
51
|
+
* fix bug identifying latest verification for tagged pact ([43ac4b03](/../../commit/43ac4b03))
|
52
|
+
|
53
|
+
<a name="v2.85.0"></a>
|
54
|
+
### v2.85.0 (2021-09-13)
|
55
|
+
|
56
|
+
#### Features
|
57
|
+
|
58
|
+
* show in the UI whether or not a pact was pending when verification failed ([326c068e](/../../commit/326c068e))
|
59
|
+
* thread safe configuration overrides (#500) ([50900231](/../../commit/50900231))
|
60
|
+
* allow dashboard pacts to be viewed by branch, tag, environment or all ([1ec8fc82](/../../commit/1ec8fc82))
|
61
|
+
* support deleting pacts by branch in the UI ([bc8fef1d](/../../commit/bc8fef1d))
|
62
|
+
* update UI ([0ba5eda3](/../../commit/0ba5eda3))
|
63
|
+
|
1
64
|
<a name="v2.84.0"></a>
|
2
65
|
### v2.84.0 (2021-09-10)
|
3
66
|
|
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
|
|