pact_broker 2.107.1 → 2.108.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +55 -0
  3. data/Gemfile +5 -4
  4. data/README.md +1 -0
  5. data/db/migrations/20230615_add_integrations_contract_data_updated_at.rb +13 -0
  6. data/db/migrations/20230616_set_integrations_contract_data_updated_at.rb +11 -0
  7. data/db/migrations/20231002_add_version_id_index_to_released_version.rb +21 -0
  8. data/db/migrations/20231003_add_version_id_index_to_deployed_version.rb +21 -0
  9. data/docs/CONFIGURATION.md +10 -0
  10. data/lib/pact_broker/api/contracts/base_contract.rb +2 -1
  11. data/lib/pact_broker/api/contracts/dry_validation_errors_formatter.rb +2 -0
  12. data/lib/pact_broker/api/contracts/pagination_query_params_schema.rb +19 -0
  13. data/lib/pact_broker/api/contracts/publish_contracts_contract_contract.rb +29 -18
  14. data/lib/pact_broker/api/decorators/base_decorator.rb +40 -1
  15. data/lib/pact_broker/api/decorators/branch_decorator.rb +35 -0
  16. data/lib/pact_broker/api/decorators/branch_version_decorator.rb +16 -0
  17. data/lib/pact_broker/api/decorators/configuration.rb +19 -0
  18. data/lib/pact_broker/api/decorators/custom_error_problem_json_decorator.rb +1 -1
  19. data/lib/pact_broker/api/decorators/decorator_context_creator.rb +47 -2
  20. data/lib/pact_broker/api/decorators/deployed_version_decorator.rb +2 -1
  21. data/lib/pact_broker/api/decorators/deployed_versions_decorator.rb +2 -2
  22. data/lib/pact_broker/api/decorators/dry_validation_errors_decorator.rb +32 -0
  23. data/lib/pact_broker/api/decorators/dry_validation_errors_problem_json_decorator.rb +24 -0
  24. data/lib/pact_broker/api/decorators/embedded_branch_version_decorator.rb +2 -2
  25. data/lib/pact_broker/api/decorators/embedded_deployed_version_decorator.rb +30 -0
  26. data/lib/pact_broker/api/decorators/embedded_error_problem_json_decorator.rb +84 -0
  27. data/lib/pact_broker/api/decorators/embedded_released_version_decorator.rb +27 -0
  28. data/lib/pact_broker/api/decorators/embedded_version_decorator.rb +0 -3
  29. data/lib/pact_broker/api/decorators/error_decorator.rb +30 -0
  30. data/lib/pact_broker/api/decorators/extended_pact_decorator.rb +6 -1
  31. data/lib/pact_broker/api/decorators/integration_decorator.rb +3 -2
  32. data/lib/pact_broker/api/decorators/integrations_decorator.rb +3 -0
  33. data/lib/pact_broker/api/decorators/notices_decorator.rb +11 -0
  34. data/lib/pact_broker/api/decorators/pact_pacticipant_decorator.rb +1 -5
  35. data/lib/pact_broker/api/decorators/pact_versions_decorator.rb +0 -1
  36. data/lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb +0 -1
  37. data/lib/pact_broker/api/decorators/pacticipant_branches_decorator.rb +32 -0
  38. data/lib/pact_broker/api/decorators/pacticipant_decorator.rb +11 -1
  39. data/lib/pact_broker/api/decorators/{pacticipant_collection_decorator.rb → pacticipants_decorator.rb} +8 -4
  40. data/lib/pact_broker/api/decorators/pagination_links.rb +2 -2
  41. data/lib/pact_broker/api/decorators/released_versions_decorator.rb +2 -2
  42. data/lib/pact_broker/api/decorators/runtime_error_problem_json_decorator.rb +2 -2
  43. data/lib/pact_broker/api/decorators/validation_errors_decorator.rb +30 -0
  44. data/lib/pact_broker/api/decorators/validation_errors_problem_json_decorator.rb +4 -6
  45. data/lib/pact_broker/api/decorators/version_decorator.rb +5 -3
  46. data/lib/pact_broker/api/decorators/versions_decorator.rb +24 -14
  47. data/lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb +2 -0
  48. data/lib/pact_broker/api/middleware/configuration.rb +2 -0
  49. data/lib/pact_broker/api/pact_broker_urls.rb +18 -2
  50. data/lib/pact_broker/api/resources/after_reply.rb +15 -0
  51. data/lib/pact_broker/api/resources/all_webhooks.rb +3 -3
  52. data/lib/pact_broker/api/resources/badge_methods.rb +2 -1
  53. data/lib/pact_broker/api/resources/base_resource.rb +6 -4
  54. data/lib/pact_broker/api/resources/branch.rb +40 -0
  55. data/lib/pact_broker/api/resources/branch_versions.rb +59 -0
  56. data/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment_badge.rb +1 -1
  57. data/lib/pact_broker/api/resources/currently_deployed_versions_for_environment.rb +1 -1
  58. data/lib/pact_broker/api/resources/currently_supported_versions_for_environment.rb +1 -1
  59. data/lib/pact_broker/api/resources/dashboard.rb +10 -0
  60. data/lib/pact_broker/api/resources/deployed_versions_for_version_and_environment.rb +1 -1
  61. data/lib/pact_broker/api/resources/environments.rb +1 -1
  62. data/lib/pact_broker/api/resources/error_handler.rb +18 -52
  63. data/lib/pact_broker/api/resources/error_handling_methods.rb +40 -14
  64. data/lib/pact_broker/api/resources/error_response_generator.rb +23 -6
  65. data/lib/pact_broker/api/resources/event_methods.rb +15 -0
  66. data/lib/pact_broker/api/resources/filter_methods.rb +15 -0
  67. data/lib/pact_broker/api/resources/group.rb +11 -2
  68. data/lib/pact_broker/api/resources/index.rb +6 -0
  69. data/lib/pact_broker/api/resources/integrations.rb +18 -4
  70. data/lib/pact_broker/api/resources/latest_version.rb +2 -0
  71. data/lib/pact_broker/api/resources/pact.rb +11 -6
  72. data/lib/pact_broker/api/resources/pacticipant_branches.rb +67 -0
  73. data/lib/pact_broker/api/resources/pacticipants.rb +26 -7
  74. data/lib/pact_broker/api/resources/pacticipants_for_label.rb +2 -2
  75. data/lib/pact_broker/api/resources/pagination_methods.rb +11 -1
  76. data/lib/pact_broker/api/resources/verifications.rb +9 -4
  77. data/lib/pact_broker/api/resources/versions.rb +12 -0
  78. data/lib/pact_broker/api.rb +5 -0
  79. data/lib/pact_broker/app.rb +10 -4
  80. data/lib/pact_broker/application_context.rb +29 -25
  81. data/lib/pact_broker/async/after_reply.rb +30 -0
  82. data/lib/pact_broker/config/runtime_configuration.rb +9 -21
  83. data/lib/pact_broker/config/runtime_configuration_coercion_methods.rb +32 -2
  84. data/lib/pact_broker/config/runtime_configuration_database_methods.rb +1 -1
  85. data/lib/pact_broker/config/runtime_configuration_logging_methods.rb +15 -5
  86. data/lib/pact_broker/configuration.rb +29 -12
  87. data/lib/pact_broker/contracts/contracts_to_publish.rb +8 -0
  88. data/lib/pact_broker/contracts/service.rb +7 -1
  89. data/lib/pact_broker/dataset/page.rb +22 -0
  90. data/lib/pact_broker/dataset.rb +122 -0
  91. data/lib/pact_broker/db/data_migrations/set_contract_data_updated_at_for_integrations.rb +47 -0
  92. data/lib/pact_broker/db/migrate_data.rb +1 -0
  93. data/lib/pact_broker/db/models.rb +1 -1
  94. data/lib/pact_broker/deployments/currently_deployed_version_id.rb +2 -5
  95. data/lib/pact_broker/deployments/deployed_version.rb +3 -3
  96. data/lib/pact_broker/deployments/environment.rb +0 -2
  97. data/lib/pact_broker/deployments/released_version.rb +4 -5
  98. data/lib/pact_broker/doc/views/index/pacticipant-branch.markdown +25 -0
  99. data/lib/pact_broker/domain/label.rb +6 -3
  100. data/lib/pact_broker/domain/pact.rb +10 -5
  101. data/lib/pact_broker/domain/pacticipant.rb +4 -34
  102. data/lib/pact_broker/domain/tag.rb +4 -5
  103. data/lib/pact_broker/domain/verification.rb +2 -4
  104. data/lib/pact_broker/domain/version.rb +12 -19
  105. data/lib/pact_broker/errors/error_reporter.rb +30 -0
  106. data/lib/pact_broker/errors.rb +2 -15
  107. data/lib/pact_broker/events/subscriber.rb +12 -4
  108. data/lib/pact_broker/feature_toggle.rb +1 -1
  109. data/lib/pact_broker/groups/service.rb +38 -5
  110. data/lib/pact_broker/index/service.rb +1 -2
  111. data/lib/pact_broker/integrations/event_listener.rb +23 -0
  112. data/lib/pact_broker/integrations/integration.rb +24 -2
  113. data/lib/pact_broker/integrations/repository.rb +34 -1
  114. data/lib/pact_broker/integrations/service.rb +17 -18
  115. data/lib/pact_broker/labels/repository.rb +4 -8
  116. data/lib/pact_broker/locale/en.yml +5 -0
  117. data/lib/pact_broker/matrix/every_row.rb +58 -40
  118. data/lib/pact_broker/matrix/integration_row.rb +95 -0
  119. data/lib/pact_broker/matrix/integrations_repository.rb +133 -0
  120. data/lib/pact_broker/matrix/matrix_row.rb +88 -0
  121. data/lib/pact_broker/matrix/matrix_row_dataset_module.rb +185 -0
  122. data/lib/pact_broker/matrix/matrix_row_instance_methods.rb +150 -0
  123. data/lib/pact_broker/matrix/matrix_row_verification_dataset_module.rb +83 -0
  124. data/lib/pact_broker/matrix/parse_query.rb +1 -0
  125. data/lib/pact_broker/matrix/repository.rb +62 -285
  126. data/lib/pact_broker/matrix/resolved_selector.rb +13 -4
  127. data/lib/pact_broker/matrix/resolved_selector_builder.rb +84 -0
  128. data/lib/pact_broker/matrix/resolved_selectors_builder.rb +39 -0
  129. data/lib/pact_broker/matrix/row_ignorer.rb +36 -0
  130. data/lib/pact_broker/matrix/selector_ignorer.rb +59 -0
  131. data/lib/pact_broker/matrix/selector_resolver.rb +130 -0
  132. data/lib/pact_broker/metrics/service.rb +4 -9
  133. data/lib/pact_broker/pacticipants/latest_version_for_pacticipant_eager_loader.rb +33 -0
  134. data/lib/pact_broker/pacticipants/repository.rb +7 -9
  135. data/lib/pact_broker/pacticipants/service.rb +2 -2
  136. data/lib/pact_broker/pacts/latest_pact_publication_id_for_consumer_version.rb +2 -4
  137. data/lib/pact_broker/pacts/metadata.rb +3 -1
  138. data/lib/pact_broker/pacts/pact_publication.rb +23 -5
  139. data/lib/pact_broker/pacts/pact_publication_dataset_module.rb +5 -1
  140. data/lib/pact_broker/pacts/pact_version.rb +2 -3
  141. data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +2 -5
  142. data/lib/pact_broker/pacts/placeholder_pact.rb +3 -1
  143. data/lib/pact_broker/pacts/repository.rb +12 -12
  144. data/lib/pact_broker/pacts/service.rb +1 -1
  145. data/lib/pact_broker/repositories.rb +9 -1
  146. data/lib/pact_broker/string_refinements.rb +4 -0
  147. data/lib/pact_broker/tags/head_pact_tags.rb +2 -5
  148. data/lib/pact_broker/tags/repository.rb +3 -7
  149. data/lib/pact_broker/test/test_data_builder.rb +50 -1
  150. data/lib/pact_broker/ui/controllers/groups.rb +2 -1
  151. data/lib/pact_broker/ui/view_models/matrix_line.rb +4 -4
  152. data/lib/pact_broker/ui/views/groups/show.html.erb +2 -1
  153. data/lib/pact_broker/verifications/latest_verification_for_consumer_and_provider.rb +0 -3
  154. data/lib/pact_broker/verifications/latest_verification_id_for_pact_version_and_provider_version.rb +2 -4
  155. data/lib/pact_broker/verifications/repository.rb +2 -5
  156. data/lib/pact_broker/verifications/sequence.rb +1 -4
  157. data/lib/pact_broker/verifications/service.rb +4 -0
  158. data/lib/pact_broker/version.rb +1 -1
  159. data/lib/pact_broker/versions/branch.rb +2 -5
  160. data/lib/pact_broker/versions/branch_head.rb +0 -3
  161. data/lib/pact_broker/versions/branch_repository.rb +76 -0
  162. data/lib/pact_broker/versions/branch_service.rb +13 -25
  163. data/lib/pact_broker/versions/branch_version.rb +0 -3
  164. data/lib/pact_broker/versions/branch_version_repository.rb +17 -0
  165. data/lib/pact_broker/versions/repository.rb +19 -2
  166. data/lib/pact_broker/versions/sequence.rb +1 -3
  167. data/lib/pact_broker/versions/service.rb +4 -0
  168. data/lib/pact_broker/webhooks/execution.rb +3 -7
  169. data/lib/pact_broker/webhooks/job.rb +16 -7
  170. data/lib/pact_broker/webhooks/pact_and_verification_parameters.rb +2 -2
  171. data/lib/pact_broker/webhooks/repository.rb +0 -1
  172. data/lib/pact_broker/webhooks/trigger_service.rb +11 -12
  173. data/lib/pact_broker/webhooks/triggered_webhook.rb +3 -4
  174. data/lib/pact_broker/webhooks/webhook.rb +2 -2
  175. data/lib/pact_broker/webhooks/webhook_event.rb +2 -5
  176. data/lib/rack/pact_broker/add_cache_header.rb +14 -0
  177. data/lib/rack/pact_broker/application_context.rb +16 -0
  178. data/lib/rack/pact_broker/configurable_make_it_later.rb +1 -1
  179. data/lib/rack/pact_broker/invalid_uri_protection.rb +19 -3
  180. data/lib/webmachine/describe_routes.rb +55 -39
  181. data/lib/webmachine/render_error_monkey_patch.rb +13 -4
  182. data/pact_broker.gemspec +4 -4
  183. metadata +52 -29
  184. data/lib/pact_broker/api/decorators/decorator_context.rb +0 -22
  185. data/lib/pact_broker/matrix/query_builder.rb +0 -90
  186. data/lib/pact_broker/matrix/query_ids.rb +0 -40
  187. data/lib/pact_broker/matrix/quick_row.rb +0 -458
  188. data/lib/pact_broker/relationships/groupify.rb +0 -45
  189. data/lib/pact_broker/repositories/helpers.rb +0 -96
  190. data/lib/pact_broker/repositories/page.rb +0 -24
  191. data/lib/pact_broker/tags/tag_with_latest_flag.rb +0 -28
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.107.1
4
+ version: 2.108.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: 2023-05-03 00:00:00.000000000 Z
13
+ date: 2024-01-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -228,20 +228,14 @@ dependencies:
228
228
  name: sinatra
