pact_broker 2.93.4 → 2.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment.rb +50 -0
- data/lib/pact_broker/api/resources/{can_i_deploy_pacticipant_version.rb → can_i_deploy_pacticipant_version_by_tag_to_tag.rb} +17 -14
- data/lib/pact_broker/api.rb +7 -3
- data/lib/pact_broker/date_helper.rb +0 -4
- data/lib/pact_broker/domain/pact.rb +1 -1
- data/lib/pact_broker/domain/version.rb +7 -0
- data/lib/pact_broker/locale/en.yml +3 -0
- data/lib/pact_broker/matrix/quick_row.rb +11 -9
- data/lib/pact_broker/matrix/repository.rb +6 -5
- data/lib/pact_broker/matrix/unresolved_selector.rb +1 -0
- data/lib/pact_broker/pacts/pacts_for_verification_repository.rb +19 -3
- data/lib/pact_broker/string_refinements.rb +9 -0
- data/lib/pact_broker/ui/controllers/base_controller.rb +8 -0
- data/lib/pact_broker/ui/views/dashboard/show.haml +30 -12
- data/lib/pact_broker/ui/views/matrix/show.haml +8 -8
- data/lib/pact_broker/version.rb +1 -1
- data/lib/pact_broker/versions/repository.rb +8 -0
- data/lib/pact_broker/versions/service.rb +4 -0
- data/vendor/hal-browser/js/hal/views/embedded_resource.js +1 -1
- metadata +4 -4
- data/public/bootstrap.zip +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15cc9869c313dbadd50a4bcc89d3912717cc5f8512af30326b716d2a3cc636ad
|
4
|
+
data.tar.gz: 5d8c0f7240e7b312e096afb75ab8d2f9b91a9f26284be9e90e680bc59615cb02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d223aa03faeac6cda65c71fab594b2bebed430690758ba768b34002e50434acfd556629593909aad8e494e59c26a067abf0243dae0345b482f9f111065e46ff
|
7
|
+
data.tar.gz: db169a6db83b20c37e28bacf7e83975f89fa204e41ed8c75a58708a658b6ae3177f7235a32a54db2138d0a5f9f471a92f3e6934f00d222fa6b8310ba987e55e0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
<a name="v2.94.0"></a>
|
2
|
+
### v2.94.0 (2022-02-22)
|
3
|
+
|
4
|
+
#### Features
|
5
|
+
|
6
|
+
* add can-i-deploy endpoint for checking if the latest version for a branch can be deployed to a particular environment ([34b145e8](/../../commit/34b145e8))
|
7
|
+
* truncate tags, branches and versions in UI when they are super long (#513) ([94bbf915](/../../commit/94bbf915))
|
8
|
+
|
9
|
+
* **integration dashboard**
|
10
|
+
* add copy buttons next to the branch, tag and environment labels ([5b86ac88](/../../commit/5b86ac88))
|
11
|
+
|
12
|
+
#### Bug Fixes
|
13
|
+
|
14
|
+
* Improve Matrix request performance (#537) ([123f8629](/../../commit/123f8629))
|
15
|
+
* Eagerly load pact publication fields (#536) ([c3f6993b](/../../commit/c3f6993b))
|
16
|
+
|
17
|
+
* **hal-browser**
|
18
|
+
* properties accordion should be collapsed by default (#544) ([19466121](/../../commit/19466121))
|
19
|
+
|
1
20
|
<a name="v2.93.4"></a>
|
2
21
|
### v2.93.4 (2022-02-21)
|
3
22
|
|
data/lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require "pact_broker/api/resources/matrix"
|
2
|
+
require "pact_broker/matrix/can_i_deploy_query_schema"
|
3
|
+
require "pact_broker/matrix/parse_can_i_deploy_query"
|
4
|
+
|
5
|
+
module PactBroker
|
6
|
+
module Api
|
7
|
+
module Resources
|
8
|
+
class CanIDeployPacticipantVersionByBranchToEnvironment < Matrix
|
9
|
+
def resource_exists?
|
10
|
+
!!(version && environment)
|
11
|
+
end
|
12
|
+
|
13
|
+
def malformed_request?
|
14
|
+
false
|
15
|
+
end
|
16
|
+
|
17
|
+
def policy_name
|
18
|
+
:'matrix::can_i_deploy'
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def selectors
|
24
|
+
@selectors ||= [
|
25
|
+
PactBroker::Matrix::UnresolvedSelector.new(
|
26
|
+
pacticipant_name: pacticipant_name,
|
27
|
+
latest: true,
|
28
|
+
branch: identifier_from_path[:branch_name]
|
29
|
+
)
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
33
|
+
def options
|
34
|
+
@options ||= {
|
35
|
+
latestby: "cvp",
|
36
|
+
environment_name: identifier_from_path[:environment_name]
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
def version
|
41
|
+
@version ||= version_service.find_latest_by_pacticipant_name_and_branch_name(identifier_from_path[:pacticipant_name], identifier_from_path[:branch_name])
|
42
|
+
end
|
43
|
+
|
44
|
+
def environment
|
45
|
+
@environment ||= environment_service.find_by_name(identifier_from_path[:environment_name])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -5,7 +5,7 @@ require "pact_broker/matrix/parse_can_i_deploy_query"
|
|
5
5
|
module PactBroker
|
6
6
|
module Api
|
7
7
|
module Resources
|
8
|
-
class
|
8
|
+
class CanIDeployPacticipantVersionByTagToTag < Matrix
|
9
9
|
def resource_exists?
|
10
10
|
!!version
|
11
11
|
end
|
@@ -14,26 +14,29 @@ module PactBroker
|
|
14
14
|
:'matrix::can_i_deploy'
|
15
15
|
end
|
16
16
|
|
17
|
+
def malformed_request?
|
18
|
+
false
|
19
|
+
end
|
20
|
+
|
17
21
|
private
|
18
22
|
|
19
23
|
def selectors
|
20
|
-
@selectors ||=
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
24
|
+
@selectors ||= [
|
25
|
+
PactBroker::Matrix::UnresolvedSelector.new(
|
26
|
+
pacticipant_name: pacticipant_name,
|
27
|
+
latest: true,
|
28
|
+
tag: identifier_from_path[:tag],
|
29
|
+
)
|
30
|
+
]
|
31
|
+
|
29
32
|
end
|
30
33
|
|
31
34
|
def options
|
32
35
|
@options ||= {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
latestby: "cvp",
|
37
|
+
latest: true,
|
38
|
+
tag: identifier_from_path[:to]
|
39
|
+
}
|
37
40
|
end
|
38
41
|
|
39
42
|
def version
|
data/lib/pact_broker/api.rb
CHANGED
@@ -81,15 +81,19 @@ module PactBroker
|
|
81
81
|
add ["pacticipants"], Api::Resources::Pacticipants, {resource_name: "pacticipants"}
|
82
82
|
add ["pacticipants", "label", :label_name], PactBroker::Api::Resources::PacticipantsForLabel, {resource_name: "pacticipants_for_label"}
|
83
83
|
add ["pacticipants", :pacticipant_name], Api::Resources::Pacticipant, {resource_name: "pacticipant"}
|
84
|
+
add ["pacticipants", :pacticipant_name, "labels", :label_name], Api::Resources::Label, {resource_name: "pacticipant_label"}
|
85
|
+
|
86
|
+
# Versions
|
84
87
|
add ["pacticipants", :pacticipant_name, "versions"], Api::Resources::Versions, {resource_name: "pacticipant_versions"}
|
85
88
|
add ["pacticipants", :pacticipant_name, "versions", :pacticipant_version_number], Api::Resources::Version, {resource_name: "pacticipant_version"}
|
86
89
|
add ["pacticipants", :pacticipant_name, "latest-version", :tag], Api::Resources::LatestVersion, {resource_name: "latest_tagged_pacticipant_version"}
|
87
|
-
add ["pacticipants", :pacticipant_name, "latest-version", :tag, "can-i-deploy", "to", :to], Api::Resources::
|
88
|
-
add ["pacticipants", :pacticipant_name, "latest-version", :tag, "can-i-deploy", "to", :to, "badge"], Api::Resources::CanIDeployBadge, { resource_name: "
|
90
|
+
add ["pacticipants", :pacticipant_name, "latest-version", :tag, "can-i-deploy", "to", :to], Api::Resources::CanIDeployPacticipantVersionByTagToTag, { resource_name: "can_i_deploy_latest_tagged_version_to_tag" }
|
91
|
+
add ["pacticipants", :pacticipant_name, "latest-version", :tag, "can-i-deploy", "to", :to, "badge"], Api::Resources::CanIDeployBadge, { resource_name: "can_i_deploy_latest_tagged_version_to_tag_badge" }
|
89
92
|
add ["pacticipants", :pacticipant_name, "latest-version"], Api::Resources::LatestVersion, {resource_name: "latest_pacticipant_version"}
|
90
93
|
add ["pacticipants", :pacticipant_name, "versions", :pacticipant_version_number, "tags", :tag_name], Api::Resources::Tag, {resource_name: "pacticipant_version_tag"}
|
91
|
-
add ["pacticipants", :pacticipant_name, "labels", :label_name], Api::Resources::Label, {resource_name: "pacticipant_label"}
|
92
94
|
add ["pacticipants", :pacticipant_name, "branches", :branch_name, "versions", :version_number], Api::Resources::BranchVersion, { resource_name: "branch_version" }
|
95
|
+
add ["pacticipants", :pacticipant_name, "branches", :branch_name, "latest-version", "can-i-deploy", "to-environment", :environment_name], Api::Resources::CanIDeployPacticipantVersionByBranchToEnvironment, { resource_name: "can_i_deploy_latest_branch_version_to_environment" }
|
96
|
+
#add ["pacticipants", :pacticipant_name, "branches", :branch_name, "latest-version", "can-i-deploy", "to-environment", :environment_name, "badge"], Api::Resources::CanIDeployPacticipantVersionByBranchToEnvironment, { resource_name: "can_i_deploy_latest_branch_version_to_environment_badge" }
|
93
97
|
|
94
98
|
# Webhooks
|
95
99
|
add ["webhooks", "provider", :provider_name, "consumer", :consumer_name ], Api::Resources::PacticipantWebhooks, {resource_name: "pacticipant_webhooks"}
|
@@ -4,7 +4,6 @@ module PactBroker
|
|
4
4
|
extend self
|
5
5
|
|
6
6
|
# Ripped from actionview/lib/action_view/helpers/date_helper.rb
|
7
|
-
|
8
7
|
def local_date_in_words datetime
|
9
8
|
datetime.to_time.localtime.to_datetime.strftime("%a %d %b %Y, %l:%M%P %:z").gsub(" ", " ")
|
10
9
|
end
|
@@ -31,9 +30,6 @@ module PactBroker
|
|
31
30
|
distance_in_minutes = ((to_time - from_time)/60.0).round
|
32
31
|
distance_in_seconds = (to_time - from_time).round
|
33
32
|
|
34
|
-
# require 'pry'; pry(binding);
|
35
|
-
|
36
|
-
# locale = I18n.with_options :locale => options[:locale], :scope => options[:scope]
|
37
33
|
locale = Locale.new(:locale => options[:locale], :scope => options[:scope])
|
38
34
|
case distance_in_minutes
|
39
35
|
when 0..1
|
@@ -241,6 +241,13 @@ module PactBroker
|
|
241
241
|
end
|
242
242
|
# rubocop: enable Metrics/CyclomaticComplexity
|
243
243
|
|
244
|
+
def pacticipants_set
|
245
|
+
from_self(alias: :v)
|
246
|
+
.select_group(Sequel[:v][:pacticipant_id])
|
247
|
+
.collect(&:pacticipant_id)
|
248
|
+
.to_set
|
249
|
+
end
|
250
|
+
|
244
251
|
# private
|
245
252
|
|
246
253
|
def calculate_max_version_order_and_join_back_to_versions(query, selector)
|
@@ -124,6 +124,9 @@ en:
|
|
124
124
|
datetime:
|
125
125
|
distance_in_words:
|
126
126
|
half_a_minute: "half a minute"
|
127
|
+
less_than_x_minutes:
|
128
|
+
one: "less than 1 minute"
|
129
|
+
other: "less than %{count} minutes"
|
127
130
|
less_than_x_seconds:
|
128
131
|
one: "less than 1 second"
|
129
132
|
other: "less than %{count} seconds"
|
@@ -124,15 +124,17 @@ module PactBroker
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def eager_all_the_things
|
127
|
-
eager(
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
127
|
+
eager(
|
128
|
+
:consumer,
|
129
|
+
:provider,
|
130
|
+
:verification,
|
131
|
+
:pact_publication,
|
132
|
+
:pact_version,
|
133
|
+
consumer_version: { current_deployed_versions: :environment, current_supported_released_versions: :environment, branch_versions: [:branch_head, :version, branch: :pacticipant] },
|
134
|
+
provider_version: { current_deployed_versions: :environment, current_supported_released_versions: :environment, branch_versions: [:branch_head, :version, branch: :pacticipant] },
|
135
|
+
consumer_version_tags: { version: :pacticipant },
|
136
|
+
provider_version_tags: { version: :pacticipant }
|
137
|
+
)
|
136
138
|
end
|
137
139
|
|
138
140
|
def default_scope
|
@@ -127,20 +127,19 @@ module PactBroker
|
|
127
127
|
def integrations_where_specified_selector_is_provider(resolved_specified_selectors, options)
|
128
128
|
integrations_involving_specified_providers = PactBroker::Integrations::Integration
|
129
129
|
.where(provider_id: resolved_specified_selectors.collect(&:pacticipant_id))
|
130
|
-
.eager(:consumer)
|
130
|
+
.eager(:consumer, :provider)
|
131
131
|
.all
|
132
132
|
|
133
133
|
destination_selector = PactBroker::Matrix::UnresolvedSelector.new(options.slice(:latest, :tag, :branch, :environment_name).compact)
|
134
|
+
required = PactBroker::Domain::Version.for_selector(destination_selector).pacticipants_set
|
134
135
|
|
135
136
|
integrations_involving_specified_providers.collect do | integration |
|
136
|
-
required = PactBroker::Domain::Version.where(pacticipant: integration.consumer).for_selector(destination_selector).any?
|
137
|
-
|
138
137
|
Integration.from_hash(
|
139
138
|
consumer_id: integration.consumer.id,
|
140
139
|
consumer_name: integration.consumer.name,
|
141
140
|
provider_id: integration.provider.id,
|
142
141
|
provider_name: integration.provider.name,
|
143
|
-
required: required
|
142
|
+
required: required.member?(integration.consumer.id)
|
144
143
|
)
|
145
144
|
end
|
146
145
|
end
|
@@ -221,8 +220,10 @@ module PactBroker
|
|
221
220
|
|
222
221
|
# Find the version number for selectors with the latest and/or tag specified
|
223
222
|
def resolve_versions_and_add_ids(unresolved_selectors, selector_type, resolved_ignore_selectors = [])
|
223
|
+
names = unresolved_selectors.collect(&:pacticipant_name)
|
224
|
+
pacticipants = PactBroker::Domain::Pacticipant.where(name: names).to_a.group_by(&:name).transform_values(&:first)
|
224
225
|
unresolved_selectors.collect do | unresolved_selector |
|
225
|
-
pacticipant =
|
226
|
+
pacticipant = pacticipants[unresolved_selector.pacticipant_name]
|
226
227
|
if pacticipant
|
227
228
|
versions = find_versions_for_selector(unresolved_selector)
|
228
229
|
build_resolved_selectors(pacticipant, versions, unresolved_selector, selector_type, resolved_ignore_selectors)
|
@@ -19,6 +19,13 @@ module PactBroker
|
|
19
19
|
include PactBroker::Repositories::Helpers
|
20
20
|
include PactBroker::Repositories::Scopes
|
21
21
|
|
22
|
+
PUBLICATION_ASSOCIATIONS_FOR_EAGER_LOAD = [
|
23
|
+
:provider,
|
24
|
+
:consumer,
|
25
|
+
:consumer_version,
|
26
|
+
pact_version: :latest_verification
|
27
|
+
]
|
28
|
+
|
22
29
|
def find(provider_name, consumer_version_selectors)
|
23
30
|
selected_pacts = find_pacts_by_selector(provider_name, consumer_version_selectors)
|
24
31
|
selected_pacts = selected_pacts + find_pacts_for_fallback_tags(selected_pacts, provider_name, consumer_version_selectors)
|
@@ -104,7 +111,7 @@ module PactBroker
|
|
104
111
|
|
105
112
|
specified_selectors_or_defaults(consumer_version_selectors, provider).flat_map do | selector |
|
106
113
|
query = scope_for(PactPublication).for_provider_and_consumer_version_selector(provider, selector)
|
107
|
-
query.all.collect do | pact_publication |
|
114
|
+
query.eager(*PUBLICATION_ASSOCIATIONS_FOR_EAGER_LOAD).all.collect do | pact_publication |
|
108
115
|
create_selected_pact(pact_publication, selector)
|
109
116
|
end
|
110
117
|
end
|
@@ -265,7 +272,12 @@ module PactBroker
|
|
265
272
|
log_pact_publications("Ignoring pacts successfully verified by another provider branch when not WIP", verified_by_other_branch)
|
266
273
|
end
|
267
274
|
|
268
|
-
PactPublication.subtract(
|
275
|
+
PactPublication.subtract(
|
276
|
+
pact_publications_query.eager(*PUBLICATION_ASSOCIATIONS_FOR_EAGER_LOAD).all,
|
277
|
+
specified_explicitly.all,
|
278
|
+
verified_by_this_branch.all,
|
279
|
+
verified_by_other_branch.all
|
280
|
+
)
|
269
281
|
end
|
270
282
|
|
271
283
|
def remove_non_wip_for_tag(pact_publications_query, provider, tag, specified_pact_version_shas)
|
@@ -279,7 +291,11 @@ module PactBroker
|
|
279
291
|
log_pact_publications("Ignoring pacts successfully verified by another provider tag when not WIP", verified_by_another_tag)
|
280
292
|
end
|
281
293
|
|
282
|
-
PactPublication.subtract(
|
294
|
+
PactPublication.subtract(
|
295
|
+
pact_publications_query.eager(*PUBLICATION_ASSOCIATIONS_FOR_EAGER_LOAD).all,
|
296
|
+
specified_explicitly.all,
|
297
|
+
verified_by_this_tag.all,
|
298
|
+
verified_by_another_tag.all)
|
283
299
|
end
|
284
300
|
|
285
301
|
def collect_consumer_name_and_version_number(pact_publications_query)
|
@@ -55,6 +55,15 @@ module PactBroker
|
|
55
55
|
|
56
56
|
str
|
57
57
|
end
|
58
|
+
|
59
|
+
# Adopt from https://stackoverflow.com/questions/1451384/how-can-i-center-truncate-a-string
|
60
|
+
def ellipsisize(minimum_length: 20, edge_length: 10)
|
61
|
+
return self if self.length < minimum_length || self.length <= edge_length * 2
|
62
|
+
|
63
|
+
edge = "." * edge_length
|
64
|
+
mid_length = self.length - edge_length * 2
|
65
|
+
gsub(/(#{edge}).{#{mid_length},}(#{edge})/, '\1...\2')
|
66
|
+
end
|
58
67
|
end
|
59
68
|
end
|
60
69
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require "padrino-core"
|
2
2
|
require "haml"
|
3
3
|
require "pact_broker/services"
|
4
|
+
require "pact_broker/string_refinements"
|
4
5
|
|
5
6
|
module PactBroker
|
6
7
|
module UI
|
7
8
|
module Controllers
|
8
9
|
class Base < Padrino::Application
|
10
|
+
using PactBroker::StringRefinements
|
9
11
|
|
10
12
|
set :root, File.join(File.dirname(__FILE__), "..")
|
11
13
|
set :show_exceptions, ENV["RACK_ENV"] != "production"
|
@@ -18,6 +20,12 @@ module PactBroker
|
|
18
20
|
# rather than request.base_url, which uses the X-Forwarded headers.
|
19
21
|
env["pactbroker.base_url"] || ""
|
20
22
|
end
|
23
|
+
|
24
|
+
helpers do
|
25
|
+
def ellipsisize(string)
|
26
|
+
string.ellipsisize
|
27
|
+
end
|
28
|
+
end
|
21
29
|
end
|
22
30
|
end
|
23
31
|
end
|
@@ -86,16 +86,25 @@
|
|
86
86
|
%span.copy-icon
|
87
87
|
- if view == "branch" || view == "all"
|
88
88
|
- index_item.consumer_version_branch_heads.each do | branch_head |
|
89
|
-
%div{"
|
90
|
-
|
89
|
+
%div.clippable{"data-clippable": branch_head.branch_name}
|
90
|
+
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
91
|
+
= "branch: " + ellipsisize(branch_head.branch_name)
|
92
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
93
|
+
%span.copy-icon
|
91
94
|
- if view == "tag" || view == "all"
|
92
95
|
- index_item.consumer_version_latest_tag_names.each do | tag_name |
|
93
|
-
.
|
94
|
-
|
96
|
+
%div.clippable{"data-clippable": tag_name}
|
97
|
+
.tag.badge.badge-primary
|
98
|
+
= "tag: " + ellipsisize(tag_name)
|
99
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
100
|
+
%span.copy-icon
|
95
101
|
- if view == "environment" || view == "all"
|
96
102
|
- index_item.consumer_version_environment_names.each do | environment_name |
|
97
|
-
.
|
98
|
-
|
103
|
+
%div.clippable{"data-clippable": environment_name}
|
104
|
+
.tag.badge.badge-success
|
105
|
+
= "env: " + ellipsisize(environment_name)
|
106
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
107
|
+
%span.copy-icon
|
99
108
|
- if view == "all" && index_item.display_latest_label? && index_item.latest?
|
100
109
|
.tag.badge.bg-light
|
101
110
|
latest
|
@@ -107,16 +116,25 @@
|
|
107
116
|
%span.copy-icon
|
108
117
|
- if view == "branch" || view == "all"
|
109
118
|
- index_item.provider_version_branch_heads.each do | branch_head |
|
110
|
-
%div{"
|
111
|
-
|
119
|
+
%div.clippable{"data-clippable": branch_head.branch_name}
|
120
|
+
%div{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
121
|
+
= "branch: " + ellipsisize(branch_head.branch_name)
|
122
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
123
|
+
%span.copy-icon
|
112
124
|
- if view == "tag" || view == "all"
|
113
125
|
- index_item.provider_version_latest_tag_names.each do | tag_name |
|
114
|
-
.
|
115
|
-
|
126
|
+
%div.clippable{"data-clippable": tag_name}
|
127
|
+
.tag.badge.badge-primary
|
128
|
+
= "tag: " + ellipsisize(tag_name)
|
129
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
130
|
+
%span.copy-icon
|
116
131
|
- if view == "environment" || view == "all"
|
117
132
|
- index_item.provider_version_environment_names.each do | environment_name |
|
118
|
-
.
|
119
|
-
|
133
|
+
%div.clippable{"data-clippable": environment_name}
|
134
|
+
.tag.badge.badge-success
|
135
|
+
= "env: " + ellipsisize(environment_name)
|
136
|
+
%button.clippy.invisible{ title: "Copy to clipboard" }
|
137
|
+
%span.copy-icon
|
120
138
|
%td.pact
|
121
139
|
%span.pact
|
122
140
|
%a{ href: index_item.pact_url, title: "View pact" }
|
@@ -145,22 +145,22 @@
|
|
145
145
|
.tag-parent{"title": branch.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
146
146
|
- branch_class = branch.latest? ? "tag badge badge-dark" : "tag badge badge-secondary"
|
147
147
|
%div{"class": branch_class}
|
148
|
-
= "branch: " + branch.name
|
148
|
+
= "branch: " + ellipsisize(branch.name)
|
149
149
|
- line.consumer_versions_in_environments.each do | version_in_environment |
|
150
150
|
.tag-parent{"title": version_in_environment.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
151
151
|
%a{href: version_in_environment.url}
|
152
152
|
.tag.badge.badge-success
|
153
|
-
= "env: " + version_in_environment.environment_name
|
153
|
+
= "env: " + ellipsisize(version_in_environment.environment_name)
|
154
154
|
- line.latest_consumer_version_tags.each do | tag |
|
155
155
|
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
156
156
|
%a{href: tag.url}
|
157
157
|
.tag.badge.badge-primary
|
158
|
-
= "tag: " + tag.name
|
158
|
+
= "tag: " + ellipsisize(tag.name)
|
159
159
|
- line.other_consumer_version_tags.each do | tag |
|
160
160
|
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
161
161
|
%a{href: tag.url}
|
162
162
|
.tag.badge.badge-secondary
|
163
|
-
= "tag: " + tag.name
|
163
|
+
= "tag: " + ellipsisize(tag.name)
|
164
164
|
%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}
|
165
165
|
%a{href: line.pact_publication_date_url}
|
166
166
|
- if options.all_rows_checked
|
@@ -182,22 +182,22 @@
|
|
182
182
|
.tag-parent{"title": branch.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
183
183
|
- branch_class = branch.latest? ? "tag badge badge-dark" : "tag badge badge-secondary"
|
184
184
|
%div{"class": branch_class}
|
185
|
-
= "branch: " + branch.name
|
185
|
+
= "branch: " + ellipsisize(branch.name)
|
186
186
|
- line.provider_versions_in_environments.each do | version_in_environment |
|
187
187
|
.tag-parent{"title": version_in_environment.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
188
188
|
%a{href: version_in_environment.url}
|
189
189
|
.tag.badge.badge-success
|
190
|
-
= "env: " + version_in_environment.environment_name
|
190
|
+
= "env: " + ellipsisize(version_in_environment.environment_name)
|
191
191
|
- line.latest_provider_version_tags.each do | tag |
|
192
192
|
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
193
193
|
%a{href: tag.url}
|
194
194
|
.tag.badge.badge-primary
|
195
|
-
= "tag:" + tag.name
|
195
|
+
= "tag:" + ellipsisize(tag.name)
|
196
196
|
- line.other_provider_version_tags.each do | tag |
|
197
197
|
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
|
198
198
|
%a{href: tag.url}
|
199
199
|
.tag.badge.badge-secondary
|
200
|
-
= "tag: " + tag.name
|
200
|
+
= "tag: " + ellipsisize(tag.name)
|
201
201
|
%td.verification-result{class: line.verification_status_class, "title": line.pre_verified_message, "data-toggle": "tooltip", "data-placement": "left"}
|
202
202
|
%a{href: line.verification_status_url}
|
203
203
|
- if options.all_rows_checked && line.number
|
data/lib/pact_broker/version.rb
CHANGED
@@ -27,6 +27,14 @@ module PactBroker
|
|
27
27
|
.first
|
28
28
|
end
|
29
29
|
|
30
|
+
def find_latest_by_pacticipant_name_and_branch_name(pacticipant_name, branch_name)
|
31
|
+
branch_heads_join = { Sequel[:versions][:id] => Sequel[:branch_heads][:version_id], Sequel[:branch_heads][:branch_name] => branch_name }
|
32
|
+
PactBroker::Domain::Version
|
33
|
+
.where_pacticipant_name(pacticipant_name)
|
34
|
+
.join(:branch_heads, branch_heads_join)
|
35
|
+
.single_record
|
36
|
+
end
|
37
|
+
|
30
38
|
def find_by_pacticipant_name_and_tag pacticipant_name, tag
|
31
39
|
PactBroker::Domain::Version
|
32
40
|
.select_all_qualified
|
@@ -22,6 +22,10 @@ module PactBroker
|
|
22
22
|
version_repository.find_by_pacticipant_name_and_latest_tag(pacticipant_name, tag)
|
23
23
|
end
|
24
24
|
|
25
|
+
def self.find_latest_by_pacticipant_name_and_branch_name(pacticipant_name, branch_name)
|
26
|
+
version_repository.find_latest_by_pacticipant_name_and_branch_name(pacticipant_name, branch_name)
|
27
|
+
end
|
28
|
+
|
25
29
|
def self.create_or_overwrite(pacticipant_name, version_number, version)
|
26
30
|
pacticipant = pacticipant_repository.find_by_name_or_create(pacticipant_name)
|
27
31
|
version = version_repository.create_or_overwrite(pacticipant, version_number, version)
|
@@ -53,7 +53,7 @@ HAL.Views.EmbeddedResource = Backbone.View.extend({
|
|
53
53
|
$inner.append(embeddedResourcesView.el);
|
54
54
|
}
|
55
55
|
|
56
|
-
this.$accordionBody = $('<div class="accordion-body"></div>');
|
56
|
+
this.$accordionBody = $('<div class="accordion-body collapse"></div>');
|
57
57
|
this.$accordionBody.append($inner)
|
58
58
|
|
59
59
|
this.$el.append(this.$accordionBody);
|
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.
|
4
|
+
version: 2.94.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: 2022-02-
|
13
|
+
date: 2022-02-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -701,7 +701,8 @@ files:
|
|
701
701
|
- lib/pact_broker/api/resources/branch_version.rb
|
702
702
|
- lib/pact_broker/api/resources/can_i_deploy.rb
|
703
703
|
- lib/pact_broker/api/resources/can_i_deploy_badge.rb
|
704
|
-
- lib/pact_broker/api/resources/
|
704
|
+
- lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_branch_to_environment.rb
|
705
|
+
- lib/pact_broker/api/resources/can_i_deploy_pacticipant_version_by_tag_to_tag.rb
|
705
706
|
- lib/pact_broker/api/resources/clean.rb
|
706
707
|
- lib/pact_broker/api/resources/currently_deployed_versions_for_environment.rb
|
707
708
|
- lib/pact_broker/api/resources/currently_supported_versions_for_environment.rb
|
@@ -1099,7 +1100,6 @@ files:
|
|
1099
1100
|
- pact_broker.gemspec
|
1100
1101
|
- public/Network Graph_files/d3.v3.js
|
1101
1102
|
- public/Network Graph_files/ga.js
|
1102
|
-
- public/bootstrap.zip
|
1103
1103
|
- public/config.json
|
1104
1104
|
- public/css/bootstrap-grid.css
|
1105
1105
|
- public/css/bootstrap-grid.css.map
|
data/public/bootstrap.zip
DELETED
Binary file
|