uffizzi_core 2.1.21 → 2.1.23

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: 7ddf1cdf5ca4493e22183f6af9fc269b6e84e75cbb069362837cd760c92c1324
4
- data.tar.gz: 25d66bc0bb87075efb2de98620d7f63ac981edda10d4648d57ffb7fd0bbd7623
3
+ metadata.gz: 0006c772fa6daeaecbd5eab034433a8e66b5b6090b5af1f52dc93627ddbab788
4
+ data.tar.gz: 2df15f2b34462e716536e71bb55567cab5792dffbe7e6f797d0ceee8de5badca
5
5
  SHA512:
6
- metadata.gz: 69caa51097ef93e07376fb2dc80c8a0295ae319bc25a7fc4b91fd7f60370669859629834791787633c5610889f3fa383810583d9029435115234b5dac3e152a4
7
- data.tar.gz: 90823bbec114d8cec8f405c9c7081ca4cb8e039c74ff00ec7d125ec600e0a264cfb4560dfc954853b08d6f09364c85a377a9884818220df428ebd782ada7a95c
6
+ metadata.gz: 9b4082dc0121834a765c085c7554ffc6aa789018d77d33d5390a5a422c313fe39460cc5fdeed9c26d3bfaffb56c4e744ec7110bdb30c8d3cbc2be6302a72e6b0
7
+ data.tar.gz: f4b51425b29c3fb7cf81b6964503e45acee38ab0d193a019261bd94d4bee2d8c564694795a49438c10a7029871cb0157e7cfcc624dcbed425f1c0db2aeb7a21e
@@ -22,9 +22,14 @@ module UffizziCore::Concerns::Models::Membership
22
22
  aasm(:state) do
23
23
  state :active, initial: true
24
24
  state :blocked
25
+ state :inactive
25
26
 
26
27
  event :activate do
27
- transitions from: [:blocked], to: :active
28
+ transitions from: [:blocked, :inactive], to: :active
29
+ end
30
+
31
+ event :deactivate do
32
+ transitions from: [:active], to: :inactive
28
33
  end
29
34
 
30
35
  event :block do
@@ -45,18 +45,16 @@ class UffizziCore::ActivityItemService
45
45
  deployment = container.deployment
46
46
  service = UffizziCore::ManageActivityItemsService.new(deployment)
47
47
  container_status_item = service.container_status_item(container)
48
+ return if container_status_item.nil?
49
+
48
50
  status = container_status_item[:status]
49
51
  last_event = activity_item.events.order_by_id.last
50
-
51
52
  activity_item.events.create(state: status) if last_event&.state != status
52
53
 
53
- if failed?(status)
54
- UffizziCore::ActivityItemService.fail_deployment!(activity_item)
55
- notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
56
- end
54
+ return handle_failed_status(activity_item, deployment) if failed?(status)
57
55
 
58
56
  if deployed?(status) && UffizziCore::ContainerService.ingress_container?(container)
59
- deployment.update(last_deploy_at: last_event.created_at)
57
+ return deployment.update(last_deploy_at: last_event.created_at)
60
58
  end
61
59
 
62
60
  return unless [UffizziCore::Event.state.building, UffizziCore::Event.state.deploying].include?(status)
@@ -66,6 +64,11 @@ class UffizziCore::ActivityItemService
66
64
 
67
65
  private
68
66
 
67
+ def handle_failed_status(activity_item, deployment)
68
+ UffizziCore::ActivityItemService.fail_deployment!(activity_item)
69
+ notification_module.notify_about_failed_deployment(deployment) if notification_module.present?
70
+ end
71
+
69
72
  def create_item!(activity_item_attributes)
70
73
  activity_item = UffizziCore::ActivityItem.find_by(activity_item_attributes)
71
74
  return activity_item unless completed?(activity_item)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.1.21'
4
+ VERSION = '2.1.23'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uffizzi_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.21
4
+ version: 2.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Thurman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-24 00:00:00.000000000 Z
12
+ date: 2023-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm