pact_broker 2.93.4 → 2.94.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd8313de32ee72fbd7202e9279130983eeccf2d5bc9c6ae589a5ed9700854cbd
4
- data.tar.gz: 8f7d311c9cbec69ca70f4a2420409e6c4747fcb0d1ae0f9af4d04baaf10aa43a
3
+ metadata.gz: 15cc9869c313dbadd50a4bcc89d3912717cc5f8512af30326b716d2a3cc636ad
4
+ data.tar.gz: 5d8c0f7240e7b312e096afb75ab8d2f9b91a9f26284be9e90e680bc59615cb02
5
5
  SHA512:
6
- metadata.gz: baaf854e49a5d623279b2481933fb9e033289efba9b4d9350703d9dc9737dac367b6076938f8f309426480f0745d9fe181c8f7f296f8727e17584de498ea631e
7
- data.tar.gz: ea459192ee83bce3c4fe1c307ad8f2ab3c0ed2734f40162cef0ae95033b81d0e3e7bc12d2765af52ae4a06a95ddfed8dfdca7b0c421e923aaa2ba4a172552bcf
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
 
@@ -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 CanIDeployPacticipantVersion < Matrix
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 ||= begin
21
- [
22
- PactBroker::Matrix::UnresolvedSelector.new(
23
- pacticipant_name: pacticipant_name,
24
- latest: true,
25
- tag: identifier_from_path[:tag]
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
- latestby: "cvp",
34
- latest: true,
35
- tag: identifier_from_path[:to]
36
- }
36
+ latestby: "cvp",
37
+ latest: true,
38
+ tag: identifier_from_path[:to]
39
+ }
37
40
  end
38
41
 
39
42
  def version
@@ -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::CanIDeployPacticipantVersion, { resource_name: "can_i_deploy_latest_tagged_version" }
88
- add ["pacticipants", :pacticipant_name, "latest-version", :tag, "can-i-deploy", "to", :to, "badge"], Api::Resources::CanIDeployBadge, { resource_name: "can_i_deploy_badge" }
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
@@ -41,7 +41,7 @@ module PactBroker
41
41
  end
42
42
 
43
43
  def consumer
44
- consumer_version.pacticipant
44
+ @consumer || consumer_version.pacticipant
45
45
  end
46
46
 
47
47
  def consumer_version_tag_names
@@ -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(:consumer)
128
- .eager(:provider)
129
- .eager(consumer_version: [{ current_deployed_versions: :environment }, { current_supported_released_versions: :environment }, { branch_versions: :branch_head }])
130
- .eager(provider_version: [{ current_deployed_versions: :environment }, { current_supported_released_versions: :environment }, { branch_versions: :branch_head }])
131
- .eager(:verification)
132
- .eager(:pact_publication)
133
- .eager(:pact_version)
134
- .eager(:consumer_version_tags)
135
- .eager(:provider_version_tags)
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 = PactBroker::Domain::Pacticipant.find(name: unresolved_selector.pacticipant_name)
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)
@@ -9,6 +9,7 @@ module PactBroker
9
9
  merge!(params)
10
10
  end
11
11
 
12
+ # TODO rename branch to branch_name
12
13
  def self.from_hash(hash)
13
14
  new(hash.symbolize_keys.snakecase_keys.slice(:pacticipant_name, :pacticipant_version_number, :latest, :tag, :branch, :environment_name))
14
15
  end
@@ -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(pact_publications_query.all, specified_explicitly.all, verified_by_this_branch.all, verified_by_other_branch.all)
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(pact_publications_query.all, specified_explicitly.all, verified_by_this_tag.all, verified_by_another_tag.all)
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{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
90
- = "branch: " + branch_head.branch_name
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
- .tag.badge.badge-primary
94
- = "tag: " + tag_name
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
- .tag.badge.badge-success
98
- = "env: " + environment_name
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{"class": "tag badge badge-dark", "title": branch_head.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
111
- = "branch: " + branch_head.branch_name
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
- .tag.badge.badge-primary
115
- = "tag: " + tag_name
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
- .tag.badge.badge-success
119
- = "env: " + environment_name
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
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = "2.93.4"
2
+ VERSION = "2.94.0"
3
3
  end
@@ -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.93.4
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-20 00:00:00.000000000 Z
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/can_i_deploy_pacticipant_version.rb
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