Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
moklidia committed Aug 21, 2023
2 parents 23113f9 + 1aa9967 commit c4afed2
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ In order to add a new migration do the following steps:
2. Run the command inside the `web` container

```bash
rake uffizzi_core:install
rake app:uffizzi_core:install
```

This command copies the new migration to the `db/migrate` folder
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: core
specs:
uffizzi_core (2.2.14)
uffizzi_core (2.2.16)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -111,7 +111,7 @@ GEM
ast (2.4.2)
awesome_print (1.9.2)
aws-eventstream (1.2.0)
aws-partitions (1.806.0)
aws-partitions (1.807.0)
aws-sdk-core (3.180.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
Expand Down
4 changes: 2 additions & 2 deletions core/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
uffizzi_core (2.2.14)
uffizzi_core (2.2.16)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -110,7 +110,7 @@ GEM
activerecord (>= 5.2.6)
awesome_print (1.9.2)
aws-eventstream (1.2.0)
aws-partitions (1.806.0)
aws-partitions (1.807.0)
aws-sdk-core (3.180.3)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class UffizziCore::Api::Cli::V1::Cluster::CreateForm < UffizziCore::Cluster
include UffizziCore::ApplicationForm

permit :name, :manifest
permit :name, :manifest, :creation_source

validate :check_manifest, if: -> { manifest.present? }

Expand Down
5 changes: 5 additions & 0 deletions core/app/lib/uffizzi_core/concerns/models/cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module UffizziCore::Concerns::Models::Cluster

included do
include AASM
extend Enumerize

self.table_name = UffizziCore.table_names[:clusters]

Expand All @@ -16,6 +17,10 @@ module UffizziCore::Concerns::Models::Cluster
validates_uniqueness_of :name, conditions: -> { enabled }, scope: :project_id
validates :name, presence: true, format: { with: /\A[a-zA-Z0-9-]*\z/ }

enumerize :creation_source, in: UffizziCore.cluster_creation_sources, scope: true, predicates: true
attribute :creation_source, :string, default: :manual
validates :creation_source, presence: true

aasm(:state) do
state :deploying_namespace, initial: true
state :failed_deploy_namespace
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class AddSourceToUffizziCoreClusters < ActiveRecord::Migration[6.1]
def change
add_column(:uffizzi_core_clusters, :creation_source, :string)
end
end
1 change: 1 addition & 0 deletions core/lib/uffizzi_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,5 @@ module UffizziCore
mattr_accessor :account_sources, default: [:manual]
mattr_accessor :compose_file_kinds, default: [:main, :temporary]
mattr_accessor :event_states, default: [:waiting, :queued, :successful, :deployed, :failed, :building, :timeout, :cancelled, :deploying]
mattr_accessor :cluster_creation_sources, default: [:manual]
end
2 changes: 1 addition & 1 deletion core/lib/uffizzi_core/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module UffizziCore
VERSION = '2.2.14'
VERSION = '2.2.16'
end
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersControllerTest < ActionContro
end

assert_response(:success)
assert(UffizziCore::Cluster.find_by(name: cluster_creation_data[:name]).creation_source.manual?)
assert_requested(stubbed_create_cluster_request)
assert_requested(stubbed_create_namespace_request)
assert_requested(stubbed_cluster_request)
Expand Down
5 changes: 4 additions & 1 deletion core/test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2023_07_11_101901) do
ActiveRecord::Schema.define(version: 2023_08_10_140316) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -30,8 +30,10 @@
t.integer "container_memory_limit"
t.string "workos_organization_id"
t.string "sso_state"
t.string "slug"
t.index ["customer_token"], name: "index_accounts_on_customer_token", unique: true
t.index ["domain"], name: "index_accounts_on_domain", unique: true
t.index ["slug"], name: "index_uffizzi_core_accounts_on_slug", unique: true
t.index ["subscription_token"], name: "index_accounts_on_subscription_token", unique: true
end

Expand Down Expand Up @@ -83,6 +85,7 @@
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "host"
t.string "source"
t.index ["project_id"], name: "index_cluster_on_project_id"
end

Expand Down

0 comments on commit c4afed2

Please sign in to comment.