229
229
  requirement: !ruby/object:Gem::Requirement
230
230
  requirements:
231
- - - ">="
232
- - !ruby/object:Gem::Version
233
- version: 2.0.8.1
234
- - - "<"
231
+ - - "~>"
235
232
  - !ruby/object:Gem::Version
236
233
  version: '3.0'
237
234
  type: :runtime
238
235
  prerelease: false
239
236
  version_requirements: !ruby/object:Gem::Requirement
240
237
  requirements:
241
- - - ">="
242
- - !ruby/object:Gem::Version
243
- version: 2.0.8.1
244
- - - "<"
238
+ - - "~>"
245
239
  - !ruby/object:Gem::Version
246
240
  version: '3.0'
247
241
  - !ruby/object:Gem::Dependency
@@ -276,20 +270,14 @@ dependencies:
276
270
  name: rack-protection
277
271
  requirement: !ruby/object:Gem::Requirement
278
272
  requirements:
279
- - - ">="
280
- - !ruby/object:Gem::Version
281
- version: 2.0.8.1
282
- - - "<"
273
+ - - "~>"
283
274
  - !ruby/object:Gem::Version
284
275
  version: '3.0'
285
276
  type: :runtime
286
277
  prerelease: false
287
278
  version_requirements: !ruby/object:Gem::Requirement
