pact_broker 2.52.2 → 2.53.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +2 -4
  4. data/lib/pact_broker/api.rb +8 -0
  5. data/lib/pact_broker/api/decorators/decorator_context.rb +6 -11
  6. data/lib/pact_broker/api/decorators/webhook_execution_result_decorator.rb +6 -1
  7. data/lib/pact_broker/api/pact_broker_urls.rb +4 -0
  8. data/lib/pact_broker/api/resources/badge.rb +6 -2
  9. data/lib/pact_broker/api/resources/base_resource.rb +3 -3
  10. data/lib/pact_broker/api/resources/matrix_badge.rb +5 -0
  11. data/lib/pact_broker/api/resources/pact.rb +0 -16
  12. data/lib/pact_broker/api/resources/pacticipant.rb +0 -4
  13. data/lib/pact_broker/api/resources/verifications.rb +0 -4
  14. data/lib/pact_broker/badges/service.rb +16 -13
  15. data/lib/pact_broker/locale/en.yml +1 -1
  16. data/lib/pact_broker/matrix/unresolved_selector.rb +4 -0
  17. data/lib/pact_broker/pacticipants/repository.rb +6 -0
  18. data/lib/pact_broker/pacticipants/service.rb +8 -0
  19. data/lib/pact_broker/pacts/repository.rb +3 -2
  20. data/lib/pact_broker/ui/controllers/base_controller.rb +3 -0
  21. data/lib/pact_broker/ui/controllers/matrix.rb +15 -1
  22. data/lib/pact_broker/ui/views/matrix/show.haml +4 -1
  23. data/lib/pact_broker/verifications/repository.rb +2 -3
  24. data/lib/pact_broker/version.rb +1 -1
  25. data/lib/pact_broker/webhooks/webhook_request_logger.rb +8 -8
  26. data/public/stylesheets/matrix.css +13 -0
  27. data/spec/features/get_matrix_badge_spec.rb +9 -0
  28. data/spec/integration/ui/matrix_spec.rb +11 -4
  29. data/spec/lib/pact_broker/api/decorators/pact_version_decorator_spec.rb +1 -1
  30. data/spec/lib/pact_broker/api/decorators/webhooks_decorator_spec.rb +1 -1
  31. data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +8 -0
  32. data/spec/lib/pact_broker/api/resources/badge_spec.rb +42 -22
  33. data/spec/lib/pact_broker/api/resources/webhook_execution_spec.rb +1 -1
  34. data/spec/lib/pact_broker/badges/service_spec.rb +15 -3
  35. data/spec/lib/pact_broker/domain/version_spec.rb +7 -7
  36. data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +18 -1
  37. data/spec/lib/pact_broker/verifications/repository_spec.rb +20 -0
  38. data/spec/lib/pact_broker/webhooks/webhook_request_logger_spec.rb +4 -1
  39. metadata +21 -22
  40. data/lib/pact_broker/verifications/all_verifications.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd447b5cac167d4f764356d1c15c826a7de019d1871c684853ef602862cf387
4
- data.tar.gz: '07328be4c8851d55e5a5834f69ce83e22df99c93cf83a21a657e1587f7afd8b3'
3
+ metadata.gz: 146cb79312c70762f13a8a49ebd8cd52e33dc11669b5f647551624cd1bbdd8c7
4
+ data.tar.gz: c8d41ae4b4dd59fa6684ecce7572ed9e31d5c96bfeadbc078d8e0eb8c2e5e4dc
5
5
  SHA512:
6
- metadata.gz: 9b8420208b660677ba8f93373346ad39e80069ba282dd9ebd7206bf65ebdf05f7803c303c1e6e0a4ebc7f69d3ff6ea2b55ecfe4e56a2735975827bad26e10370
7
- data.tar.gz: fecbcc5f5a4824d2dc3669d6bb4bb15456ad1434031dad96e71bd571e9f92fd73d1b90b142f0d0359d6943ab618768ba607f99119fa61ffb56f75f6fb8e29ef3
6
+ metadata.gz: b3d9ad57dc60c6cb6c8c4edead5b7cd10b69de4d63d4b5e355bf5cf5d0edf8f410a69601ef4a002d645c968e0b446dddc6b8a0b63ddb10aa9a51b3cc2331a398
7
+ data.tar.gz: 50c7b30d1994654117c68db4b47ef9afd6d734691da60723c27ce717ca4313facaffa1cde5c43d388c82fcf3a3a47d08813cbc942aefd7168c4125f832cff4e9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ <a name="v2.53.0"></a>
2
+ ### v2.53.0 (2020-05-12)
3
+
4
+
5
+ #### Features
6
+
7
+ * **badge**
8
+ * include tag names in matrix badge ([cce7cd01](/../../commit/cce7cd01))
9
+
10
+
11
+ #### Bug Fixes
12
+
13
+ * **pacts for verification**
14
+ * ensure a separate pact URL is returned for each consumer when multiple consumers share the same pact json content ([13e7b640](/../../commit/13e7b640))
15
+
16
+ * gracefully handle fetching matrix badge when specified pact does not exist ([e8ec4101](/../../commit/e8ec4101))
17
+ * include the base URL in the link to the webhook docs ([5363ab2e](/../../commit/5363ab2e))
18
+
19
+
1
20
  <a name="v2.52.2"></a>
2
21
  ### v2.52.2 (2020-04-16)
3
22
 
data/README.md CHANGED
@@ -64,8 +64,6 @@ If you don't have a [Pact Broker CI Nerf Gun][nerf], you'll probably want to rea
64
64
 
65
65
  #### Step 3. Back to the Consumer CI build
66
66
 
