pact_broker 2.72.0 → 2.76.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.optic/.gitignore +2 -0
  4. data/.optic/api/specification.json +1 -0
  5. data/.optic/ignore +14 -0
  6. data/CHANGELOG.md +66 -0
  7. data/DEVELOPER_SETUP.md +9 -0
  8. data/Dockerfile +1 -0
  9. data/ISSUES.md +3 -3
  10. data/README.md +1 -1
  11. data/config/database.yml +1 -1
  12. data/db/migrations/20210115_add_webhook_foreign_key_indexes.rb +49 -0
  13. data/db/migrations/20210116_add_context_to_triggered_webhook.rb +11 -0
  14. data/db/migrations/migration_helper.rb +8 -0
  15. data/docker-compose-issue-repro-with-pact-broker-docker-image.yml +33 -0
  16. data/docker-compose-test.yml +4 -4
  17. data/lib/db.rb +1 -0
  18. data/lib/pact_broker/api.rb +13 -2
  19. data/lib/pact_broker/api/decorators.rb +3 -7
  20. data/lib/pact_broker/api/decorators/configuration.rb +33 -0
  21. data/lib/pact_broker/api/decorators/decorator_context_creator.rb +13 -0
  22. data/lib/pact_broker/api/decorators/extended_pact_decorator.rb +9 -1
  23. data/lib/pact_broker/api/decorators/extended_verification_decorator.rb +8 -0
  24. data/lib/pact_broker/api/decorators/matrix_decorator.rb +9 -4
  25. data/lib/pact_broker/api/decorators/pact_collection_decorator.rb +1 -0
  26. data/lib/pact_broker/api/decorators/pacticipant_collection_decorator.rb +2 -3
  27. data/lib/pact_broker/api/decorators/reason_decorator.rb +2 -0
  28. data/lib/pact_broker/api/decorators/tag_decorator.rb +0 -3
  29. data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +3 -1
  30. data/lib/pact_broker/api/pact_broker_urls.rb +4 -4
  31. data/lib/pact_broker/api/paths.rb +5 -0
  32. data/lib/pact_broker/api/renderers/html_pact_renderer.rb +2 -2
  33. data/lib/pact_broker/api/resources/all_webhooks.rb +3 -3
  34. data/lib/pact_broker/api/resources/can_i_deploy_badge.rb +1 -1
  35. data/lib/pact_broker/api/resources/dashboard.rb +2 -2
  36. data/lib/pact_broker/api/resources/default_base_resource.rb +37 -12
  37. data/lib/pact_broker/api/resources/error_handler.rb +1 -1
  38. data/lib/pact_broker/api/resources/error_response_body_generator.rb +41 -0
  39. data/lib/pact_broker/api/resources/group.rb +1 -1
  40. data/lib/pact_broker/api/resources/integrations.rb +1 -1
  41. data/lib/pact_broker/api/resources/label.rb +1 -1
  42. data/lib/pact_broker/api/resources/latest_pact.rb +2 -2
  43. data/lib/pact_broker/api/resources/latest_pacts.rb +1 -1
  44. data/lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb +2 -2
  45. data/lib/pact_broker/api/resources/matrix.rb +2 -2
  46. data/lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb +1 -1
  47. data/lib/pact_broker/api/resources/metadata_resource_methods.rb +2 -1
  48. data/lib/pact_broker/api/resources/pact.rb +2 -2
  49. data/lib/pact_broker/api/resources/pact_triggered_webhooks.rb +1 -1
  50. data/lib/pact_broker/api/resources/pact_versions.rb +1 -1
  51. data/lib/pact_broker/api/resources/pact_webhooks.rb +3 -3
  52. data/lib/pact_broker/api/resources/pact_webhooks_status.rb +2 -2
  53. data/lib/pact_broker/api/resources/pacticipant.rb +1 -1
  54. data/lib/pact_broker/api/resources/pacticipants.rb +3 -3
  55. data/lib/pact_broker/api/resources/pacticipants_for_label.rb +1 -1
  56. data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +1 -1
  57. data/lib/pact_broker/api/resources/provider_pacts.rb +1 -7
  58. data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +2 -2
  59. data/lib/pact_broker/api/resources/relationships.rb +1 -1
  60. data/lib/pact_broker/api/resources/tag.rb +1 -1
  61. data/lib/pact_broker/api/resources/tagged_pact_versions.rb +1 -1
  62. data/lib/pact_broker/api/resources/verification.rb +2 -2
  63. data/lib/pact_broker/api/resources/verification_triggered_webhooks.rb +1 -1
  64. data/lib/pact_broker/api/resources/verifications.rb +1 -1
  65. data/lib/pact_broker/api/resources/version.rb +1 -1
  66. data/lib/pact_broker/api/resources/versions.rb +1 -1
  67. data/lib/pact_broker/api/resources/webhook.rb +2 -2
  68. data/lib/pact_broker/api/resources/webhook_execution.rb +4 -4
  69. data/lib/pact_broker/api/resources/webhook_execution_methods.rb +1 -3
  70. data/lib/pact_broker/api/resources/webhooks.rb +3 -3
  71. data/lib/pact_broker/app.rb +14 -3
  72. data/lib/pact_broker/application_context.rb +41 -0
  73. data/lib/pact_broker/configuration.rb +12 -4
  74. data/lib/pact_broker/doc/controllers/app.rb +3 -2
  75. data/lib/pact_broker/domain/version.rb +13 -6
  76. data/lib/pact_broker/domain/webhook_request.rb +1 -1
  77. data/lib/pact_broker/error.rb +0 -2
  78. data/lib/pact_broker/errors.rb +28 -0
  79. data/lib/pact_broker/errors/error_logger.rb +25 -0
  80. data/lib/pact_broker/metrics/service.rb +12 -1
  81. data/lib/pact_broker/pacts/metadata.rb +53 -8
  82. data/lib/pact_broker/pacts/repository.rb +10 -17
  83. data/lib/pact_broker/pacts/selector.rb +22 -0
  84. data/lib/pact_broker/pacts/selectors.rb +4 -0
  85. data/lib/pact_broker/services.rb +106 -31
  86. data/lib/pact_broker/tags/tag_with_latest_flag.rb +2 -0
  87. data/lib/pact_broker/test/http_test_data_builder.rb +83 -21
  88. data/lib/pact_broker/test/test_data_builder.rb +3 -2
  89. data/lib/pact_broker/ui/views/index/_getting-started.haml +1 -1
  90. data/lib/pact_broker/ui/views/index/show-with-tags.haml +16 -16
  91. data/lib/pact_broker/ui/views/index/show.haml +6 -6
  92. data/lib/pact_broker/ui/views/layouts/main.haml +2 -2
  93. data/lib/pact_broker/ui/views/matrix/show.haml +32 -33
  94. data/lib/pact_broker/version.rb +1 -1
  95. data/lib/pact_broker/webhooks/execution_configuration.rb +4 -0
  96. data/lib/pact_broker/webhooks/execution_configuration_creator.rb +14 -0
  97. data/lib/pact_broker/webhooks/repository.rb +3 -2
  98. data/lib/pact_broker/webhooks/service.rb +2 -1
  99. data/lib/pact_broker/webhooks/triggered_webhook.rb +1 -0
  100. data/lib/rack/pact_broker/hal_browser_redirect.rb +42 -0
  101. data/lib/rack/pact_broker/set_base_url.rb +22 -0
  102. data/lib/sequel/extensions/statement_timeout.rb +22 -0
  103. data/optic.yml +5 -0
  104. data/pact_broker.gemspec +1 -1
  105. data/public/css/bootstrap-grid.css +3719 -0
  106. data/public/css/bootstrap-grid.css.map +1 -0
  107. data/public/css/bootstrap-grid.min.css +7 -0
  108. data/public/css/bootstrap-grid.min.css.map +1 -0
  109. data/public/css/bootstrap-reboot.css +331 -0
  110. data/public/css/bootstrap-reboot.css.map +1 -0
  111. data/public/css/bootstrap-reboot.min.css +8 -0
  112. data/public/css/bootstrap-reboot.min.css.map +1 -0
  113. data/public/css/bootstrap.css +8885 -5604
  114. data/public/css/bootstrap.css.map +1 -1
  115. data/public/css/bootstrap.min.css +4 -3
  116. data/public/css/bootstrap.min.css.map +1 -1
  117. data/public/images/alert.svg +1 -0
  118. data/public/images/arrow-switch.svg +1 -0
  119. data/public/images/check.svg +1 -0
  120. data/public/images/clock.svg +1 -0
  121. data/public/images/copy.svg +1 -0
  122. data/public/images/kebab-horizontal.svg +1 -0
  123. data/public/javascripts/clipboard.js +3 -3
  124. data/public/javascripts/{jquery-3.3.1.js → jquery-3.5.1.js} +1150 -642
  125. data/public/javascripts/jquery-3.5.1.min.js +2 -0
  126. data/public/javascripts/jquery-3.5.1.min.map +1 -0
  127. data/public/javascripts/matrix.js +2 -2
  128. data/public/js/bootstrap.bundle.js +7013 -0
  129. data/public/js/bootstrap.bundle.js.map +1 -0
  130. data/public/js/bootstrap.bundle.min.js +7 -0
  131. data/public/js/bootstrap.bundle.min.js.map +1 -0
  132. data/public/js/bootstrap.js +3862 -1804
  133. data/public/js/bootstrap.js.map +1 -0
  134. data/public/js/bootstrap.min.js +6 -6
  135. data/public/js/bootstrap.min.js.map +1 -0
  136. data/public/stylesheets/index.css +56 -3
  137. data/public/stylesheets/matrix.css +55 -5
  138. data/public/stylesheets/pact.css +14 -0
  139. data/regression/.gitignore +1 -0
  140. data/regression/can_i_deploy_spec.rb +42 -0
  141. data/regression/regression_helper.rb +37 -0
  142. data/regression/script/approval-all.sh +6 -0
  143. data/script/exercise-api-for-optic.sh +3 -0
  144. data/script/reproduce-issue-starting-up.rb +43 -0
  145. data/script/reproduce-issue.rb +9 -21
  146. data/spec/lib/pact_broker/api/decorators/extended_pact_decorator_spec.rb +1 -0
  147. data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +20 -8
  148. data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +5 -7
  149. data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +10 -6
  150. data/spec/lib/pact_broker/api/resources/can_i_deploy_badge_spec.rb +1 -1
  151. data/spec/lib/pact_broker/api/resources/default_base_resource_spec.rb +59 -10
  152. data/spec/lib/pact_broker/api/resources/error_response_body_generator_spec.rb +69 -0
  153. data/spec/lib/pact_broker/db/log_quietener_spec.rb +1 -1
  154. data/spec/lib/pact_broker/doc/controllers/app_spec.rb +3 -5
  155. data/spec/lib/pact_broker/errors/error_logger_spec.rb +62 -0
  156. data/spec/lib/pact_broker/errors_spec.rb +55 -0
  157. data/spec/lib/pact_broker/pacts/metadata_spec.rb +73 -0
  158. data/spec/lib/pact_broker/pacts/repository_find_for_verification_fallback_spec.rb +2 -2
  159. data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +33 -13
  160. data/spec/lib/pact_broker/pacts/selected_pact_spec.rb +23 -0
  161. data/spec/lib/pact_broker/webhooks/repository_spec.rb +5 -2
  162. data/spec/lib/pact_broker/webhooks/service_spec.rb +2 -1
  163. data/spec/lib/rack/pact_broker/hal_browser_redirect_spec.rb +27 -0
  164. data/tasks/rspec.rake +6 -0
  165. metadata +65 -17
  166. data/public/css/bootstrap-theme.css +0 -587
  167. data/public/css/bootstrap-theme.css.map +0 -1
  168. data/public/css/bootstrap-theme.min.css +0 -6
  169. data/public/css/bootstrap-theme.min.css.map +0 -1
  170. data/public/fonts/glyphicons-halflings-regular.svg +0 -288
  171. data/public/javascripts/jquery-3.3.1.min.js +0 -2
  172. data/public/javascripts/jquery-3.3.1.min.map +0 -1
  173. data/spec/lib/pact_broker/api/resources/error_handler_spec.rb +0 -195
@@ -5,6 +5,8 @@ module PactBroker
5
5
  module Tags
6
6
  # The tag associated with the latest verification for a given tag
7
7
  class TagWithLatestFlag < Sequel::Model(:tags_with_latest_flag)
8
+ associate(:many_to_one, :version, :class => "PactBroker::Domain::Version", :key => :version_id, :primary_key => :id)
9
+
8
10
  dataset_module do
9
11
  include PactBroker::Repositories::Helpers
10
12
  end
@@ -10,7 +10,7 @@ module PactBroker
10
10
 
11
11
  attr_reader :client, :last_consumer_name, :last_provider_name, :last_consumer_version_number, :last_provider_version_number
12
12
 
13
- def initialize(pact_broker_base_url, auth)
13
+ def initialize(pact_broker_base_url, auth = {})
14
14
  @client = Faraday.new(url: pact_broker_base_url) do |faraday|
15
15
  faraday.request :json
16
16
  faraday.response :json, :content_type => /\bjson$/
@@ -19,13 +19,13 @@ module PactBroker
19
19
  logger.filter(/(Authorization: ).*/,'\1[REMOVED]')
20
20
  end
21
21
  end
22
- # faraday.headers['Authorization'] = "Bearer #{pactflow_api_token}"
22
+ faraday.headers['Authorization'] = "Bearer #{auth[:token]}" if auth[:token]
23
23
  faraday.adapter Faraday.default_adapter