288
279
  requirements:
289
- - - ">="
290
- - !ruby/object:Gem::Version
291
- version: 2.0.8.1
292
- - - "<"
280
+ - - "~>"
293
281
  - !ruby/object:Gem::Version
294
282
  version: '3.0'
295
283
  - !ruby/object:Gem::Dependency
@@ -585,6 +573,10 @@ files:
585
573
  - db/migrations/20230131_add_cons_ver_id_ndx_to_latest_pp_id_for_cons_ver.rb
586
574
  - db/migrations/20230216_add_branch_heads_branch_version_id_index.rb
587
575
  - db/migrations/20230428_add_index_for_webhook_executions_pact_publication_id.rb
576
+ - db/migrations/20230615_add_integrations_contract_data_updated_at.rb
577
+ - db/migrations/20230616_set_integrations_contract_data_updated_at.rb
578
+ - db/migrations/20231002_add_version_id_index_to_released_version.rb
579
+ - db/migrations/20231003_add_version_id_index_to_deployed_version.rb
588
580
  - db/migrations/migration_helper.rb
589
581
  - docs/CONFIGURATION.md
590
582
  - docs/api/PACTICIPANTS.md
@@ -617,6 +609,7 @@ files:
617
609
  - lib/pact_broker/api/contracts/pacticipant_schema.rb
