pact_broker 2.38.1 → 2.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE.md +2 -2
  3. data/CHANGELOG.md +45 -0
  4. data/DEVELOPER_DOCUMENTATION.md +9 -0
  5. data/Dockerfile +2 -0
  6. data/Gemfile +1 -1
  7. data/README.md +10 -3
  8. data/config/database.yml +10 -2
  9. data/docs/images/Pactflow logo - black small.png +0 -0
  10. data/lib/pact_broker/api.rb +5 -2
  11. data/lib/pact_broker/api/contracts/verifiable_pacts_query_schema.rb +41 -0
  12. data/lib/pact_broker/api/decorators/dashboard_decorator.rb +1 -1
  13. data/lib/pact_broker/api/decorators/dashboard_text_decorator.rb +1 -1
  14. data/lib/pact_broker/api/decorators/integration_decorator.rb +2 -0
  15. data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +34 -0
  16. data/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator.rb +27 -0
  17. data/lib/pact_broker/api/resources/badge.rb +4 -4
  18. data/lib/pact_broker/api/resources/can_i_deploy.rb +41 -0
  19. data/lib/pact_broker/api/resources/dashboard.rb +1 -1
  20. data/lib/pact_broker/api/resources/index.rb +15 -4
  21. data/lib/pact_broker/api/resources/latest_pact.rb +10 -4
  22. data/lib/pact_broker/api/resources/latest_verification_for_latest_pact.rb +19 -0
  23. data/lib/pact_broker/api/resources/pact.rb +5 -4
  24. data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +54 -0
  25. data/lib/pact_broker/api/resources/verification.rb +6 -1
  26. data/lib/pact_broker/badges/service.rb +11 -11
  27. data/lib/pact_broker/db/clean.rb +72 -12
  28. data/lib/pact_broker/doc/controllers/app.rb +3 -1
  29. data/lib/pact_broker/doc/views/can-i-deploy.markdown +14 -0
  30. data/lib/pact_broker/doc/views/index/pacticipant-version-tag.markdown +8 -0
  31. data/lib/pact_broker/doc/views/integrations.markdown +1 -1
  32. data/lib/pact_broker/doc/views/matrix.markdown +7 -0
  33. data/lib/pact_broker/doc/views/metrics.markdown +5 -0
  34. data/lib/pact_broker/domain/index_item.rb +3 -3
  35. data/lib/pact_broker/domain/pact.rb +28 -1
  36. data/lib/pact_broker/index/service.rb +38 -20
  37. data/lib/pact_broker/integrations/integration.rb +16 -0
  38. data/lib/pact_broker/integrations/service.rb +15 -1
  39. data/lib/pact_broker/matrix/can_i_deploy_query_schema.rb +25 -0
  40. data/lib/pact_broker/matrix/parse_can_i_deploy_query.rb +29 -0
  41. data/lib/pact_broker/matrix/quick_row.rb +255 -0
  42. data/lib/pact_broker/matrix/repository.rb +5 -17
  43. data/lib/pact_broker/matrix/row.rb +0 -1
  44. data/lib/pact_broker/metrics/service.rb +36 -2
  45. data/lib/pact_broker/pacts/all_pact_publications.rb +3 -2
  46. data/lib/pact_broker/pacts/head_pact.rb +30 -0
  47. data/lib/pact_broker/pacts/latest_pact_publications.rb +8 -1
  48. data/lib/pact_broker/pacts/latest_tagged_pact_publications.rb +5 -1
  49. data/lib/pact_broker/pacts/pact_publication.rb +2 -1
  50. data/lib/pact_broker/pacts/pact_version.rb +20 -0
  51. data/lib/pact_broker/pacts/repository.rb +33 -4
  52. data/lib/pact_broker/pacts/service.rb +15 -2
  53. data/lib/pact_broker/pacts/squash_pacts_for_verification.rb +37 -0
  54. data/lib/pact_broker/pacts/verifiable_pact.rb +30 -0
  55. data/lib/pact_broker/pacts/verifiable_pact_messages.rb +75 -0
  56. data/lib/pact_broker/test/test_data_builder.rb +30 -2
  57. data/lib/pact_broker/ui/view_models/index_item.rb +4 -4
  58. data/lib/pact_broker/ui/view_models/matrix_line.rb +1 -1
  59. data/lib/pact_broker/ui/views/index/show-with-tags.haml +1 -1
  60. data/lib/pact_broker/ui/views/index/show.haml +1 -1
  61. data/lib/pact_broker/ui/views/matrix/show.haml +2 -2
  62. data/lib/pact_broker/verifications/{verification_status.rb → pseudo_branch_status.rb} +10 -4
  63. data/lib/pact_broker/version.rb +1 -1
  64. data/script/docker/mysql-db-start.sh +10 -0
  65. data/spec/features/can_i_deploy_spec.rb +31 -0
  66. data/spec/features/get_latest_verification_for_pact_spec.rb +17 -0
  67. data/spec/features/get_provider_pacts_for_verification_spec.rb +39 -0
  68. data/spec/features/metrics_spec.rb +1 -1
  69. data/spec/features/pending_pacts_spec.rb +109 -0
  70. data/spec/integration/ui/matrix_spec.rb +30 -0
  71. data/spec/lib/pact_broker/api/contracts/verifiable_pacts_query_schema_spec.rb +62 -0
  72. data/spec/lib/pact_broker/api/decorators/dashboard_decorator_spec.rb +1 -1
  73. data/spec/lib/pact_broker/api/decorators/integration_decorator_spec.rb +5 -1
  74. data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +30 -5
  75. data/spec/lib/pact_broker/api/decorators/verifiable_pacts_query_decorator_spec.rb +46 -0
  76. data/spec/lib/pact_broker/api/resources/badge_spec.rb +3 -3
  77. data/spec/lib/pact_broker/api/resources/provider_pacts_for_verification_spec.rb +35 -0
  78. data/spec/lib/pact_broker/api/resources/verification_spec.rb +18 -0
  79. data/spec/lib/pact_broker/badges/service_spec.rb +18 -18
  80. data/spec/lib/pact_broker/db/clean_spec.rb +69 -8
  81. data/spec/lib/pact_broker/doc/coverage_spec.rb +8 -2
  82. data/spec/lib/pact_broker/index/service_spec.rb +28 -14
  83. data/spec/lib/pact_broker/integrations/integration_spec.rb +60 -0
  84. data/spec/lib/pact_broker/integrations/service_spec.rb +27 -0
  85. data/spec/lib/pact_broker/matrix/quick_row_spec.rb +31 -0
  86. data/spec/lib/pact_broker/matrix/repository_spec.rb +8 -8
  87. data/spec/lib/pact_broker/matrix/service_spec.rb +4 -4
  88. data/spec/lib/pact_broker/metrics/service_spec.rb +56 -0
  89. data/spec/lib/pact_broker/pacts/pact_version_spec.rb +69 -0
  90. data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +65 -0
  91. data/spec/lib/pact_broker/pacts/repository_find_wip_pact_versions_for_provider_spec.rb +54 -24
  92. data/spec/lib/pact_broker/pacts/service_find_for_verification_spec.rb +51 -0
  93. data/spec/lib/pact_broker/pacts/squash_pacts_for_verification_spec.rb +92 -0
  94. data/spec/lib/pact_broker/pacts/verifiable_pact_messages_spec.rb +93 -0
  95. data/spec/lib/pact_broker/pacts/verifiable_pact_spec.rb +0 -0
  96. data/spec/lib/pact_broker/ui/view_models/index_item_spec.rb +10 -10
  97. data/spec/lib/pact_broker/verifications/{verification_status_spec.rb → pseudo_branch_status_spec.rb} +4 -4
  98. data/spec/support/shared_examples_for_responses.rb +7 -1
  99. metadata +56 -13
  100. data/lib/pact_broker/api/resources/pending_provider_pacts.rb +0 -21
  101. data/spec/features/get_pacts_to_verify_spec.rb +0 -41
  102. data/spec/features/get_wip_provider_pacts_spec.rb +0 -26
  103. data/spec/lib/pact_broker/api/resources/pending_provider_pacts_spec.rb +0 -34
