pact_broker 2.103.0 → 2.104.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a82ecff0b79c081b9f3712bde752b9983e7377eb8d48120616c8c3fcf237076c
4
- data.tar.gz: cef4b3136255cbba17ad31e9001c935393989df848666ddb712e81884ac61003
3
+ metadata.gz: b2a928f323706d303796168aed1ec181dbf44be8156fc54010357a26771cffd2
4
+ data.tar.gz: b6e9ab38c908cd2263e51e16816f1b4ad8950151cf033ce5009c33022bd1ca59
5
5
  SHA512:
6
- metadata.gz: cb22f318c1f69dc91ceb7a84c940170600ceaf4a53e3ef65eabb7876fd2510867ad243cb1fb4cb22cf06e7b370f868cb01199697de73835879423d1371d6e19b
7
- data.tar.gz: 87507ea9c45bc37318b98a9b8d53ab5a703eeffd1970cb111f3c8d639015f08442a0839376c4d59cc3e321005cb77da11466a1ca5340661905d66578c5aa669d
6
+ metadata.gz: 9e43a6235c4a0a1cfdb8dacd8b83eca7f11e76c1ec40510207b7a904b72d2d1895878fdbbc1e249454c1b3fa5a814bb764bf747ae76b0f0f0f180da096f1d056
7
+ data.tar.gz: 77c95170acc6e136e177d27baaa65f2f668b5085789ebfafde5552983d83a3c42e25b21ee558faf19263d364ae9526350424d32312fb3a6db5d9dcb38e7521a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ <a name="v2.104.0"></a>
2
+ ### v2.104.0 (2022-09-17)
3
+
4
+ #### Features
5
+
6
+ * ignore deleted webhooks when calculating the latest triggered webhook status ([c3105dcb](/../../commit/c3105dcb))
7
+
1
8
  <a name="v2.103.0"></a>
2
9
  ### v2.103.0 (2022-09-14)
3
10
 
@@ -106,7 +106,6 @@ module PactBroker
106
106
 
107
107
  def logger_from_runtime_configuration
108
108
  @logger_from_runtime_configuration ||= begin
109
- runtime_configuration.validate_logging_attributes!
110
109
  SemanticLogger.default_level = runtime_configuration.log_level
111
110
  if runtime_configuration.log_stream == :file
112
111
  path = runtime_configuration.log_dir + "/pact_broker.log"
@@ -12,7 +12,14 @@ module PactBroker
12
12
  associate(:many_to_one, :consumer, :class => "PactBroker::Domain::Pacticipant", :key => :consumer_id, :primary_key => :id)
13
13
  associate(:many_to_one, :provider, :class => "PactBroker::Domain::Pacticipant", :key => :provider_id, :primary_key => :id)
14
14
  associate(:one_to_one, :latest_verification, :class => "PactBroker::Verifications::LatestVerificationForConsumerAndProvider", key: [:consumer_id, :provider_id], primary_key: [:consumer_id, :provider_id])
15
- associate(:one_to_many, :latest_triggered_webhooks, :class => "PactBroker::Webhooks::LatestTriggeredWebhook", key: [:consumer_id, :provider_id], primary_key: [:consumer_id, :provider_id])
15
+
16
+ one_to_many(:latest_triggered_webhooks,
17
+ :class => PactBroker::Webhooks::TriggeredWebhook,
18
+ key: [:consumer_id, :provider_id],
19
+ allow_eager: true,
20
+ primary_key: [:consumer_id, :provider_id]) do | ds |
21
+ ds.latest_triggered_webhooks
22
+ end
16
23
 
17
24
  # When viewing the index, every latest_pact in the database will match at least one of the rows, so
18
25
  # it makes sense to load the entire table and match each pact to the appropriate row.
@@ -1,3 +1,3 @@
1
1
  module PactBroker
2
- VERSION = "2.103.0"
2
+ VERSION = "2.104.0"
3
3
  end
@@ -159,9 +159,9 @@ module PactBroker
159
159
 
160
160
  def find_latest_triggered_webhooks consumer, provider
161
161
  # policy already applied to pact
162
- deliberately_unscoped(LatestTriggeredWebhook)
162
+ deliberately_unscoped(TriggeredWebhook)
163
163
  .where(consumer: consumer, provider: provider)
164
- .order(:id)
164
+ .latest_triggered_webhooks
165
165
  .all
166
166
  end
167
167
 
@@ -45,6 +45,13 @@ module PactBroker
45
45
  def not_run
46
46
  where(status: STATUS_NOT_RUN)
47
47
  end
48
+
49
+ # Return the dataset for the latest triggered webhooks grouped by
50
+ # consumer, provider, webhook and event.
51
+ # Excludes the deleted webhooks
52
+ def latest_triggered_webhooks
53
+ exclude(webhook_id: nil).max_group_by(:id, [:consumer_id, :provider_id, :webhook_uuid, :event_name]).order(:id)
54
+ end
48
55
  end
49
56
 
50
57
  associate(:one_to_many, :webhook_executions, :class => "PactBroker::Webhooks::Execution", :key => :triggered_webhook_id, :primary_key => :id, :order => :id)
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.103.0
4
+ version: 2.104.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-09-16 00:00:00.000000000 Z
13
+ date: 2022-09-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json