67
- The following funcationality is in beta release. Your feedback would be appreciated.
68
-
69
67
  1. The Consumer CI determines if the pact has been verified by running `pact-broker can-i-deploy --pacticipant CONSUMER_NAME --version CONSUMER_VERSION ...` (see documentation [here](https://github.com/pact-foundation/pact_broker-client#can-i-deploy))
70
68
  1. If the pact has been verified, the deployment can proceed.
71
69
 
@@ -123,8 +121,8 @@ Use the HAL browser to view documentation as you browse.
123
121
  * unix users just use your package manager
124
122
  * Run `git clone git@github.com:pact-foundation/pact_broker.git && cd pact_broker/example`
125
123
  * Run `bundle install`
126
- * Run `bundle exec rackup -p 8080` (this will use a Sqlite database. If you want to try it out with a Postgres database, see the [README](https://github.com/pact-foundation/pact_broker/tree/master/example) in the example directory.)
127
- * Open [http://localhost:8080](http://localhost:8080) and you should see a list containing the pact between the Zoo App and the Animal Service.
124
+ * Run `bundle exec rackup -p 9292 -o 0.0.0.0` (this will use a Sqlite database. If you want to try it out with a Postgres database, see the [README](https://github.com/pact-foundation/pact_broker/tree/master/example) in the example directory.)
125
+ * Open [http://localhost:9292](http://localhost:9292) and you should see a list containing the pact between the Zoo App and the Animal Service.
128
126
  * Click on the arrow to see the generated HTML documentation.
129
127
  * Click on either service to see an autogenerated network diagram.
130
128
  * Click on the HAL Browser link to have a poke around the API.
@@ -3,6 +3,14 @@ require 'webmachine/rack_adapter_monkey_patch'
3
3
  require 'pact_broker/api/resources'
4
4
  require 'pact_broker/feature_toggle'
5
5
 
6
+ module Webmachine
7
+ class Request
8
+ def patch?
9
+ method == "PATCH"
10
+ end
11
+ end
12
+ end
13
+
6
14
  module PactBroker
7
15
 
8
16
  API ||= begin
@@ -1,20 +1,15 @@
1
1
  module PactBroker
2
2
  module Api
3
3
  module Decorators
4
-
5
4
  class DecoratorContext < Hash
6
5
 
7
- attr_reader :base_url, :resource_url, :resource_title
6
+ attr_reader :base_url, :resource_url, :resource_title, :env
8
7
 
9
- def initialize base_url, resource_url, options = {}
10
- @base_url = base_url
11
- self[:base_url] = base_url
12
- @resource_url = resource_url
13
- self[:resource_url] = resource_url
14
- if options[:resource_title]
15
- @resource_title = options[:resource_title]
16
- self[:resource_title] = resource_title
17
- end
8
+ def initialize base_url, resource_url, env, options = {}
9
+ @base_url = self[:base_url] = base_url
10
+ @resource_url = self[:resource_url]= resource_url
11
+ @resource_title = self[:resource_title] = options[:resource_title]
12
+ @env = self[:env] = env
18
13
  merge!(options)
19
14
  end
20
15
 
@@ -78,8 +78,13 @@ module PactBroker
78
78
  }
79
79
  end
80
80
 
81
+ def to_hash(options)
82
+ @to_hash_options = options
83
+ super
84
+ end
85
+
81
86
  def response_hidden_message
82
- PactBroker::Messages.message('messages.response_body_hidden')
87
+ PactBroker::Messages.message('messages.response_body_hidden', base_url: @to_hash_options[:user_options][:base_url])
83
88
  end
84
89
  end
85
90
  end
@@ -253,6 +253,10 @@ module PactBroker
253
253
  "/matrix/provider/#{url_encode(provider_name)}/consumer/#{url_encode(consumer_name)}"
254
254
  end
255
255
 
256
+ def matrix_badge_url_for_selectors consumer_selector, provider_selector, base_url = ''
257
+ "#{base_url}/matrix/provider/#{url_encode(provider_selector.pacticipant_name)}/latest/#{url_encode(provider_selector.tag)}/consumer/#{url_encode(consumer_selector.pacticipant_name)}/latest/#{url_encode(consumer_selector.tag)}/badge.svg"
258
+ end
259
+
256
260
  def matrix_for_pacticipant_version_url(version, base_url = '')
257
261
  query = {
258
262
  q: [{ pacticipant: version.pacticipant.name, version: version.number }],
@@ -34,12 +34,12 @@ module PactBroker
34
34
 
35
35
  def to_svg
36
36
  response.headers['Cache-Control'] = 'no-cache'
37
- comment + badge_service.pact_verification_badge(pact, label, initials, pseudo_branch_verification_status)
37
+ comment + badge_service.pact_verification_badge(pact, label, initials, pseudo_branch_verification_status, tags)
38
38
  end
39
39
 
40
40
  def moved_temporarily?
41
41
  response.headers['Cache-Control'] = 'no-cache'
42
- badge_service.pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status)
42
+ badge_service.pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status, tags)
43
43
  end
44
44
 
45
45
  private
@@ -72,6 +72,10 @@ module PactBroker
72
72
  verification_number = latest_verification ? latest_verification.number : "?"
73
73
  "<!-- #{identifier_from_path[:consumer_name]} version #{consumer_version_number} revision #{pact_revision} #{identifier_from_path[:provider_name]} version #{provider_version_number} number #{verification_number} -->\n"
74
74
  end
75
+
76
+ def tags
77
+ {}
78
+ end
75
79
  end
76
80
  end
77
81
  end
@@ -33,8 +33,8 @@ module PactBroker
33
33
  { 'Access-Control-Allow-Methods' => allowed_methods.join(", ")}
34
34
  end
35
35
 
36
- def update_matrix_after_request?
37
- false
36
+ def known_methods
37
+ super + ['PATCH']
38
38
  end
39
39
 
40
40
  def finish_request
@@ -76,7 +76,7 @@ module PactBroker
76
76
  end
77
77
 
78
78
  def decorator_context options = {}
79
- Decorators::DecoratorContext.new(base_url, resource_url, options)
79
+ Decorators::DecoratorContext.new(base_url, resource_url, request.env, options)
80
80
  end
81
81
 
82
82
  def handle_exception e
@@ -7,7 +7,12 @@ module PactBroker
7
7
 
8
8
  private
9
9
 
10
+ def tags
11
+ { consumer_tag: identifier_from_path[:tag], provider_tag: identifier_from_path[:provider_tag] }
12
+ end
13
+
10
14
  def latest_verification
15
+ return nil unless pact
11
16
  @latest_verification ||= verification_service.find_latest_verification_for_tags(
12
17
  identifier_from_path[:consumer_name],
13
18
  identifier_from_path[:provider_name],
@@ -9,14 +9,6 @@ require 'pact_broker/api/contracts/put_pact_params_contract'
9
9
  require 'pact_broker/webhooks/execution_configuration'
10
10
  require 'pact_broker/api/resources/webhook_execution_methods'
11
11
 
12
- module Webmachine
13
- class Request
14
- def patch?
15
- method == "PATCH"
16
- end
17
- end
18
- end
19
-
20
12
  module PactBroker
21
13
  module Api
22
14
  module Resources
@@ -41,10 +33,6 @@ module PactBroker
41
33
  ["GET", "PUT", "DELETE", "PATCH", "OPTIONS"]
42
34
  end
43
35
 
44
- def known_methods
45
- super + ['PATCH']
46
- end
47
-
48
36
  def is_conflict?
49
37
  merge_conflict = request.patch? && resource_exists? &&
50
38
  Pacts::Merger.conflict?(pact.json_content, pact_params.json_content)
@@ -110,10 +98,6 @@ module PactBroker
110
98
  @pact_params ||= PactBroker::Pacts::PactParams.from_request request, path_info
111
99
  end
112
100
 
113
- def update_matrix_after_request?
114
- request.put? || request.patch?
115
- end
116
-
117
101
  def set_post_deletion_response
118
102
  latest_pact = pact_service.find_latest_pact(pact_params)
119
103
  response_body = { "_links" => {} }
@@ -62,10 +62,6 @@ module PactBroker
62
62
  def pacticipant_name
63
63
  identifier_from_path[:pacticipant_name]
64
64
  end
65
-
66
- def update_matrix_after_request?
67
- request.patch?
68
- end
69
65
  end
70
66
  end
71
67
  end
@@ -67,10 +67,6 @@ module PactBroker
67
67
  PactBroker::Api::Decorators::VerificationDecorator.new(model)
68
68
  end
69
69
 
70
- def update_matrix_after_request?
71
- request.post?
72
- end
73
-
74
70
  def metadata
75
71
  PactBrokerUrls.decode_webhook_metadata(identifier_from_path[:metadata])
76
72
  end
@@ -19,14 +19,14 @@ module PactBroker
19
19
  PactBroker.configuration.badge_provider_mode == :redirect && !!PactBroker.configuration.shields_io_base_url
20
20
  end
21
21
 
22
- def pact_verification_badge pact, label, initials, pseudo_branch_verification_status
22
+ def pact_verification_badge pact, label, initials, pseudo_branch_verification_status, metadata = {}
23
23
  return static_svg(pact, pseudo_branch_verification_status) unless pact
24
24
 
25
- dynamic_svg(pact, label, initials, pseudo_branch_verification_status) || static_svg(pact, pseudo_branch_verification_status)
25
+ dynamic_svg(pact, label, initials, pseudo_branch_verification_status, metadata) || static_svg(pact, pseudo_branch_verification_status)
26
26
  end
27
27
 
28
- def pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status)
29
- title = badge_title(pact, label, initials)
28
+ def pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status, metadata = {})
29
+ title = badge_title(pact, label, initials, metadata)
30
30
  status = badge_status(pseudo_branch_verification_status)
31
31
  color = badge_color(pseudo_branch_verification_status)
32
32
  build_shield_io_uri(title, status, color)
@@ -38,23 +38,26 @@ module PactBroker
38
38
 
39
39
  private
40
40
 
41
- def badge_title pact, label, initials
41
+ def badge_title pact, label, initials, metadata
42
42
  return 'pact not found' if pact.nil?
43
+ consumer_name = prepare_name(pact.consumer_name, initials, metadata[:consumer_tag])
44
+ provider_name = prepare_name(pact.provider_name, initials, metadata[:provider_tag])
43
45
  title = case (label || '').downcase
44
- when 'consumer' then prepare_name(pact.consumer_name, initials)
45
- when 'provider' then prepare_name(pact.provider_name, initials)
46
- else "#{prepare_name(pact.consumer_name, initials)}%2F#{prepare_name(pact.provider_name, initials)}"
46
+ when 'consumer' then consumer_name
47
+ when 'provider' then provider_name
48
+ else "#{consumer_name}%2F#{provider_name}"
47
49
  end
48
50
  "#{title} pact".downcase
49
51
  end
50
52
 
51
- def prepare_name name, initials
53
+ def prepare_name name, initials, tag = nil
54
+ tag_suffix = tag ? " (#{tag})" : ''
52
55
  if initials
53
56
  parts = split_space_dash_underscore(name)
54
57
  parts = split_camel_case(name) if parts.size == 1
55
- return parts.collect{ |p| p[0] }.join.downcase if parts.size > 1
58
+ return parts.collect{ |p| p[0] }.join.downcase + tag_suffix if parts.size > 1
56
59
  end
57
- name.downcase
60
+ name.downcase + tag_suffix
58
61
  end
59
62
 
60
63
  def split_space_dash_underscore name
@@ -86,9 +89,9 @@ module PactBroker
86
89
  end
87
90
  end
88
91
 
89
- def dynamic_svg pact, label, initials, pseudo_branch_verification_status
92
+ def dynamic_svg pact, label, initials, pseudo_branch_verification_status, metadata
90
93
  return nil unless PactBroker.configuration.shields_io_base_url
91
- uri = pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status)
94
+ uri = pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status, metadata)
92
95
  begin
93
96
  response = do_request(uri)
94
97
  response.code == '200' ? response.body : nil
@@ -12,7 +12,7 @@ en:
12
12
 
13
13
  pact_broker:
14
14
  messages:
15
- response_body_hidden: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See /doc/webhooks#whitelist for more information.
15
+ response_body_hidden: For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property. See %{base_url}/doc/webhooks#whitelist for more information.
16
16
  matrix:
17
17
  pre_verified: This pact was "pre-verified" as it has identical content to a previously verified pact.
18
18
  webhooks:
@@ -48,6 +48,10 @@ module PactBroker
48
48
  def max_age
49
49
  self[:max_age]
50
50
  end
51
+
52
+ def latest_for_pacticipant_and_tag?
53
+ !!(pacticipant_name && tag && latest)
54
+ end
51
55
  end
52
56
  end
53
57
  end
@@ -15,6 +15,12 @@ module PactBroker
15
15
  pacticipants.first
16
16
  end
17
17
 
18
+ def find_by_name! name
19
+ pacticipant = find_by_name(name)
20
+ raise PactBroker::Error, "No pacticipant found with name '#{name}'" unless pacticipant
21
+ pacticipant
22
+ end
23
+
18
24
  def find_by_id id
19
25
  PactBroker::Domain::Pacticipant.where(id: id).single_record
20
26
  end
@@ -40,6 +40,14 @@ module PactBroker
40
40
  pacticipant_repository.find_by_name(name)
41
41
  end
42
42
 
43
+ def self.find_pacticipant_by_name! name
44
+ pacticipant_repository.find_by_name!(name)
45
+ end
46
+
47
+ def self.find_by_id id
48
+ pacticipant_repository.find_by_id(id)
49
+ end
50
+
43
51
  def self.find options
44
52
  pacticipant_repository.find options
45
53
  end
@@ -202,6 +202,7 @@ module PactBroker
202
202
  .all
203
203
 
204
204
  wip_pacts.collect do | pact|
205
+
205
206
  pending_tag_names = find_provider_tags_for_which_pact_publication_id_is_pending(pact, successfully_verified_head_pact_publication_ids_for_each_provider_tag)
206
207
  pre_existing_tag_names = find_provider_tag_names_that_were_first_used_before_pact_published(pact, provider_tag_collection)
207
208
 
@@ -356,12 +357,11 @@ module PactBroker
356
357
  selected_pacts = selected_pacts + find_pacts_for_fallback_tags(selected_pacts, provider_name, consumer_version_selectors)
357
358
 
358
359
  selected_pacts
359
- .group_by(&:pact_version_sha)
360
+ .group_by{ |p| [p.consumer_name, p.pact_version_sha] }
360
361
  .values
361
362
  .collect do | selected_pacts_for_pact_version_id |
362
363
  SelectedPact.merge(selected_pacts_for_pact_version_id)
363
364
  end
364
-
365
365
  end
366
366
 
367
367
  private
@@ -562,6 +562,7 @@ module PactBroker
562
562
  .join(:verifications, verifications_join)
563
563
  .join(:tags, tags_join, { table_alias: :provider_tags } )
564
564
  .where(Sequel[:latest_tagged_pact_publications][:provider_id] => provider_id)
565
+ .distinct
565
566
  .all
566
567
  hash[provider_tag] = head_pacts
567
568
  end
@@ -11,6 +11,9 @@ module PactBroker
11
11
  set :show_exceptions, ENV['RACK_ENV'] != 'production'
12
12
  set :dump_errors, false # The padrino logger logs these for us. If this is enabled we get duplicate logging.
13
13
 
14
+ def base_url
15
+ PactBroker.configuration.base_url || request.base_url
16
+ end
14
17
  end
15
18
  end
16
19
  end
@@ -3,6 +3,8 @@ require 'pact_broker/ui/view_models/matrix_lines'
3
3
  require 'pact_broker/matrix/unresolved_selector'
4
4
  require 'pact_broker/matrix/parse_query'
5
5
  require 'pact_broker/logging'
6
+ require 'pact_broker/api/pact_broker_urls'
7
+
6
8
  require 'haml'
7
9
 
8
10
  module PactBroker
@@ -30,6 +32,7 @@ module PactBroker
30
32
  if errors.empty?
31
33
  lines = matrix_service.find(selectors, options)
32
34
  locals[:lines] = PactBroker::UI::ViewDomain::MatrixLines.new(lines)
35
+ locals[:badge_url] = matrix_badge_url(selectors, lines)
33
36
  else
34
37
  locals[:errors] = errors
35
38
  end
@@ -52,7 +55,8 @@ module PactBroker
52
55
  consumer_name: params[:consumer_name],
53
56
  provider_name: params[:provider_name],
54
57
  selectors: create_selector_objects(selectors),
55
- options: create_options_model(options)
58
+ options: create_options_model(options),
59
+ badge_url: nil
56
60
  }
57
61
  haml :'matrix/show', {locals: locals, layout: :'layouts/main'}
58
62
  end
@@ -76,6 +80,16 @@ module PactBroker
76
80
  o.all_rows_checked = o.latestby.nil? ? 'checked' : nil
77
81
  o
78
82
  end
83
+
84
+ def matrix_badge_url(selectors, lines)
85
+ if lines.any? && selectors.size == 2 && selectors.all?{ | selector| selector.latest_for_pacticipant_and_tag? }
86
+ consumer_selector = selectors.find{ | selector| selector.pacticipant_name == lines.first.consumer_name }
87
+ provider_selector = selectors.find{ | selector| selector.pacticipant_name == lines.first.provider_name }
88
+ if consumer_selector && provider_selector
89
+ PactBroker::Api::PactBrokerUrls.matrix_badge_url_for_selectors(consumer_selector, provider_selector, base_url)
90
+ end
91
+ end
92
+ end
79
93
  end
80
94
  end
81
95
  end
@@ -14,18 +14,21 @@
14
14
  Home
15
15
  %h1.page-header
16
16
  = title
17
+ - if defined?(badge_url) && badge_url
18
+ %img{src: badge_url, class: 'pact_badge' }
17
19
 
18
20
  - if defined?(errors) && errors.any?
19
21
  - errors.each do | error |
20
22
  %div.alert.alert-danger
21
23
  = escape_html(error)
22
24
 
25
+
23
26
  %form{action: '/matrix', onsubmit:'return onSubmit()'}
24
27
  - selectors.each_with_index do | selector, index |
25
28
  .selector
26
29
  %label{for: "pacticipant#{index}"}
27
30
  Pacticipant name
28
- %input{name: 'q[]pacticipant', id: "pacticipant1#{index}", value: escape_html(selector.pacticipant_name)}
31
+ %input{name: 'q[]pacticipant', id: "pacticipant1#{index}", class: 'pacticipant_name', value: escape_html(selector.pacticipant_name)}
29
32
 
30
33
  .input-group
31
34
 
@@ -1,7 +1,6 @@
1
1
  require 'sequel'
2
2
  require 'pact_broker/domain/verification'
3
3
  require 'pact_broker/verifications/latest_verification_for_pact_version'
4
- require 'pact_broker/verifications/all_verifications'
5
4
  require 'pact_broker/verifications/sequence'
6
5
  require 'pact_broker/verifications/latest_verification_id_for_pact_version_and_provider_version'
7
6
 
@@ -107,8 +106,8 @@ module PactBroker
107
106
 
108
107
  def find_latest_verification_for_tags consumer_name, provider_name, consumer_version_tag, provider_version_tag
109
108
  view_name = PactBroker::Domain::Verification.table_name
110
- consumer = pacticipant_repository.find_by_name(consumer_name)
111
- provider = pacticipant_repository.find_by_name(provider_name)
109
+ consumer = pacticipant_repository.find_by_name!(consumer_name)
110
+ provider = pacticipant_repository.find_by_name!(provider_name)
112
111
 
113
112
  consumer_tag_filter = PactBroker::Repositories::Helpers.name_like(Sequel.qualify(:consumer_tags, :name), consumer_version_tag)
114
113
  provider_tag_filter = PactBroker::Repositories::Helpers.name_like(Sequel.qualify(:provider_tags, :name), provider_version_tag)
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = '2.52.2'
2
+ VERSION = '2.53.0'
3
3
  end
@@ -33,8 +33,8 @@ module PactBroker
33
33
  safe_response = http_response ? HttpResponseWithUtf8SafeBody.new(http_response) : nil
34
34
  log_webhook_context(webhook_context)
35
35
  log_request(webhook_request)
36
- log_response(uuid, safe_response) if safe_response
37
- log_error(uuid, error) if error
36
+ log_response(uuid, safe_response, webhook_context[:base_url]) if safe_response
37
+ log_error(uuid, error, webhook_context[:base_url]) if error
38
38
  log_completion_message(success?(safe_response))
39
39
  log_stream.string
40
40
  end
@@ -61,17 +61,17 @@ module PactBroker
61
61
  execution_logger.info(webhook_request.body) if webhook_request.body
62
62
  end
63
63
 
64
- def log_response uuid, response
64
+ def log_response uuid, response, base_url
65
65
  log_response_to_application_logger(uuid, response)
66
66
  if options.fetch(:show_response)
67
67
  log_response_to_execution_logger(response)
68
68
  else
69
- execution_logger.info response_body_hidden_message
69
+ execution_logger.info response_body_hidden_message(base_url)
70
70
  end
71
71
  end
72
72
 
73
- def response_body_hidden_message
74
- PactBroker::Messages.message('messages.response_body_hidden')
73
+ def response_body_hidden_message(base_url)
74
+ PactBroker::Messages.message('messages.response_body_hidden', base_url: base_url)
75
75
  end
76
76
 
77
77
  def log_response_to_application_logger uuid, response
@@ -106,13 +106,13 @@ module PactBroker
106
106
  end
107
107
  end
108
108
 
109
- def log_error uuid, e
109
+ def log_error uuid, e, base_url
110
110
  logger.info "Error executing webhook #{uuid} #{e.class.name} - #{e.message} #{e.backtrace.join("\n")}"
111
111
 
112
112
  if options[:show_response]
113
113
  execution_logger.error "Error executing webhook #{uuid} #{e.class.name} - #{e.message}"
114
114
  else
115
- execution_logger.error "Error executing webhook #{uuid}. #{response_body_hidden_message}"
115
+ execution_logger.error "Error executing webhook #{uuid}. #{response_body_hidden_message(base_url)}"
116
116
  end
117
117
  end
118
118
 
@@ -28,3 +28,16 @@ span.pre-verified-icon {
28
28
  td.pact-published .tooltip-inner {
29
29
  max-width: 300px;
30
30
  }
31
+
32
+ input.pacticipant_name {
33
+ width: 250px;
34
+ }
35
+
36
+ input.tag {
37
+ width: 250px;
38
+ }
39
+
40
+ img.pact_badge {
41
+ float: right;
42
+ margin-top: 15px;
43
+ }
@@ -37,4 +37,13 @@ describe "get latest matrix badge with tags" do
37
37
  it "returns an svg body" do
38
38
  expect(subject.body).to include "<svg/>"
39
39
  end
40
+
41
+ context "when one of the pacticipants does not exist" do
42
+ let(:path) { "/matrix/provider/provider/latest/master/consumer/consumer2/latest/prod/badge" }
43
+
44
+ it "returns a 200 status as the badge content indicated the pact is not found" do
45
+ expect(subject.status).to eq 200
46
+ expect(subject.body).to include "not found"
47
+ end
48
+ end
40
49
  end
@@ -6,10 +6,9 @@ describe "UI matrix" do
6
6
  let(:params) { {} }
7
7
 
8
8
  before do
9
- td.create_pact_with_hierarchy("Foo", "1", "Bar")
10
- .create_consumer_version_tag("prod")
11
- .create_consumer_version("2")
12
- .create_pact
9
+ td.create_pact_with_verification("Foo", "1", "Bar", "2")
10
+ .create_consumer_version_tag("ctag")
11
+ .create_provider_version_tag("ptag")
13
12
  end
14
13
 
15
14
  subject { get("/matrix/provider/Bar/consumer/Foo") }
@@ -27,4 +26,12 @@ describe "UI matrix" do
27
26
  expect(subject.body.scan('<tr').to_a.count).to be > 1
28
27
  end
29
28
  end
29
+
30
+ describe "with query params, for the latest tagged versions of two pacticipants" do
31
+ subject { get("/matrix?q%5B%5Dpacticipant=Foo&q%5B%5Dtag=ctag&q%5B%5Dlatest=true&q%5B%5Dpacticipant=Bar&q%5B%5Dtag=ptag&q%5B%5Dlatest=true&latestby=cvpv&limit=100") }
32
+
33
+ it "returns a page with a badge" do
34
+ expect(subject.body).to include "http://example.org/matrix/provider/Bar/latest/ptag/consumer/Foo/latest/ctag/badge.svg"
35
+ end
36
+ end
30
37
  end
@@ -28,7 +28,7 @@ module PactBroker
28
28
  let(:consumer) { instance_double(PactBroker::Domain::Pacticipant, name: 'Consumer')}
29
29
  let(:provider) { instance_double(PactBroker::Domain::Pacticipant, name: 'Provider')}
30
30
  let(:consumer_version) { instance_double(PactBroker::Domain::Version, number: '1234', pacticipant: consumer)}
31
- let(:decorator_context) { DecoratorContext.new(base_url, '') }
31
+ let(:decorator_context) { DecoratorContext.new(base_url, '', {}) }
32
32
 
33
33
  let(:json) { PactVersionDecorator.new(pact).to_json(user_options: decorator_context) }
34
34
 
@@ -17,7 +17,7 @@ module PactBroker
17
17
  let(:resource_url) { 'http://example.org/webhooks' }
18
18
 
19
19
  let(:decorator_context) do
20
- DecoratorContext.new(base_url, resource_url, resource_title: 'Title')
20
+ DecoratorContext.new(base_url, resource_url, {}, resource_title: 'Title')
21
21
  end
22
22
 
23
23
  let(:webhooks) { [webhook] }
@@ -138,6 +138,14 @@ module PactBroker
138
138
 
139
139
  it { is_expected.to eq "http://example.org/matrix?q[][pacticipant]=Foo%2FFoo&q[][version]=2&latestby=cvpv" }
140
140
  end
141
+
142
+ describe "matrix_badge_url" do
143
+ subject { PactBrokerUrls.matrix_badge_url_for_selectors(consumer_selector, provider_selector, base_url) }
144
+ let(:provider_selector) { PactBroker::Matrix::UnresolvedSelector.new(pacticipant_name: provider_name, tag: "meep", latest: true) }
145
+ let(:consumer_selector) { PactBroker::Matrix::UnresolvedSelector.new(pacticipant_name: consumer_name, tag: "bar", latest: true) }
146
+
147
+ it { is_expected.to eq "http://example.org/matrix/provider/Bar%2FBar/latest/meep/consumer/Foo%2FFoo/latest/bar/badge.svg" }
148
+ end
141
149
  end
142
150
  end
143
151
  end
@@ -63,6 +63,15 @@ module PactBroker
63
63
  subject
64
64
  end
65
65
 
66
+ context "when the pact is not found" do
67
+ let(:pact) { nil }
68
+
69
+ it "does not retrieve the latest verification" do
70
+ expect(PactBroker::Verifications::Service).to_not receive(:find_latest_verification_for)
71
+ subject
72
+ end
73
+ end
74
+
66
75
  it "determines the pact's verification status based on the latest pact and latest verification" do
67
76
  expect(PactBroker::Verifications::PseudoBranchStatus).to receive(:new).with(pact, verification)
68
77
  subject
@@ -74,7 +83,7 @@ module PactBroker
74
83
  end
75
84
 
76
85
  it "creates a badge" do
77
- expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(pact, nil, false, :verified)
86
+ expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(pact, nil, false, :verified, {})
78
87
  subject
79
88
  end
80
89
 
@@ -101,7 +110,7 @@ module PactBroker
101
110
  end
102
111
 
103
112
  it "determines the URL of the badge to redirect to" do
104
- expect(PactBroker::Badges::Service).to receive(:pact_verification_badge_url).with(pact, nil, false, :verified)
113
+ expect(PactBroker::Badges::Service).to receive(:pact_verification_badge_url).with(pact, nil, false, :verified, {})
105
114
  subject
106
115
  end
107
116
 
@@ -116,7 +125,7 @@ module PactBroker
116
125
  let(:params) { {label: 'consumer'} }
117
126
 
118
127
  it "creates a badge with the specified label" do
119
- expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(anything, 'consumer', anything, anything)
128
+ expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(anything, 'consumer', anything, anything, {})
120
129
  subject
121
130
  end
122
131
  end
@@ -125,7 +134,7 @@ module PactBroker
125
134
  let(:params) { {initials: 'true'} }
126
135
 
127
136
  it "creates a badge with initials" do
128
- expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(anything, anything, true, anything)
137
+ expect(PactBroker::Badges::Service).to receive(:pact_verification_badge).with(anything, anything, true, anything, {})
129
138
  subject
130
139
  end
131
140
  end
@@ -156,32 +165,43 @@ module PactBroker
156
165
  let(:path) { "/matrix/provider/provider/latest/master/consumer/consumer/latest/prod/badge" }
157
166
  let(:row) { { consumer_name: 'consumer', provider_name: 'provider' } }
158
167
 
159
- it "looks up the verification" do
160
- expect(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags) do | consumer, provider, tag|
161
- expect(consumer.name).to eq 'consumer'
162
- expect(provider.name).to eq 'provider'
163
- expect(tag).to eq 'prod'
168
+ context "when a pact is found" do
169
+ it "looks up the verification" do
170
+ expect(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags) do | consumer, provider, tag|
171
+ expect(consumer.name).to eq 'consumer'
172
+ expect(provider.name).to eq 'provider'
173
+ expect(tag).to eq 'prod'
174
+ end
175
+ subject
164
176
  end
165
- subject
166
- end
167
177
 
168
- context "when a verification is found" do
169
- before do
170
- allow(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags).and_return(verification)
178
+ context "when a verification is found" do
179
+ before do
180
+ allow(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags).and_return(verification)
181
+ end
182
+
183
+ it "returns the badge" do
184
+ expect(subject.body).to end_with "badge"
185
+ end
171
186
  end
172
187
 
173
- it "returns the badge" do
174
- expect(subject.body).to end_with "badge"
188
+ context "when a verification is not found" do
189
+ before do
190
+ allow(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags).and_return(nil)
191
+ end
192
+
193
+ it "returns the badge" do
194
+ expect(subject.body).to end_with "badge"
195
+ end
175
196
  end
176
197
  end
177
198
 
178
- context "when a verification is not found" do
179
- before do
180
- allow(PactBroker::Verifications::Service).to receive(:find_latest_verification_for_tags).and_return(nil)
181
- end
199
+ context "when a pact is not found" do
200
+ let(:pact) { nil }
182
201
 
183
- it "returns the badge" do
184
- expect(subject.body).to end_with "badge"
202
+ it "does not look up the verification" do
203
+ expect(PactBroker::Verifications::Service).to_not receive(:find_latest_verification_for_tags)
204
+ subject
185
205
  end
186
206
  end
187
207
  end
@@ -60,7 +60,7 @@ module PactBroker
60
60
 
61
61
  it "generates a JSON response body for the execution result" do
62
62
  allow(PactBroker.configuration).to receive(:show_webhook_response?).and_return('foo')
63
- expect(decorator).to receive(:to_json).with(user_options: expected_user_options)
63
+ expect(decorator).to receive(:to_json).with(user_options: hash_including(expected_user_options))
64
64
  subject
65
65
  end
66
66
 
@@ -18,10 +18,11 @@ module PactBroker
18
18
  let!(:http_request) do
19
19
  stub_request(:get, expected_url).to_return(:status => response_status, :body => "svg")
20
20
  end
21
+ let(:tags) { {} }
21
22
 
22
- subject { PactBroker::Badges::Service.pact_verification_badge pact, label, initials, pseudo_branch_verification_status }
23
+ subject { PactBroker::Badges::Service.pact_verification_badge(pact, label, initials, pseudo_branch_verification_status, tags) }
23
24
 
24
- let(:pact_verification_badge_url) { PactBroker::Badges::Service.pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status) }
25
+ let(:pact_verification_badge_url) { PactBroker::Badges::Service.pact_verification_badge_url(pact, label, initials, pseudo_branch_verification_status, tags) }
25
26
 
26
27
  before do
27
28
  Service.clear_cache
@@ -43,7 +44,6 @@ module PactBroker
43
44
  end
44
45
 
45
46
  describe "#pact_verification_badge" do
46
-
47
47
  it "returns the svg file" do
48
48
  expect(subject).to eq "svg"
49
49
  end
@@ -107,6 +107,18 @@ module PactBroker
107
107
  expect(pact_verification_badge_url).to eq URI(expected_url)
108
108
  end
109
109
  end
110
+
111
+ context "when the tags are supplied" do
112
+ let(:tags) { { consumer_tag: "prod", provider_tag: "master" } }
113
+
114
+ let(:expected_left_text) { "foo--bar%20(prod)%2fthing__blah%20(master)%20pact" }
115
+
116
+ it "creates a badge with the consumer and provider names, not initials" do
117
+ subject
118
+ expect(http_request).to have_been_made
119
+ expect(pact_verification_badge_url).to eq URI(expected_url)
120
+ end
121
+ end
110
122
  end
111
123
 
112
124
  context "when label is consumer" do
@@ -11,7 +11,7 @@ module PactBroker
11
11
  end
12
12
 
13
13
  def version_numbers
14
- subject.collect(&:number)
14
+ subject.collect(&:number).sort_by(&:to_i)
15
15
  end
16
16
 
17
17
  context "when selecting the latest prod versions without a pacticipant name" do
@@ -63,7 +63,7 @@ module PactBroker
63
63
  let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: 'prod') }