24
24
  end
25
25
  end
26
26
 
27
27
  def sleep
28
- Kernel.sleep 1
28
+ Kernel.sleep 0.5
29
29
  self
30
30
  end
31
31
 
@@ -42,7 +42,7 @@ module PactBroker
42
42
 
43
43
  def create_tag(pacticipant:, version:, tag:)
44
44
  puts "Creating tag '#{tag}' for #{pacticipant} version #{version}"
45
- client.put("/pacticipants/#{encode(pacticipant)}/versions/#{encode(version)}/tags/#{encode(tag)}", {})
45
+ client.put("pacticipants/#{encode(pacticipant)}/versions/#{encode(version)}/tags/#{encode(tag)}", {}).tap { |response| check_for_error(response) }
46
46
  self
47
47
  end
48
48
 
@@ -53,6 +53,13 @@ module PactBroker
53
53
  self
54
54
  end
55
55
 
56
+ def create_pacticipant(name)
57
+ puts "Creating pacticipant with name #{name}"
58
+ client.post("pacticipants", { name: name}).tap { |response| check_for_error(response) }
59
+ separate
60
+ self
61
+ end
62
+
56
63
  def publish_pact(consumer: last_consumer_name, consumer_version:, provider: last_provider_name, content_id:, tag:)
57
64
  @last_consumer_name = consumer