618
610
  - lib/pact_broker/api/contracts/pacts_for_verification_json_query_schema.rb
619
611
  - lib/pact_broker/api/contracts/pacts_for_verification_query_string_schema.rb
612
+ - lib/pact_broker/api/contracts/pagination_query_params_schema.rb
620
613
  - lib/pact_broker/api/contracts/publish_contracts_contract_contract.rb
621
614
  - lib/pact_broker/api/contracts/publish_contracts_schema.rb
622
615
  - lib/pact_broker/api/contracts/put_pact_params_contract.rb
@@ -629,23 +622,29 @@ files:
629
622
  - lib/pact_broker/api/decorators.rb
630
623
  - lib/pact_broker/api/decorators/base_decorator.rb
631
624
  - lib/pact_broker/api/decorators/basic_pacticipant_decorator.rb
625
+ - lib/pact_broker/api/decorators/branch_decorator.rb
632
626
  - lib/pact_broker/api/decorators/branch_version_decorator.rb
633
627
  - lib/pact_broker/api/decorators/configuration.rb
634
628
  - lib/pact_broker/api/decorators/custom_error_problem_json_decorator.rb
635
629
  - lib/pact_broker/api/decorators/dashboard_decorator.rb
636
630
  - lib/pact_broker/api/decorators/dashboard_text_decorator.rb
637
- - lib/pact_broker/api/decorators/decorator_context.rb
638
631
  - lib/pact_broker/api/decorators/decorator_context_creator.rb
639
632
  - lib/pact_broker/api/decorators/deployed_version_decorator.rb
640
633
  - lib/pact_broker/api/decorators/deployed_versions_decorator.rb
634
+ - lib/pact_broker/api/decorators/dry_validation_errors_decorator.rb
635
+ - lib/pact_broker/api/decorators/dry_validation_errors_problem_json_decorator.rb
641
636
  - lib/pact_broker/api/decorators/embedded_branch_version_decorator.rb
637
+ - lib/pact_broker/api/decorators/embedded_deployed_version_decorator.rb
642
638
  - lib/pact_broker/api/decorators/embedded_environment_decorator.rb
639
+ - lib/pact_broker/api/decorators/embedded_error_problem_json_decorator.rb
643
640
  - lib/pact_broker/api/decorators/embedded_label_decorator.rb
644
641
  - lib/pact_broker/api/decorators/embedded_pacticipant_decorator.rb
642
+ - lib/pact_broker/api/decorators/embedded_released_version_decorator.rb
645
643
  - lib/pact_broker/api/decorators/embedded_tag_decorator.rb
646
644
  - lib/pact_broker/api/decorators/embedded_version_decorator.rb
647
645
  - lib/pact_broker/api/decorators/environment_decorator.rb
648
646
  - lib/pact_broker/api/decorators/environments_decorator.rb
647
+ - lib/pact_broker/api/decorators/error_decorator.rb
649
648
  - lib/pact_broker/api/decorators/extended_pact_decorator.rb