64
64
 
65
65
  it "selects all the production versions without a pacticipant name" do
66
- expect(version_numbers.sort).to eq %w{1 10 11 2}
66
+ expect(version_numbers).to eq %w{1 2 10 11}
67
67
  end
68
68
  end
69
69
 
@@ -82,14 +82,14 @@ module PactBroker
82
82
  let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true, latest: true) }
83
83
 
84
84
  it "selects the head versions for each tag" do
85
- expect(version_numbers.sort).to eq %w{11 2 4}
85
+ expect(version_numbers).to eq %w{2 4 11}
86
86
  end
87
87
 
88
88
  context "when also specifying pacticipant name" do
89
89
  let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true, latest: true, pacticipant_name: "Foo") }
90
90
 
91
91
  it "selects the head versions for each tag for the given pacticipant" do
92
- expect(version_numbers.sort).to eq %w{2 4}
92
+ expect(version_numbers).to eq %w{2 4}
93
93
  end
94
94
  end
95
95
  end
@@ -109,14 +109,14 @@ module PactBroker
109
109
  let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true) }
110
110
 
111
111
  it "selects every version with a tag" do
112
- expect(version_numbers.sort).to eq %w{1 10 2 4}
112
+ expect(version_numbers).to eq %w{1 2 4 10}
113
113
  end
