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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.optic/.gitignore +2 -0
- data/.optic/api/specification.json +1 -0
- data/.optic/ignore +14 -0
- data/CHANGELOG.md +66 -0
- data/DEVELOPER_SETUP.md +9 -0
- data/Dockerfile +1 -0
- data/ISSUES.md +3 -3
- data/README.md +1 -1
- data/config/database.yml +1 -1
- data/db/migrations/20210115_add_webhook_foreign_key_indexes.rb +49 -0
- data/db/migrations/20210116_add_context_to_triggered_webhook.rb +11 -0
- data/db/migrations/migration_helper.rb +8 -0
- data/docker-compose-issue-repro-with-pact-broker-docker-image.yml +33 -0
- data/docker-compose-test.yml +4 -4
- data/lib/db.rb +1 -0
- data/lib/pact_broker/api.rb +13 -2
- data/lib/pact_broker/api/decorators.rb +3 -7
- data/lib/pact_broker/api/decorators/configuration.rb +33 -0
- data/lib/pact_broker/api/decorators/decorator_context_creator.rb +13 -0
- data/lib/pact_broker/api/decorators/extended_pact_decorator.rb +9 -1
- data/lib/pact_broker/api/decorators/extended_verification_decorator.rb +8 -0
- data/lib/pact_broker/api/decorators/matrix_decorator.rb +9 -4
- data/lib/pact_broker/api/decorators/pact_collection_decorator.rb +1 -0
- data/lib/pact_broker/api/decorators/pacticipant_collection_decorator.rb +2 -3
- data/lib/pact_broker/api/decorators/reason_decorator.rb +2 -0
- data/lib/pact_broker/api/decorators/tag_decorator.rb +0 -3
- data/lib/pact_broker/api/decorators/verifiable_pact_decorator.rb +3 -1
- data/lib/pact_broker/api/pact_broker_urls.rb +4 -4
- data/lib/pact_broker/api/paths.rb +5 -0
- data/lib/pact_broker/api/renderers/html_pact_renderer.rb +2 -2
- data/lib/pact_broker/api/resources/all_webhooks.rb +3 -3
- data/lib/pact_broker/api/resources/can_i_deploy_badge.rb +1 -1
- data/lib/pact_broker/api/resources/dashboard.rb +2 -2
- data/lib/pact_broker/api/resources/default_base_resource.rb +37 -12
- data/lib/pact_broker/api/resources/error_handler.rb +1 -1
- data/lib/pact_broker/api/resources/error_response_body_generator.rb +41 -0
- data/lib/pact_broker/api/resources/group.rb +1 -1
- data/lib/pact_broker/api/resources/integrations.rb +1 -1
- data/lib/pact_broker/api/resources/label.rb +1 -1
- data/lib/pact_broker/api/resources/latest_pact.rb +2 -2
- data/lib/pact_broker/api/resources/latest_pacts.rb +1 -1
- data/lib/pact_broker/api/resources/latest_verifications_for_consumer_version.rb +2 -2
- data/lib/pact_broker/api/resources/matrix.rb +2 -2
- data/lib/pact_broker/api/resources/matrix_for_consumer_and_provider.rb +1 -1
- data/lib/pact_broker/api/resources/metadata_resource_methods.rb +2 -1
- data/lib/pact_broker/api/resources/pact.rb +2 -2
- data/lib/pact_broker/api/resources/pact_triggered_webhooks.rb +1 -1
- data/lib/pact_broker/api/resources/pact_versions.rb +1 -1
- data/lib/pact_broker/api/resources/pact_webhooks.rb +3 -3
- data/lib/pact_broker/api/resources/pact_webhooks_status.rb +2 -2
- data/lib/pact_broker/api/resources/pacticipant.rb +1 -1
- data/lib/pact_broker/api/resources/pacticipants.rb +3 -3
- data/lib/pact_broker/api/resources/pacticipants_for_label.rb +1 -1
- data/lib/pact_broker/api/resources/previous_distinct_pact_version.rb +1 -1
- data/lib/pact_broker/api/resources/provider_pacts.rb +1 -7
- data/lib/pact_broker/api/resources/provider_pacts_for_verification.rb +2 -2
- data/lib/pact_broker/api/resources/relationships.rb +1 -1
- data/lib/pact_broker/api/resources/tag.rb +1 -1
- data/lib/pact_broker/api/resources/tagged_pact_versions.rb +1 -1
- data/lib/pact_broker/api/resources/verification.rb +2 -2
- data/lib/pact_broker/api/resources/verification_triggered_webhooks.rb +1 -1
- data/lib/pact_broker/api/resources/verifications.rb +1 -1
- data/lib/pact_broker/api/resources/version.rb +1 -1
- data/lib/pact_broker/api/resources/versions.rb +1 -1
- data/lib/pact_broker/api/resources/webhook.rb +2 -2
- data/lib/pact_broker/api/resources/webhook_execution.rb +4 -4
- data/lib/pact_broker/api/resources/webhook_execution_methods.rb +1 -3
- data/lib/pact_broker/api/resources/webhooks.rb +3 -3
- data/lib/pact_broker/app.rb +14 -3
- data/lib/pact_broker/application_context.rb +41 -0
- data/lib/pact_broker/configuration.rb +12 -4
- data/lib/pact_broker/doc/controllers/app.rb +3 -2
- data/lib/pact_broker/domain/version.rb +13 -6
- data/lib/pact_broker/domain/webhook_request.rb +1 -1
- data/lib/pact_broker/error.rb +0 -2
- data/lib/pact_broker/errors.rb +28 -0
- data/lib/pact_broker/errors/error_logger.rb +25 -0
- data/lib/pact_broker/metrics/service.rb +12 -1
- data/lib/pact_broker/pacts/metadata.rb +53 -8
- data/lib/pact_broker/pacts/repository.rb +10 -17
- data/lib/pact_broker/pacts/selector.rb +22 -0
- data/lib/pact_broker/pacts/selectors.rb +4 -0
- data/lib/pact_broker/services.rb +106 -31
- data/lib/pact_broker/tags/tag_with_latest_flag.rb +2 -0
- data/lib/pact_broker/test/http_test_data_builder.rb +83 -21
- data/lib/pact_broker/test/test_data_builder.rb +3 -2
- data/lib/pact_broker/ui/views/index/_getting-started.haml +1 -1
- data/lib/pact_broker/ui/views/index/show-with-tags.haml +16 -16
- data/lib/pact_broker/ui/views/index/show.haml +6 -6
- data/lib/pact_broker/ui/views/layouts/main.haml +2 -2
- data/lib/pact_broker/ui/views/matrix/show.haml +32 -33
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/webhooks/execution_configuration.rb +4 -0
- data/lib/pact_broker/webhooks/execution_configuration_creator.rb +14 -0
- data/lib/pact_broker/webhooks/repository.rb +3 -2
- data/lib/pact_broker/webhooks/service.rb +2 -1
- data/lib/pact_broker/webhooks/triggered_webhook.rb +1 -0
- data/lib/rack/pact_broker/hal_browser_redirect.rb +42 -0
- data/lib/rack/pact_broker/set_base_url.rb +22 -0
- data/lib/sequel/extensions/statement_timeout.rb +22 -0
- data/optic.yml +5 -0
- data/pact_broker.gemspec +1 -1
- data/public/css/bootstrap-grid.css +3719 -0
- data/public/css/bootstrap-grid.css.map +1 -0
- data/public/css/bootstrap-grid.min.css +7 -0
- data/public/css/bootstrap-grid.min.css.map +1 -0
- data/public/css/bootstrap-reboot.css +331 -0
- data/public/css/bootstrap-reboot.css.map +1 -0
- data/public/css/bootstrap-reboot.min.css +8 -0
- data/public/css/bootstrap-reboot.min.css.map +1 -0
- data/public/css/bootstrap.css +8885 -5604
- data/public/css/bootstrap.css.map +1 -1
- data/public/css/bootstrap.min.css +4 -3
- data/public/css/bootstrap.min.css.map +1 -1
- data/public/images/alert.svg +1 -0
- data/public/images/arrow-switch.svg +1 -0
- data/public/images/check.svg +1 -0
- data/public/images/clock.svg +1 -0
- data/public/images/copy.svg +1 -0
- data/public/images/kebab-horizontal.svg +1 -0
- data/public/javascripts/clipboard.js +3 -3
- data/public/javascripts/{jquery-3.3.1.js → jquery-3.5.1.js} +1150 -642
- data/public/javascripts/jquery-3.5.1.min.js +2 -0
- data/public/javascripts/jquery-3.5.1.min.map +1 -0
- data/public/javascripts/matrix.js +2 -2
- data/public/js/bootstrap.bundle.js +7013 -0
- data/public/js/bootstrap.bundle.js.map +1 -0
- data/public/js/bootstrap.bundle.min.js +7 -0
- data/public/js/bootstrap.bundle.min.js.map +1 -0
- data/public/js/bootstrap.js +3862 -1804
- data/public/js/bootstrap.js.map +1 -0
- data/public/js/bootstrap.min.js +6 -6
- data/public/js/bootstrap.min.js.map +1 -0
- data/public/stylesheets/index.css +56 -3
- data/public/stylesheets/matrix.css +55 -5
- data/public/stylesheets/pact.css +14 -0
- data/regression/.gitignore +1 -0
- data/regression/can_i_deploy_spec.rb +42 -0
- data/regression/regression_helper.rb +37 -0
- data/regression/script/approval-all.sh +6 -0
- data/script/exercise-api-for-optic.sh +3 -0
- data/script/reproduce-issue-starting-up.rb +43 -0
- data/script/reproduce-issue.rb +9 -21
- data/spec/lib/pact_broker/api/decorators/extended_pact_decorator_spec.rb +1 -0
- data/spec/lib/pact_broker/api/decorators/matrix_decorator_spec.rb +20 -8
- data/spec/lib/pact_broker/api/decorators/verifiable_pact_decorator_spec.rb +5 -7
- data/spec/lib/pact_broker/api/pact_broker_urls_spec.rb +10 -6
- data/spec/lib/pact_broker/api/resources/can_i_deploy_badge_spec.rb +1 -1
- data/spec/lib/pact_broker/api/resources/default_base_resource_spec.rb +59 -10
- data/spec/lib/pact_broker/api/resources/error_response_body_generator_spec.rb +69 -0
- data/spec/lib/pact_broker/db/log_quietener_spec.rb +1 -1
- data/spec/lib/pact_broker/doc/controllers/app_spec.rb +3 -5
- data/spec/lib/pact_broker/errors/error_logger_spec.rb +62 -0
- data/spec/lib/pact_broker/errors_spec.rb +55 -0
- data/spec/lib/pact_broker/pacts/metadata_spec.rb +73 -0
- data/spec/lib/pact_broker/pacts/repository_find_for_verification_fallback_spec.rb +2 -2
- data/spec/lib/pact_broker/pacts/repository_find_for_verification_spec.rb +33 -13
- data/spec/lib/pact_broker/pacts/selected_pact_spec.rb +23 -0
- data/spec/lib/pact_broker/webhooks/repository_spec.rb +5 -2
- data/spec/lib/pact_broker/webhooks/service_spec.rb +2 -1
- data/spec/lib/rack/pact_broker/hal_browser_redirect_spec.rb +27 -0
- data/tasks/rspec.rake +6 -0
- metadata +65 -17
- data/public/css/bootstrap-theme.css +0 -587
- data/public/css/bootstrap-theme.css.map +0 -1
- data/public/css/bootstrap-theme.min.css +0 -6
- data/public/css/bootstrap-theme.min.css.map +0 -1
- data/public/fonts/glyphicons-halflings-regular.svg +0 -288
- data/public/javascripts/jquery-3.3.1.min.js +0 -2
- data/public/javascripts/jquery-3.3.1.min.map +0 -1
- 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
|
-
|
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
|
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("
|
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 = "
|
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("
|
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
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
-
|
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 "
|
116
|
-
|
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("
|
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
|
-
|
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
|
-
|
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/
|
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.
|
14
|
+
%span.sort-icon.relationships-sort
|
15
15
|
%th.consumer-version-number
|
16
16
|
Consumer<br>Version
|
17
|
-
%span.
|
17
|
+
%span.sort-icon.relationships-sort
|
18
18
|
%th.pact{ style: 'width: 40px' }
|
19
19
|
%th.provider
|
20
20
|
Provider
|
21
|
-
%span.
|
21
|
+
%span.sort-icon.relationships-sort
|
22
22
|
%th.provider-version-number
|
23
23
|
Provider<br>Version
|
24
|
-
%span.
|
24
|
+
%span.sort-icon.relationships-sort
|
25
25
|
%th
|
26
26
|
Published
|
27
|
-
%span.
|
27
|
+
%span.sort-icon.relationships-sort
|
28
28
|
%th
|
29
29
|
Webhook<br>status
|
30
30
|
%th
|
31
31
|
Last<br>verified
|
32
|
-
%span.
|
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.
|
46
|
+
%span.copy-icon
|
47
47
|
- if index_item.latest?
|
48
|
-
.tag.
|
48
|
+
.tag.badge.badge-success
|
49
49
|
latest
|
50
50
|
- index_item.consumer_version_latest_tag_names.each do | tag_name |
|
51
|
-
.tag.
|
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.
|
66
|
+
%span.copy-icon
|
67
67
|
- index_item.provider_version_latest_tag_names.each do | tag_name |
|
68
|
-
.tag.
|
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.
|
81
|
+
%span.warning-icon{ 'aria-hidden': true }
|
82
82
|
%td
|
83
83
|
- if index_item.show_settings?
|
84
|
-
%span.integration-settings.
|
84
|
+
%span.integration-settings.kebab-horizontal{ 'aria-hidden': true }
|
85
85
|
|
86
|
-
%
|
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.
|
15
|
+
%span.sort-icon.relationships-sort
|
16
16
|
%th.pact
|
17
17
|
|
18
18
|
%th.provider
|
19
19
|
Provider
|
20
|
-
%span.
|
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.
|
55
|
+
%span.warning-icon{ 'aria-hidden': true }
|
56
56
|
%td
|
57
|
-
%span.integration-settings.
|
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.
|
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.
|
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
|
-
|
29
|
-
|
30
|
-
|
28
|
+
.field
|
29
|
+
%label{for: "pacticipant#{index}"}
|
30
|
+
Pacticipant name
|
31
31
|
|
32
|
-
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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.
|
92
|
+
%span.sort-icon.sort
|
94
93
|
%th.consumer-version
|
95
94
|
= "Consumer Version"
|
96
|
-
%span.
|
95
|
+
%span.sort-icon.sort
|
97
96
|
%th.pact-published
|
98
97
|
= "Pact Published"
|
99
|
-
%span.
|
98
|
+
%span.sort-icon.sort
|
100
99
|
%th.provider
|
101
100
|
= "Provider"
|
102
|
-
%span.
|
101
|
+
%span.sort-icon.sort
|
103
102
|
%th.provider-version
|
104
103
|
= "Provider Version"
|
105
|
-
%span.
|
104
|
+
%span.sort-icon.sort
|
106
105
|
%th.verification-result
|
107
106
|
Pact verified
|
108
|
-
%span.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
165
|
+
%span.pre-verified-icon{"aria-hidden": true}
|