58
65
  @last_provider_name = provider
@@ -61,26 +68,28 @@ module PactBroker
61
68
  [*tag].each do | tag |
62
69
  create_tag(pacticipant: consumer, version: consumer_version, tag: tag)
63
70
  end
71
+ puts "" if [*tag].any?
64
72
 
65
73
  content = generate_content(consumer, provider, content_id)
66
74
  puts "Publishing pact for consumer #{consumer} version #{consumer_version} and provider #{provider}"
67
- pact_path = "/pacts/provider/#{encode(provider)}/consumer/#{encode(consumer)}/version/#{encode(consumer_version)}"
68
- @publish_pact_response = client.put(pact_path, content)
75
+ pact_path = "pacts/provider/#{encode(provider)}/consumer/#{encode(consumer)}/version/#{encode(consumer_version)}"
76
+ @publish_pact_response = client.put(pact_path, content).tap { |response| check_for_error(response) }
69
77
  separate
70
78
  self
71
79
  end
72
80
 
73
81
  def get_pacts_for_verification(provider: last_provider_name, provider_version_tag: , consumer_version_selectors:, enable_pending: false, include_wip_pacts_since: nil)
82
+ @last_provider_name = provider
74
83
  puts "Fetching pacts for verification for #{provider}"
75
84
  body = {
76
85
  providerVersionTags: [*provider_version_tag],
77
86
  consumerVersionSelectors: consumer_version_selectors,
78
87
  includePendingStatus: enable_pending,
79
88
  includeWipPactsSince: include_wip_pacts_since
80
- }
89
+ }.compact
81
90
  puts body.to_yaml
82
91
  puts ""
83
- @pacts_for_verification_response = client.post("/pacts/provider/#{encode(provider)}/for-verification", body)
92
+ @pacts_for_verification_response = client.post("pacts/provider/#{encode(provider)}/for-verification", body).tap { |response| check_for_error(response) }
84
93
 
85
94
  print_pacts_for_verification
86
95
  separate
@@ -88,23 +97,32 @@ module PactBroker
88
97
  end
89
98
 
90
99
  def print_pacts_for_verification
91
- pacts = @pacts_for_verification_response.body["_embedded"]["pacts"]
92
- puts "Pacts for verification (#{pacts.count}):"
93
- pacts.each do | pact |
94
- puts({
95
- "url" => pact["_links"]["self"]["href"],
96
- "wip" => pact["verificationProperties"]["wip"],
97
- "pending" => pact["verificationProperties"]["pending"]
98
- }.to_yaml)
100
+ pacts = @pacts_for_verification_response.body&.dig("_embedded", "pacts")
101
+ if pacts
102
+ puts "Pacts for verification (#{pacts.count}):"
103
+ pacts.each do | pact |
104
+ puts({
105
+ "url" => pact["_links"]["self"]["href"],
106
+ "wip" => pact["verificationProperties"]["wip"],
107
+ "pending" => pact["verificationProperties"]["pending"]
108
+ }.to_yaml)
109
+ end
99
110
  end
100
111
  self
101
112
  end
102
113
 
103
114
  def verify_pact(index: 0, success:, provider: last_provider_name, provider_version_tag: , provider_version: )
115
+ @last_provider_name = provider
104
116
  pact_to_verify = @pacts_for_verification_response.body["_embedded"]["pacts"][index]
105
117
  raise "No pact found to verify at index #{index}" unless pact_to_verify
106
118
  url_of_pact_to_verify = pact_to_verify["_links"]["self"]["href"]
107
- pact_response = client.get(url_of_pact_to_verify)
119
+
120
+ [*provider_version_tag].each do | tag |
121
+ create_tag(pacticipant: provider, version: provider_version, tag: tag)
122
+ end
123
+ puts "" if [*provider_version_tag].any?
124
+
125
+ pact_response = client.get(url_of_pact_to_verify).tap { |response| check_for_error(response) }
108
126
  verification_results_url = pact_response.body["_links"]["pb:publish-verification-results"]["href"]
109
127
 
110
128
  results = {
@@ -112,8 +130,36 @@ module PactBroker
112
130
  testResults: [],
113
131
  providerApplicationVersion: provider_version
114
132
  }