114
114
 
115
115
  context "when also specifying pacticipant name" do
116
116
  let(:selector) { PactBroker::Matrix::UnresolvedSelector.new(tag: true, pacticipant_name: "Foo") }
117
117
 
118
118
  it "selects every version with a tag for the given pacticipant" do
119
- expect(version_numbers.sort).to eq %w{1 2 4}
119
+ expect(version_numbers).to eq %w{1 2 4}
120
120
  end
121
121
  end
122
122
  end
@@ -137,7 +137,7 @@ module PactBroker
137
137
  let(:four_days_ago) { Date.today - 4 }
138
138
 
139
139
  it "selects the consumer versions younger than the max age" do
140
- expect(version_numbers.sort).to eq %w{2 3}
140
+ expect(version_numbers).to eq %w{2 3}
141
141
  end
142
142
  end
143
143
  end
@@ -6,7 +6,6 @@ module PactBroker
6
6
  let(:td) { TestDataBuilder.new }
7
7
 
8
8
  describe "#find_for_verification" do
9
-
10
9
  def find_by_consumer_version_number(consumer_version_number)
11
10
  subject.find{ |pact| pact.consumer_version_number == consumer_version_number }
12
11
  end
@@ -189,6 +188,24 @@ module PactBroker
189
188
  expect(find_by_consumer_version_number("foo-latest-dev-version").overall_latest?).to be true
