uffizzi_core 2.2.18 → 2.2.20

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: ac821f837d64d420f64d0820763c1936a5729e58949aec8b7806f5ed6aa30805
4
- data.tar.gz: 7b47949da56f4d7416d17ec4e628d0104cbdbd210db37c7a4d25802e96a2614e
3
+ metadata.gz: c6b90d5ab4a5541985fc4d2759d95026ba31fcebda13efe26d005c90ccd53329
4
+ data.tar.gz: e92d2ab057e8fc18ae9dbb7520e479acfcef6d4f6c7269cde28e202d8d3f327e
5
5
  SHA512:
6
- metadata.gz: ceeec356d175119ca83f7da7642ab5607788fefd180a97d0dbbbcc40466e7668de0a70b9982053809b5c701499993648bf13c29a078ce1278e950d6e0931442d
7
- data.tar.gz: 4c924c77d4201c61548797f2273b5325caec1bdddb9e89eb5f5bc9cafbcdc3173387e38cb825113a5cc1708f30e9f51ac82343f36d987167f502992968b98589
6
+ metadata.gz: 6b60359564b861d85210a4c79df1f93882fa58fe51447c16488e40f81854cf71e997c4d9e06ab1d0c0e72ca40b300e95446aff2344675a2dfcf2f6c4bf6da017
7
+ data.tar.gz: ac60e35f27a030dc11fdca4f1a64da273e343f873322704adae014f83107f3d93a002aeb23f690df5cfdd385dfd7f2fc444c710cf5345de5bc6527438bf4ca76
@@ -24,7 +24,8 @@ module UffizziCore::Concerns::Models::Project
24
24
  has_many :host_volume_files, dependent: :destroy
25
25
  has_many :clusters, dependent: :destroy
26
26
 
27
- validates :name, presence: true, uniqueness: { scope: :account }
27
+ validates :name, presence: true
28
+ validates_uniqueness_of :name, conditions: -> { where(state: :active) }
28
29
  validates :slug, presence: true, uniqueness: true
29
30
 
30
31
  aasm(:state) do
@@ -7,19 +7,9 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentSerializer < UffizziCore::B
7
7
  type :deployment
8
8
 
9
9
  attributes :id,
10
- :kind,
11
10
  :project_id,
12
- :created_at,
13
- :updated_at,
14
11
  :state,
15
- :preview_url,
16
- :tag,
17
- :branch,
18
- :image_id,
19
- :ingress_container_ready,
20
- :ingress_container_state,
21
- :creation_source,
22
- :metadata
12
+ :preview_url
23
13
 
24
14
  has_many :containers
25
15
 
@@ -28,38 +18,4 @@ class UffizziCore::Api::Cli::V1::Projects::DeploymentSerializer < UffizziCore::B
28
18
  def containers
29
19
  object.containers.active
30
20
  end
31
-
32
- def tag
33
- object.ingress_container&.tag
34
- end
35
-
36
- def branch
37
- object.ingress_container&.repo&.branch
38
- end
39
-
40
- def image_id
41
- object.ingress_container&.repo&.name
42
- end
43
-
44
- def ingress_container_ready
45
- !!object.ingress_container&.activity_items&.last&.events&.last&.deployed?
46
- end
47
-
48
- def ingress_container_state
49
- last_event = object.ingress_container&.activity_items&.last&.events&.last
50
-
51
- case last_event&.state
52
- when UffizziCore::Event.state.deployed
53
- :deployed
54
- when UffizziCore::Event.state.failed, UffizziCore::Event.state.timeout, UffizziCore::Event.state.cancelled
55
- :failed
56
- else
57
- state_from_activity_items
58
- end
59
- end
60
-
61
- def state_from_activity_items
62
- activity_items_count = object.ingress_container&.activity_items&.count
63
- activity_items_count.to_i > 1 ? :updating : :pending
64
- end
65
21
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ class UpdateNameConstraintToProjects < ActiveRecord::Migration[6.1]
4
+ def change
5
+ remove_index(:uffizzi_core_projects, [:account_id, :name])
6
+ add_index(:uffizzi_core_projects, [:account_id, :name], unique: true,
7
+ where: "state = 'active'",
8
+ name: 'proj_uniq_name')
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UffizziCore
4
- VERSION = '2.2.18'
4
+ VERSION = '2.2.20'
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.2.18
4
+ version: 2.2.20
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-08-28 00:00:00.000000000 Z
12
+ date: 2023-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aasm
@@ -1087,6 +1087,7 @@ files:
1087
1087
  - db/migrate/20230613101901_create_clusters.rb
1088
1088
  - db/migrate/20230711101901_add_host_to_clusters.rb
1089
1089
  - db/migrate/20230810140316_add_source_to_uffizzi_core_clusters.rb
1090
+ - db/migrate/20230824150022_update_name_constraint_to_projects.rb
1090
1091
  - db/seeds.rb
1091
1092
  - lib/tasks/uffizzi_core_tasks.rake
1092
1093
  - lib/uffizzi_core.rb