@@ -1,34 +0,0 @@
1
- require 'pact_broker/api/resources/latest_provider_pacts'
2
-
3
- module PactBroker
4
- module Api
5
- module Resources
6
- describe PendingProviderPacts do
7
- before do
8
- allow(PactBroker::Pacts::Service).to receive(:find_pending_pact_versions_for_provider).and_return(pacts)
9
- allow(PactBroker::Api::Decorators::ProviderPactsDecorator).to receive(:new).and_return(decorator)
10
- allow_any_instance_of(PendingProviderPacts).to receive(:resource_exists?).and_return(provider)
11
- end
12
-
13
- let(:provider) { double('provider') }
14
- let(:pacts) { double('pacts') }
15
- let(:path) { '/pacts/provider/Bar/pending' }
16
- let(:decorator) { instance_double('PactBroker::Api::Decorators::ProviderPactsDecorator') }
17
-
18
- subject { get path; last_response }
19
-
20
- it "finds the pending pacts for the provider" do
21
- expect(PactBroker::Pacts::Service).to receive(:find_pending_pact_versions_for_provider).with("Bar")
22
- subject
23
- end
24
-
25
- it "sets the correct resource title" do
26
- expect(decorator).to receive(:to_json) do | options |
27
- expect(options[:user_options][:title]).to eq "Pending pact versions for the provider Bar"
28
- end
29
- subject
30
- end
31
- end
32
- end
33
- end
34
- end