190
189
  end
191
190
  end
191
+
192
+ context "when two consumers have exactly the same json content" do
193
+ before do
194
+ td.create_consumer
195
+ .create_provider("Bar")
196
+ .create_consumer_version
197
+ .create_pact(json_content: { interactions: ['foo'] }.to_json )
198
+ .create_consumer
199
+ .create_consumer_version
200
+ .create_pact(json_content: { interactions: ['foo'] }.to_json )
201
+ end
202
+
203
+ let(:consumer_version_selectors) { Selectors.new }
204
+
205
+ it "returns a pact for each consumer" do
206
+ expect(subject.size).to eq 2
207
+ end
208
+ end
192
209
  end
193
210
  end
194
211
  end
@@ -295,6 +295,26 @@ module PactBroker
295
295
  expect(subject.number).to eq 2
296
296
  end
297
297
  end
298
+
299
+ context "when the consumer does not exist" do
300
+ subject { Repository.new.find_latest_verification_for_tags("Foo", "Bar", "feat-x", "feat-y") }
301
+
302
+ it "raises an error" do
303
+ expect{ subject }.to raise_error PactBroker::Error, /Foo/
304
+ end
305
+ end
306
+
307
+ context "when the provider does not exist" do
308
+ before do
309
+ td.create_consumer("Foo")
310
+ end
311
+
312
+ subject { Repository.new.find_latest_verification_for_tags("Foo", "Bar", "feat-x", "feat-y") }
313
+
314
+ it "raises an error" do
315
+ expect{ subject }.to raise_error PactBroker::Error, /Bar/
316
+ end
317
+ end
298
318
  end