115
- puts "\nPublishing verification"
116
- response = client.post(verification_results_url, results.to_json)
133
+ puts "Publishing verification"
134
+ puts results.to_yaml
135
+ response = client.post(verification_results_url, results.to_json).tap { |response| check_for_error(response) }
136
+ separate
137
+ self
138
+ end
139
+
140
+ def create_global_webhook_for_contract_changed(uuid: nil, url: "https://postman-echo.com/post")
141
+ puts "Creating global webhook for contract changed event with uuid #{uuid}"
142
+ uuid ||= SecureRandom.uuid
143
+ request_body = {
144
+ "description" => "A webhook for all consumers and providers",
145
+ "events" => [{
146
+ "name" => "contract_content_changed"
147
+ }],
148
+ "request" => {
149
+ "method" => "POST",
150
+ "url" => url
151
+ }
152
+ }
153
+ path = "webhooks/#{uuid}"
154
+ response = client.put(path, request_body.to_json).tap { |response| check_for_error(response) }
155
+ separate
156
+ self
157
+ end
158
+
159
+ def delete_webhook(uuid:)
160
+ puts "Deleting webhook with uuid #{uuid}"
161
+ path = "webhooks/#{uuid}"
162
+ response = client.delete(path).tap { |response| check_for_error(response) }
117
163
  separate
118
164
  self
119
165
  end
@@ -124,7 +170,7 @@ module PactBroker
124
170
  end
125
171
 
126
172
  def can_i_deploy(pacticipant:, version:, to:)
127
- can_i_deploy_response = client.get("/can-i-deploy", { pacticipant: pacticipant, version: version, to: to} )
173
+ can_i_deploy_response = client.get("can-i-deploy", { pacticipant: pacticipant, version: version, to: to} ).tap { |response| check_for_error(response) }
128
174
  can = !!(can_i_deploy_response.body['summary'] || {})['deployable']
129
175
  puts "can-i-deploy #{pacticipant} version #{version} to #{to}: #{can ? 'yes' : 'no'}"
130
176
  puts (can_i_deploy_response.body['summary'] || can_i_deploy_response.body).to_yaml
@@ -133,7 +179,15 @@ module PactBroker
133
179
  end
134
180
 
135
181
  def delete_integration(consumer:, provider:)
136
- client.delete("/integrations/provider/#{encode(provider)}/consumer/#{encode(consumer)}")
182
+ puts "Deleting all data for the integration between #{consumer} and #{provider}"
183
+ client.delete("integrations/provider/#{encode(provider)}/consumer/#{encode(consumer)}").tap { |response| check_for_error(response) }
184
+ separate
185
+ self
186
+ end
187
+
188
+ def delete_pacticipant(name)
189
+ puts "Deleting pacticipant #{name}"
190
+ @publish_pact_response = client.delete("pacticipants/#{encode(name)}").tap { |response| check_for_error(response) }
137
191
  separate
138
192
  self
139
193
  end
@@ -148,6 +202,7 @@ module PactBroker
148
202
  },