650
649
  - lib/pact_broker/api/decorators/extended_verification_decorator.rb
651
650
  - lib/pact_broker/api/decorators/format_date_time.rb
@@ -655,6 +654,7 @@ files:
655
654
  - lib/pact_broker/api/decorators/latest_pact_decorator.rb
656
655
  - lib/pact_broker/api/decorators/matrix_decorator.rb
657
656
  - lib/pact_broker/api/decorators/matrix_text_decorator.rb
657
+ - lib/pact_broker/api/decorators/notices_decorator.rb
658
658
  - lib/pact_broker/api/decorators/pact_collection_decorator.rb
659
659
  - lib/pact_broker/api/decorators/pact_decorator.rb
660
660
  - lib/pact_broker/api/decorators/pact_details_decorator.rb
@@ -662,8 +662,9 @@ files:
662
662
  - lib/pact_broker/api/decorators/pact_version_decorator.rb
663
663
  - lib/pact_broker/api/decorators/pact_versions_decorator.rb
664
664
  - lib/pact_broker/api/decorators/pact_webhooks_status_decorator.rb
665
- - lib/pact_broker/api/decorators/pacticipant_collection_decorator.rb
665
+ - lib/pact_broker/api/decorators/pacticipant_branches_decorator.rb
666
666
  - lib/pact_broker/api/decorators/pacticipant_decorator.rb
667
+ - lib/pact_broker/api/decorators/pacticipants_decorator.rb
667
668
  - lib/pact_broker/api/decorators/pacts_for_verification_query_decorator.rb
668
669
  - lib/pact_broker/api/decorators/pagination_links.rb
669
670
  - lib/pact_broker/api/decorators/provider_pacts_decorator.rb
@@ -681,6 +682,7 @@ files:
681
682
  - lib/pact_broker/api/decorators/timestamps.rb
682
683
  - lib/pact_broker/api/decorators/triggered_webhook_decorator.rb
683
684
  - lib/pact_broker/api/decorators/triggered_webhooks_decorator.rb
685
+ - lib/pact_broker/api/decorators/validation_errors_decorator.rb
684
686
  - lib/pact_broker/api/decorators/validation_errors_problem_json_decorator.rb
685
687
  - lib/pact_broker/api/decorators/verifiable_pact_decorator.rb
686
688
  - lib/pact_broker/api/decorators/verifiable_pacts_decorator.rb
@@ -700,13 +702,16 @@ files:
700
702
  - lib/pact_broker/api/renderers/html_pact_renderer.rb
701
703
  - lib/pact_broker/api/renderers/integrations_dot_renderer.rb
702
704
  - lib/pact_broker/api/resources.rb
705
+ - lib/pact_broker/api/resources/after_reply.rb
703
706
  - lib/pact_broker/api/resources/all_webhooks.rb
704
707
  - lib/pact_broker/api/resources/authentication.rb
705
708
  - lib/pact_broker/api/resources/authorization.rb
706
709
  - lib/pact_broker/api/resources/badge.rb
707
710
  - lib/pact_broker/api/resources/badge_methods.rb
708
711
  - lib/pact_broker/api/resources/base_resource.rb
712
+ - lib/pact_broker/api/resources/branch.rb
709
713
  - lib/pact_broker/api/resources/branch_version.rb
714
+ - lib/pact_broker/api/resources/branch_versions.rb
710
715
  - lib/pact_broker/api/resources/can_i_deploy.rb
711
716
  - lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment.rb
712
717
  - lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment_badge.rb
@@ -724,6 +729,8 @@ files:
724
729
  - lib/pact_broker/api/resources/error_handling_methods.rb
725
730
  - lib/pact_broker/api/resources/error_response_generator.rb
726
731
  - lib/pact_broker/api/resources/error_test.rb
732
+ - lib/pact_broker/api/resources/event_methods.rb
733
+ - lib/pact_broker/api/resources/filter_methods.rb
727
734
  - lib/pact_broker/api/resources/group.rb
728
735
  - lib/pact_broker/api/resources/index.rb
729
736
  - lib/pact_broker/api/resources/integration.rb
@@ -751,6 +758,7 @@ files:
751
758
  - lib/pact_broker/api/resources/pact_webhooks.rb
752
759
  - lib/pact_broker/api/resources/pact_webhooks_status.rb
753
760
  - lib/pact_broker/api/resources/pacticipant.rb
761
+ - lib/pact_broker/api/resources/pacticipant_branches.rb
754
762
  - lib/pact_broker/api/resources/pacticipant_resource_methods.rb
755
763
  - lib/pact_broker/api/resources/pacticipant_webhooks.rb
756
764
  - lib/pact_broker/api/resources/pacticipants.rb
@@ -776,6 +784,7 @@ files:
776
784
  - lib/pact_broker/api/resources/webhook_execution_methods.rb
777
785
  - lib/pact_broker/app.rb
778
786
  - lib/pact_broker/application_context.rb
787
+ - lib/pact_broker/async/after_reply.rb
779
788
  - lib/pact_broker/badges/service.rb
780
789
  - lib/pact_broker/build_http_options.rb
781
790
  - lib/pact_broker/certificates/certificate.rb
@@ -799,6 +808,8 @@ files:
799
808
  - lib/pact_broker/contracts/notice.rb