299
319
 
300
320
  describe "delete_by_provider_version_id" do
@@ -50,7 +50,8 @@ module PactBroker
50
50
  }
51
51
  end
52
52
 
53
- let(:webhook_context) { { consumer_version_number: "123" } }
53
+ let(:base_url) { "http://example.org" }
54
+ let(:webhook_context) { { consumer_version_number: "123", base_url: base_url } }
54
55
 
55
56
  let(:webhook_request_logger) { WebhookRequestLogger.new(options) }
56
57
 
@@ -117,6 +118,7 @@ module PactBroker
117
118
  end
118
119
 
119
120
  it "logs a message about why the response is hidden" do
121
+ expect(logs).to include base_url
120
122
  expect(logs).to include "security purposes"
121
123
  end
122
124
  end
@@ -192,6 +194,7 @@ module PactBroker
192
194
  end
193
195
 
194
196
  it "logs a message about why the response is hidden" do
197
+ expect(logs).to include base_url
195
198
  expect(logs).to include "security purposes"
196
199
  end
197
200
  end
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.52.2
4
+ version: 2.53.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: 2020-04-16 00:00:00.000000000 Z
13
+ date: 2020-05-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -128,42 +128,42 @@ dependencies:
128
128
  name: rack
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
- - - ">="
132
- - !ruby/object:Gem::Version
133
- version: 2.0.8
134
131
  - - "~>"
