uffizzi_core 2.2.18 → 2.2.20
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b90d5ab4a5541985fc4d2759d95026ba31fcebda13efe26d005c90ccd53329
|
4
|
+
data.tar.gz: e92d2ab057e8fc18ae9dbb7520e479acfcef6d4f6c7269cde28e202d8d3f327e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/uffizzi_core/version.rb
CHANGED
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.
|
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-
|
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
|