800
809
  - lib/pact_broker/contracts/service.rb
801
810
  - lib/pact_broker/dashboard/service.rb
811
+ - lib/pact_broker/dataset.rb
812
+ - lib/pact_broker/dataset/page.rb
802
813
  - lib/pact_broker/date_helper.rb
803
814
  - lib/pact_broker/db.rb
804
815
  - lib/pact_broker/db/clean.rb
@@ -812,6 +823,7 @@ files:
812
823
  - lib/pact_broker/db/data_migrations/migrate_webhook_headers.rb
813
824
  - lib/pact_broker/db/data_migrations/set_consumer_ids_for_pact_publications.rb
814
825
  - lib/pact_broker/db/data_migrations/set_consumer_version_order_for_pact_publications.rb
826
+ - lib/pact_broker/db/data_migrations/set_contract_data_updated_at_for_integrations.rb
815
827
  - lib/pact_broker/db/data_migrations/set_created_at_for_latest_pact_publications.rb
816
828
  - lib/pact_broker/db/data_migrations/set_created_at_for_latest_verifications.rb
817
829
  - lib/pact_broker/db/data_migrations/set_extra_columns_for_tags.rb
@@ -857,6 +869,7 @@ files:
857
869
  - lib/pact_broker/doc/views/index/latest-tagged-version.markdown
858
870
  - lib/pact_broker/doc/views/index/latest-version.markdown
859
871
  - lib/pact_broker/doc/views/index/pacticipant-branch-version.markdown
872
+ - lib/pact_broker/doc/views/index/pacticipant-branch.markdown
860
873
  - lib/pact_broker/doc/views/index/pacticipant-version-tag.markdown
861
874
  - lib/pact_broker/doc/views/index/pacticipant-version.markdown
862
875
  - lib/pact_broker/doc/views/index/pacticipants.markdown
@@ -905,6 +918,7 @@ files:
905
918
  - lib/pact_broker/error.rb
906
919
  - lib/pact_broker/errors.rb
907
920
  - lib/pact_broker/errors/error_logger.rb
921
+ - lib/pact_broker/errors/error_reporter.rb
908
922
  - lib/pact_broker/events/event.rb
909
923
  - lib/pact_broker/events/publisher.rb
910
924
  - lib/pact_broker/events/subscriber.rb
@@ -914,6 +928,7 @@ files:
914
928
  - lib/pact_broker/index/page.rb
915
929
  - lib/pact_broker/index/service.rb
916
930
  - lib/pact_broker/initializers/database_connection.rb
931
+ - lib/pact_broker/integrations/event_listener.rb
917
932
  - lib/pact_broker/integrations/integration.rb
918
933
  - lib/pact_broker/integrations/repository.rb
919
934
  - lib/pact_broker/integrations/service.rb
@@ -926,22 +941,31 @@ files:
926
941
  - lib/pact_broker/matrix/deployment_status_summary.rb
927
942
  - lib/pact_broker/matrix/every_row.rb
928
943
  - lib/pact_broker/matrix/integration.rb
944
+ - lib/pact_broker/matrix/integration_row.rb
945
+ - lib/pact_broker/matrix/integrations_repository.rb
946
+ - lib/pact_broker/matrix/matrix_row.rb
947
+ - lib/pact_broker/matrix/matrix_row_dataset_module.rb
948
+ - lib/pact_broker/matrix/matrix_row_instance_methods.rb
949
+ - lib/pact_broker/matrix/matrix_row_verification_dataset_module.rb
929
950
  - lib/pact_broker/matrix/parse_can_i_deploy_query.rb
930
951
  - lib/pact_broker/matrix/parse_query.rb
931
- - lib/pact_broker/matrix/query_builder.rb
932
- - lib/pact_broker/matrix/query_ids.rb
933
952
  - lib/pact_broker/matrix/query_results.rb
934
953
  - lib/pact_broker/matrix/query_results_with_deployment_status_summary.rb
935
- - lib/pact_broker/matrix/quick_row.rb
936
954
  - lib/pact_broker/matrix/reason.rb
937
955
  - lib/pact_broker/matrix/repository.rb
938
956
  - lib/pact_broker/matrix/resolved_selector.rb
957
+ - lib/pact_broker/matrix/resolved_selector_builder.rb
958
+ - lib/pact_broker/matrix/resolved_selectors_builder.rb
959
+ - lib/pact_broker/matrix/row_ignorer.rb
960
+ - lib/pact_broker/matrix/selector_ignorer.rb
961
+ - lib/pact_broker/matrix/selector_resolver.rb
939
962
  - lib/pact_broker/matrix/service.rb
940
963
  - lib/pact_broker/matrix/unresolved_selector.rb
941
964
  - lib/pact_broker/messages.rb
942
965
  - lib/pact_broker/metrics/service.rb
943
966
  - lib/pact_broker/pacticipants/find_potential_duplicate_pacticipant_names.rb
944
967
  - lib/pact_broker/pacticipants/generate_display_name.rb
968
+ - lib/pact_broker/pacticipants/latest_version_for_pacticipant_eager_loader.rb
945
969
  - lib/pact_broker/pacticipants/repository.rb
946
970
  - lib/pact_broker/pacticipants/service.rb
947
971
  - lib/pact_broker/pacts/build_verifiable_pact_notices.rb
@@ -979,10 +1003,7 @@ files:
979
1003
  - lib/pact_broker/pacts/verifiable_pact_messages.rb
980
1004
  - lib/pact_broker/policies.rb
981
1005
  - lib/pact_broker/project_root.rb
982
- - lib/pact_broker/relationships/groupify.rb
983
1006
  - lib/pact_broker/repositories.rb
984
- - lib/pact_broker/repositories/helpers.rb
985
- - lib/pact_broker/repositories/page.rb
986
1007
  - lib/pact_broker/repositories/scopes.rb
987
1008
  - lib/pact_broker/services.rb
988
1009
  - lib/pact_broker/string_refinements.rb
@@ -990,7 +1011,6 @@ files:
990
1011
  - lib/pact_broker/tags/head_pact_tags.rb
991
1012
  - lib/pact_broker/tags/repository.rb
992
1013
  - lib/pact_broker/tags/service.rb
993
- - lib/pact_broker/tags/tag_with_latest_flag.rb
994
1014
  - lib/pact_broker/tasks.rb
995
1015
  - lib/pact_broker/tasks/clean_task.rb
996
1016
  - lib/pact_broker/tasks/data_migration_task.rb
@@ -1051,6 +1071,7 @@ files:
1051
1071
  - lib/pact_broker/versions/abbreviate_number.rb
1052
1072
  - lib/pact_broker/versions/branch.rb
1053
1073
  - lib/pact_broker/versions/branch_head.rb
1074
+ - lib/pact_broker/versions/branch_repository.rb
1054
1075
  - lib/pact_broker/versions/branch_service.rb
1055
1076
  - lib/pact_broker/versions/branch_version.rb
1056
1077
  - lib/pact_broker/versions/branch_version_repository.rb
@@ -1086,8 +1107,10 @@ files:
1086
1107
  - lib/pact_broker/webmachine.rb
1087
1108
  - lib/rack/hal_browser.rb
1088
1109
  - lib/rack/hal_browser/redirect.rb
1110
+ - lib/rack/pact_broker/add_cache_header.rb
1089
1111
  - lib/rack/pact_broker/add_pact_broker_version_header.rb
1090
1112
  - lib/rack/pact_broker/add_vary_header.rb
1113
+ - lib/rack/pact_broker/application_context.rb
1091
1114
  - lib/rack/pact_broker/cascade.rb
1092
1115
  - lib/rack/pact_broker/configurable_make_it_later.rb
1093
1116
  - lib/rack/pact_broker/convert_file_extension_to_accept_header.rb
@@ -1230,14 +1253,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
1230
1253
  requirements:
1231
1254
  - - ">="
1232
1255
  - !ruby/object:Gem::Version
1233
- version: 2.2.0
1256
+ version: 2.7.0
1234
1257
  required_rubygems_version: !ruby/object:Gem::Requirement
1235
1258
  requirements:
1236
1259
  - - ">="
1237
1260
  - !ruby/object:Gem::Version
1238
1261
  version: '0'
1239
1262
  requirements: []
1240
- rubygems_version: 3.4.12
1263
+ rubygems_version: 3.5.4
1241
1264
  signing_key:
1242
1265
  specification_version: 4
1243
1266
  summary: See description
@@ -1,22 +0,0 @@
1
- module PactBroker
2
- module Api
3
- module Decorators
4
- class DecoratorContext < Hash
5
- attr_reader :base_url, :resource_url, :resource_title, :env, :query_string
6
-
7
- def initialize base_url, resource_url, env, options = {}
8
- @base_url = self[:base_url] = base_url
9
- @resource_url = self[:resource_url] = resource_url
10
- @resource_title = self[:resource_title] = options[:resource_title]
11
- @env = self[:env] = env
12
- @query_string = self[:query_string] = (env["QUERY_STRING"] && !env["QUERY_STRING"].empty? ? env["QUERY_STRING"] : nil)
13
- merge!(options)
14
- end
15
-
16
- def to_s
17
- "DecoratorContext #{super}"
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,90 +0,0 @@
1
- module PactBroker
2
- module Matrix
3
- class QueryBuilder
4
- def self.provider_or_provider_version_matches(query_ids, provider_version_qualifier = nil, provider_qualifier = nil)
5
- Sequel.|(*provider_or_provider_version_criteria(query_ids, provider_version_qualifier, provider_qualifier))
6
- end
7
-
8
- def self.provider_matches(query_ids, qualifier)
9
- {
10
- qualify(qualifier, :provider_id) => query_ids.pacticipant_ids,
11
- }
12
- end
13
-
14
- def self.provider_or_provider_version_matches_or_pact_unverified(query_ids, provider_version_qualifier = nil, provider_qualifier = nil)
15
- ors = provider_or_provider_version_criteria(query_ids, provider_version_qualifier, provider_qualifier)
16
-
17
- # If we have specified any versions, then we need to add an
18
- # "OR (provider matches these IDs and provider version is null)"
19
- # so that we get a line with blank verification details.
20
- if query_ids.pacticipant_version_ids.any?
21
- ors << {
22
- qualify(provider_qualifier, :provider_id) => query_ids.all_pacticipant_ids,
23
- qualify(provider_version_qualifier, :provider_version_id) => nil
24
- }
25
- end
26
-
27
- Sequel.|(*ors)
28
- end
29
-
30
- def self.provider_or_provider_version_criteria(query_ids, provider_version_qualifier = nil, provider_qualifier = nil)
31
- ors = []
32
- ors << { qualify(provider_version_qualifier, :provider_version_id) => query_ids.pacticipant_version_ids } if query_ids.pacticipant_version_ids.any?
33
- ors << { qualify(provider_qualifier, :provider_id) => query_ids.pacticipant_ids } if query_ids.pacticipant_ids.any?
34
- ors
35
- end
36
-
37
- def self.consumer_in_pacticipant_ids(query_ids)
38
- { consumer_id: query_ids.all_pacticipant_ids }
39
- end
40
-
41
- def self.consumer_or_consumer_version_matches(query_ids, qualifier)
42
- ors = []
43
- ors << { qualify(qualifier, :consumer_version_id) => query_ids.pacticipant_version_ids } if query_ids.pacticipant_version_ids.any?
44
- ors << { qualify(qualifier, :consumer_id) => query_ids.pacticipant_ids } if query_ids.pacticipant_ids.any?
45
-
46
- Sequel.|(*ors)
47
- end
48
-
49
- # Some selecters are specified in the query, others are implied (when only one pacticipant is specified,
50
- # the integrations are automatically worked out, and the selectors for these are of type :implied )
51
- # When there are 3 pacticipants that each have dependencies on each other (A->B, A->C, B->C), the query
52
- # to deploy C (implied A, implied B, specified C) was returning the A->B row because it matched the
53
- # implied selectors as well.
54
- # This extra filter makes sure that every row that is returned actually matches one of the specified
55
- # selectors.
56
- def self.either_consumer_or_provider_was_specified_in_query(query_ids, qualifier = nil)
57
- Sequel.|({
58
- qualify(qualifier, :consumer_id) => query_ids.specified_pacticipant_ids
59
- } , {
60
- qualify(qualifier, :provider_id) => query_ids.specified_pacticipant_ids
61
- })
62
- end
63
-
64
- # QueryIds is built from a single selector, so there is only one pacticipant_id or pacticipant_version_id
65
- def self.consumer_or_consumer_version_or_provider_or_provider_or_provider_version_match(query_ids, pacts_qualifier = :p, verifications_qualifier = :v)
66
- ors = if query_ids.pacticipant_version_id
67
- [
68
- { Sequel[pacts_qualifier][:consumer_version_id] => query_ids.pacticipant_version_id },
69
- { Sequel[verifications_qualifier][:provider_version_id] => query_ids.pacticipant_version_id }
70
- ]
71
- else
72
- [
73
- { Sequel[pacts_qualifier][:consumer_id] => query_ids.pacticipant_id },
74
- { Sequel[pacts_qualifier][:provider_id] => query_ids.pacticipant_id }
75
- ]
76
- end
77
-
78
- Sequel.|(*ors)
79
- end
80
-
81
- def self.qualify(qualifier, column)
82
- if qualifier
83
- Sequel[qualifier][column]
84
- else
85
- column
86
- end
87
- end
88
- end
89
- end
90
- end
@@ -1,40 +0,0 @@
1
- module PactBroker
2
- module Matrix
3
- class QueryIds
4
- attr_reader :all_pacticipant_ids, :specified_pacticipant_ids, :pacticipant_ids, :pacticipant_version_ids
5
-
6
- # pacticipant_version_ids - the pacticipant version ids from the selectors where the pacticipant version id is the most specific criterion
7
- # pacticipant_ids - the pacticipant ids from the selectors where the pacticipant id is the most specific criterion
8
- # all_pacticipant_ids - the pacticipant ids from all the selectors, regardless of whether or not a pacticipant version has also been specified
9
- # specified_pacticipant_ids the IDs of the pacticipants that were specified in the can-i-deploy query
10
- def initialize(all_pacticipant_ids, specified_pacticipant_ids, pacticipant_ids, pacticipant_version_ids)
11
- @all_pacticipant_ids = all_pacticipant_ids
12
- @specified_pacticipant_ids = specified_pacticipant_ids
13
- @pacticipant_ids = pacticipant_ids
14
- @pacticipant_version_ids = pacticipant_version_ids
15
- @all_pacticipant_ids = all_pacticipant_ids
16
- end
17
-
18
- def self.from_selectors(selectors)
19
- most_specific_criteria = selectors.collect(&:most_specific_criterion)
20
- all_pacticipant_ids = selectors.collect(&:pacticipant_id).uniq
21
- specified_pacticipant_ids = selectors.select(&:specified?).collect(&:pacticipant_id).uniq
22
- pacticipant_version_ids = collect_ids(most_specific_criteria, :pacticipant_version_id).uniq
23
- pacticipant_ids = collect_ids(most_specific_criteria, :pacticipant_id).uniq
24
- QueryIds.new(all_pacticipant_ids, specified_pacticipant_ids, pacticipant_ids, pacticipant_version_ids)
25
- end
26
-
27
- def self.collect_ids(hashes, key)
28
- hashes.collect{ |s| s[key] }.flatten.compact
29
- end
30
-
31
- def pacticipant_id
32
- pacticipant_ids.first
33
- end
34
-
35
- def pacticipant_version_id
36
- pacticipant_version_ids.first
37
- end
38
- end
39
- end
40
- end