135
132
  - !ruby/object:Gem::Version
136
133
  version: '2.0'
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: 2.0.8
137
137
  type: :runtime
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- version: 2.0.8
144
141
  - - "~>"
145
142
  - !ruby/object:Gem::Version
146
143
  version: '2.0'
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: 2.0.8
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: redcarpet
149
149
  requirement: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ">="
152
- - !ruby/object:Gem::Version
153
- version: 3.3.2
154
151
  - - "~>"
155
152
  - !ruby/object:Gem::Version
156
153
  version: '3.3'
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: 3.3.2
157
157
  type: :runtime
158
158
  prerelease: false
159
159
  version_requirements: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">="
162
- - !ruby/object:Gem::Version
163
- version: 3.3.2
164
161
  - - "~>"
165
162
  - !ruby/object:Gem::Version
166
163
  version: '3.3'
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 3.3.2
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: pact-support
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -188,22 +188,22 @@ dependencies:
188
188
  name: padrino-core
189
189
  requirement: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: 0.14.3
194
191
  - - "~>"
195
192
  - !ruby/object:Gem::Version
196
193
  version: '0.14'
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: 0.14.3
197
197
  type: :runtime
198
198
  prerelease: false
199
199
  version_requirements: !ruby/object:Gem::Requirement
200
200
  requirements:
201
- - - ">="
202
- - !ruby/object:Gem::Version
203
- version: 0.14.3
204
201
  - - "~>"
205
202
  - !ruby/object:Gem::Version
206
203
  version: '0.14'
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: 0.14.3
207
207
  - !ruby/object:Gem::Dependency
208
208
  name: sinatra
209
209
  requirement: !ruby/object:Gem::Requirement
@@ -1126,7 +1126,6 @@ files:
1126
1126
  - lib/pact_broker/ui/views/index/show.haml
1127
1127
  - lib/pact_broker/ui/views/layouts/main.haml
1128
1128
  - lib/pact_broker/ui/views/matrix/show.haml
1129
- - lib/pact_broker/verifications/all_verifications.rb
1130
1129
  - lib/pact_broker/verifications/latest_verification_for_consumer_and_provider.rb
1131
1130
  - lib/pact_broker/verifications/latest_verification_for_consumer_version_tag.rb
1132
1131
  - lib/pact_broker/verifications/latest_verification_for_pact_version.rb
@@ -1641,7 +1640,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1641
1640
  - !ruby/object:Gem::Version
1642
1641
  version: '0'
1643
1642
  requirements: []
1644
- rubygems_version: 3.1.2
1643
+ rubygems_version: 3.0.6
1645
1644
  signing_key:
1646
1645
  specification_version: 4
1647
1646
  summary: See description
@@ -1,41 +0,0 @@
1
- require 'pact_broker/domain/verification'
2
-
3
- module PactBroker
4
- module Verifications
5
- include PactBroker::Repositories::Helpers
6
-
7
- class AllVerifications < PactBroker::Domain::Verification
8
- set_dataset(:all_verifications)
9
- end
10
-
11
- # this view doesn't have a consumer_id
12
- # TODO add it
13
- def consumer
14
- PactBroker::Domain::Pacticipant.find(id: PactBroker::Pacts::AllPactPublications
15
- .where(pact_version_id: pact_version_id)
16
- .limit(1).select(:consumer_id))
17
- end
18
-
19
- # this view doesn't have a provider_id
20
- # TODO add it
21
- def provider
22
- PactBroker::Domain::Pacticipant.find(id: PactBroker::Pacts::AllPactPublications
23
- .where(pact_version_id: pact_version_id)
24
- .limit(1).select(:provider_id))
25
- end
26
- end
27
- end
28
-
29
- # Table: all_verifications
30
- # Columns:
31
- # id | integer |
32
- # number | integer |
33
- # success | boolean |
34
- # provider_version_id | integer |
35
- # provider_version_number | text |
36
- # provider_version_order | integer |
37
- # build_url | text |
38
- # pact_version_id | integer |
39
- # execution_date | timestamp without time zone |
40
- # created_at | timestamp without time zone |
41
- # test_results | text |