149
203
  interactions: [
150
204
  {
205
+ description: "a request",
151
206
  request: {
152
207
  method: "GET",
153
208
  path: "/things/#{content_id}"
@@ -163,6 +218,13 @@ module PactBroker
163
218
  def encode string
164
219
  ERB::Util.url_encode(string)
165
220
  end
221
+
222
+ def check_for_error(response)
223
+ if ! response.success?
224
+ puts response.status
225
+ puts response.body
226
+ end
227
+ end
166
228
  end
167
229
  end
168
230
  end
@@ -319,9 +319,10 @@ module PactBroker
319
319
  trigger_uuid = params[:trigger_uuid] || webhook_service.next_uuid
320
320
  event_name = params.key?(:event_name) ? params[:event_name] : @webhook.events.first.name # could be nil, for backwards compatibility
321
321
  verification = @webhook.trigger_on_provider_verification_published? ? @verification : nil
322
- @triggered_webhook = webhook_repository.create_triggered_webhook trigger_uuid, @webhook, @pact, verification, PactBroker::Webhooks::Service::RESOURCE_CREATION, event_name
322
+ event_context = params[:event_context]
323
+ @triggered_webhook = webhook_repository.create_triggered_webhook(trigger_uuid, @webhook, @pact, verification, PactBroker::Webhooks::Service::RESOURCE_CREATION, event_name, event_context)
323
324
  @triggered_webhook.update(status: params[:status]) if params[:status]
324
- set_created_at_if_set params[:created_at], :triggered_webhooks, {id: @triggered_webhook.id}
325
+ set_created_at_if_set params[:created_at], :triggered_webhooks, { id: @triggered_webhook.id }
325
326
  self
326
327
  end
327
328
 
@@ -3,4 +3,4 @@
3
3
  %p
4
4
  Just getting started? Confused as to why there's nothing "clicky clicky" to see here? The Pact workflow is a "code first" approach. Your pacts will be generated by your consumer tests and then published here, ready to be retrieved by your provider tests for verification.
5
5
  %p
6
- For step by step instructions on getting started, check out the <a href="https://docs.pact.io/best_practices/pact_nirvana">Effective Pact Setup Guide</a>.
6
+ For step by step instructions on getting started, check out the <a href="https://docs.pact.io/pact_nirvana">Effective Pact Setup Guide</a>.
@@ -11,25 +11,25 @@
11
11
  %tr
12
12
  %th.consumer
13
13
  Consumer
14
- %span.glyphicon.glyphicon-sort.relationships-sort
14
+ %span.sort-icon.relationships-sort
15
15
  %th.consumer-version-number
16
16
  Consumer<br>Version
17
- %span.glyphicon.glyphicon-sort.relationships-sort
17
+ %span.sort-icon.relationships-sort
18
18
  %th.pact{ style: 'width: 40px' }
19
19
  %th.provider
20
20
  Provider
21
- %span.glyphicon.glyphicon-sort.relationships-sort
21
+ %span.sort-icon.relationships-sort
22
22
  %th.provider-version-number
23
23
  Provider<br>Version
24
- %span.glyphicon.glyphicon-sort.relationships-sort
24
+ %span.sort-icon.relationships-sort
25
25
  %th
26
26
  Published
27
- %span.glyphicon.glyphicon-sort.relationships-sort
27
+ %span.sort-icon.relationships-sort
28
28
  %th
29
29
  Webhook<br>status
30
30
  %th
31
31
  Last<br>verified
32
- %span.glyphicon.glyphicon-sort.relationships-sort
32
+ %span.sort-icon.relationships-sort
33
33
  %th
34
34
  %tbody
35
35
 
@@ -43,12 +43,12 @@
43
43
  = index_item.consumer_version_number
44
44
  - if index_item.consumer_version_number
45
45
  %button.clippy.invisible{ title: "Copy to clipboard" }
46
- %span.glyphicon.glyphicon-copy
46
+ %span.copy-icon
47
47
  - if index_item.latest?
48
- .tag.label.label-success
48
+ .tag.badge.badge-success
49
49
  latest
50
50
  - index_item.consumer_version_latest_tag_names.each do | tag_name |
51
- .tag.label.label-primary
51
+ .tag.badge.badge-primary
52
52
  = tag_name
53
53
  %td.pact
54
54
  %span.pact
@@ -63,27 +63,27 @@
63
63
  = index_item.provider_version_number
64
64
  - if index_item.provider_version_number
65
65
  %button.clippy.invisible{ title: "Copy to clipboard" }
66
- %span.glyphicon.glyphicon-copy
66
+ %span.copy-icon
67
67
  - index_item.provider_version_latest_tag_names.each do | tag_name |
68
- .tag.label.label-primary
68
+ .tag.badge.badge-primary
69
69
  = tag_name
70
70
  %td{"data-text": index_item.publication_date_of_latest_pact_order}
71
71
  = index_item.publication_date_of_latest_pact.gsub("about ", "")
72
- %td{ class: index_item.webhook_status }
72
+ %td{ class: "table-#{index_item.webhook_status}" }
73
73
  - if index_item.show_webhook_status?
74
74
  %a{ href: index_item.webhook_url }
75
75
  = index_item.webhook_label
76
76
 
77
- %td{ class: index_item.pseudo_branch_verification_status, title: index_item.verification_tooltip, "data-toggle": "tooltip", "data-placement": "left" }
77
+ %td{ class: "table-#{index_item.pseudo_branch_verification_status}", title: index_item.verification_tooltip, "data-toggle": "tooltip", "data-placement": "left" }
78
78
  %div
79
79
  = index_item.last_verified_date.gsub("about ", "")
80
80
  - if index_item.warning?
81
- %span.glyphicon.glyphicon-warning-sign{ 'aria-hidden': true }
81
+ %span.warning-icon{ 'aria-hidden': true }
82
82
  %td
83
83
  - if index_item.show_settings?
84
- %span.integration-settings.glyphicon.glyphicon-option-horizontal{ 'aria-hidden': true }
84
+ %span.integration-settings.kebab-horizontal{ 'aria-hidden': true }
85
85
 
86
- %div.pagination
86
+ %p.pagination.text-center
87
87
 
88
88
  - pagination_locals = { page_number: page_number, page_size: page_size, pagination_record_count: pagination_record_count, current_page_size: current_page_size }
89
89
  != render :haml, :'index/_pagination', :layout => false, locals: pagination_locals
@@ -12,12 +12,12 @@
12
12
  %th
13
13
  %th.consumer
14
14
  Consumer
15
- %span.glyphicon.glyphicon-sort.relationships-sort
15
+ %span.sort-icon.relationships-sort
16
16
  %th.pact
17
17
 
18
18
  %th.provider
19
19
  Provider
20
- %span.glyphicon.glyphicon-sort.relationships-sort
20
+ %span.sort-icon.relationships-sort
21
21
  %th
22
22
  %th
23
23
  Latest pact<br>published
@@ -44,17 +44,17 @@
44
44
  %td
45
45
  %td{"data-text": index_item.publication_date_of_latest_pact_order}
46
46
  = index_item.publication_date_of_latest_pact
47
- %td{class: index_item.webhook_status}
47
+ %td{class: "table-#{index_item.webhook_status}"}
48
48
  %a{ href: index_item.webhook_url }
49
49
  = index_item.webhook_label
50
50
 
51
- %td{ class: index_item.pseudo_branch_verification_status, title: index_item.verification_tooltip, "data-toggle": "tooltip", "data-placement": "left" }
51
+ %td{ class: "table-#{index_item.pseudo_branch_verification_status}", title: index_item.verification_tooltip, "data-toggle": "tooltip", "data-placement": "left" }
52
52
  %div
53
53
  = index_item.last_verified_date
54
54
  - if index_item.warning?
55
- %span.glyphicon.glyphicon-warning-sign{ 'aria-hidden': true }
55
+ %span.warning-icon{ 'aria-hidden': true }
56
56
  %td
57
- %span.integration-settings.glyphicon.glyphicon-option-horizontal{ 'aria-hidden': true }
57
+ %span.integration-settings.kebab-horizontal{ 'aria-hidden': true }
58
58
  %div.pagination
59
59
 
60
60
  - pagination_locals = { page_number: page_number, page_size: page_size, pagination_record_count: pagination_record_count, current_page_size: current_page_size }
@@ -4,6 +4,6 @@
4
4
  %title= defined?(title) ? title : ""
5
5
  %link{rel: 'shortcut icon', href: "#{base_url}/images/favicon.ico", type:'image/x-icon'}
6
6
  %link{rel: 'stylesheet', href: "#{base_url}/css/bootstrap.min.css"}
7
- %script{type: 'text/javascript', src:"#{base_url}/javascripts/jquery-3.3.1.min.js"}
8
- %script{type: 'text/javascript', src:"#{base_url}/js/bootstrap.min.js"}
7
+ %script{type: 'text/javascript', src:"#{base_url}/javascripts/jquery-3.5.1.min.js"}
8
+ %script{type: 'text/javascript', src:"#{base_url}/js/bootstrap.bundle.min.js"}
9
9
  != yield
@@ -2,11 +2,11 @@
2
2
  %link{rel: 'stylesheet', href: "#{base_url}/css/bootstrap.min.css"}
3
3
  %link{rel: 'stylesheet', href: "#{base_url}/stylesheets/index.css"}
4
4
  %link{rel: 'stylesheet', href: "#{base_url}/stylesheets/matrix.css"}
5
- %script{type: 'text/javascript', src: "#{base_url}/javascripts/jquery-3.3.1.min.js"}
5
+ %script{type: 'text/javascript', src: "#{base_url}/javascripts/jquery-3.5.1.min.js"}
6
6
  %script{type: 'text/javascript', src: "#{base_url}/javascripts/jquery.tablesorter.min.js"}
7
7
  %script{type: 'text/javascript', src: "#{base_url}/javascripts/matrix.js"}
8
8
  %script{type: 'text/javascript', src: "#{base_url}/javascripts/clipboard.js"}
9
- %script{type: 'text/javascript', src: "#{base_url}/js/bootstrap.min.js"}
9
+ %script{type: 'text/javascript', src: "#{base_url}/js/bootstrap.bundle.min.js"}
10
10
 
11
11
  .container
12
12
  .navbar-right
@@ -25,13 +25,14 @@
25
25
  %form{action: "#{base_url}/matrix", onsubmit:'return onSubmit()'}
26
26
  - selectors.each_with_index do | selector, index |
27
27
  .selector
28
- %label{for: "pacticipant#{index}"}
29
- Pacticipant name
30
- %input{name: 'q[]pacticipant', id: "pacticipant1#{index}", class: 'pacticipant_name', value: selector.pacticipant_name}
28
+ .field
29
+ %label{for: "pacticipant#{index}"}
30
+ Pacticipant name
31
31
 
32
- .input-group
32
+ %input{name: 'q[]pacticipant', id: "pacticipant1#{index}", class: 'pacticipant_name', value: selector.pacticipant_name}
33
+
34
+ .field
33
35
 
34
- .input-group
35
36
  %select{ name: "ignorethis#{index}", class: 'version-selectorizor' }
36
37
  %option{ value: 'specify-all-versions', selected: selector.specify_all_versions }
37
38
  All versions
@@ -59,20 +60,18 @@
59
60
  %input{name: 'latest', value: options.latest.to_s, hidden: true}
60
61
 
61
62
 
62
- %div.top-of-group
63
- .input-group
64
- %input{type: 'radio', name: "latestby", class: '', value: '', id: 'all_rows', checked: options.all_rows_checked}
65
- %label{for: 'all_rows'}
66
- Show all results
67
- %div
68
- .input-group
69
- %input{type: 'radio', name: "latestby", class: '', value: 'cvpv', id: 'cvpv', checked: options.cvpv_checked}
70
- %label{for: 'cvpv'}
71
- Show latest result for each consumer version/provider version
72
- %div
63
+ %div.top-of-group.form-check
64
+ %input{type: 'radio', name: "latestby", class: 'form-check-input', value: '', id: 'all_rows', checked: options.all_rows_checked}
65
+ %label{for: 'all_rows', class: "form-check-label"}
66
+ Show all results
67
+ %div.form-check
68
+ %input{type: 'radio', name: "latestby", class: 'form-check-input', value: 'cvpv', id: 'cvpv', checked: options.cvpv_checked}
69
+ %label{for: 'cvpv', class: "form-check-label"}
70
+ Show latest result for each consumer version/provider version
71
+ %div.form-check
73
72
  .input-group
74
- %input{type: 'radio', name: "latestby", class: '', value: 'cvp', id: 'cvp', checked: options.cvp_checked}
75
- %label{for: 'cvp'}
73
+ %input{type: 'radio', name: "latestby", class: 'form-check-input', value: 'cvp', id: 'cvp', checked: options.cvp_checked}
74
+ %label{for: 'cvp', class: "form-check-label"}
76
75
  Show latest result for each consumer version/provider
77
76
  %div.top-of-group
78
77
  - limit_text = "Note that the 'Show latest...' options are summaries of the 'Show all results' query, and that the limit applies to the underlying query, rather than the number of rows returned in the summary."
@@ -90,22 +89,22 @@
90
89
  %tr
91
90
  %th.consumer
92
91
  = "Consumer"
93
- %span.glyphicon.glyphicon-sort.sort
92
+ %span.sort-icon.sort
94
93
  %th.consumer-version
95
94
  = "Consumer Version"
96
- %span.glyphicon.glyphicon-sort.sort
95
+ %span.sort-icon.sort
97
96
  %th.pact-published
98
97
  = "Pact Published"
99
- %span.glyphicon.glyphicon-sort.sort
98
+ %span.sort-icon.sort
100
99
  %th.provider
101
100
  = "Provider"
102
- %span.glyphicon.glyphicon-sort.sort
101
+ %span.sort-icon.sort
103
102
  %th.provider-version
104
103
  = "Provider Version"
105
- %span.glyphicon.glyphicon-sort.sort
104
+ %span.sort-icon.sort
106
105
  %th.verification-result
107
106
  Pact verified
108
- %span.glyphicon.glyphicon-sort.sort
107
+ %span.sort-icon.sort
109
108
  %tbody
110
109
  - lines.each do | line |
111
110
  %tr
@@ -118,16 +117,16 @@
118
117
  = line.display_consumer_version_number
119
118
  - if line.display_consumer_version_number
120
119
  %button.clippy.invisible{ title: "Copy to clipboard" }
121
- %span.glyphicon.glyphicon-copy
120
+ %span.copy-icon
122
121
  - line.latest_consumer_version_tags.each do | tag |
123
122
  .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
124
123
  %a{href: tag.url}
125
- .tag.label.label-primary
124
+ .tag.badge.badge-primary
126
125
  = tag.name
127
126
  - line.other_consumer_version_tags.each do | tag |
128
127
  .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
129
128
  %a{href: tag.url}
130
- .tag.label.label-default
129
+ .tag.badge.badge-secondary
131
130
  = tag.name
132
131
  %td.pact-published{'data-sort-value' => line.pact_published_order, "data-toggle": "tooltip", "title": line.pact_version_sha_message, "data-placement": "right", "data-pact-version-sha": line.pact_version_sha}
133
132
  %a{href: line.pact_publication_date_url}
@@ -145,16 +144,16 @@
145
144
  = line.display_provider_version_number
146
145
  - if line.display_provider_version_number
147
146
  %button.clippy.invisible{ title: "Copy to clipboard" }
148
- %span.glyphicon.glyphicon-copy
147
+ %span.copy-icon
149
148
  - line.latest_provider_version_tags.each do | tag |
150
149
  .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
151
150
  %a{href: tag.url}
152
- .tag.label.label-primary
151
+ .tag.badge.badge-primary
153
152
  = tag.name
154
153
  - line.other_provider_version_tags.each do | tag |
155
154
  .tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
156
155
  %a{href: tag.url}
157
- .tag.label.label-default
156
+ .tag.badge.badge-secondary
158
157
  = tag.name
159
158
  %td.verification-result{class: line.verification_status_class, "title": line.pre_verified_message, "data-toggle": "tooltip", "data-placement": "left"}
160
159
  %a{href: line.verification_status_url}
@@ -163,4 +162,4 @@
163
162
  - else
164
163
  = line.verification_status
165
164
  - if line.pre_verified_message
166
- %span.glyphicon.glyphicon-time.pre-verified-icon{"aria-hidden": true}
165
+ %span.pre-verified-icon{"aria-hidden": true}