Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
moklidia committed Oct 6, 2023
2 parents 3caf64f + d5b2ab4 commit 013e16e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 33 deletions.
26 changes: 13 additions & 13 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.22)
uffizzi_core (2.2.23)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -78,9 +78,9 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.13)
actionpack (>= 4.1, < 7.1)
activemodel (>= 4.1, < 7.1)
active_model_serializers (0.10.14)
actionpack (>= 4.1)
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (6.1.5)
Expand Down Expand Up @@ -111,20 +111,20 @@ GEM
ast (2.4.2)
awesome_print (1.9.2)
aws-eventstream (1.2.0)
aws-partitions (1.818.0)
aws-sdk-core (3.181.0)
aws-partitions (1.834.0)
aws-sdk-core (3.185.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-ecr (1.63.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-ecr (1.65.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sdk-eventbridge (1.49.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-eventbridge (1.51.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sdk-iam (1.86.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-iam (1.87.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
Expand Down Expand Up @@ -260,7 +260,7 @@ GEM
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
octokit (7.1.0)
octokit (7.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
parallel (1.21.0)
Expand Down
32 changes: 16 additions & 16 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.22)
uffizzi_core (2.2.23)
aasm
actionpack (~> 6.1.0)
active_model_serializers
Expand Down Expand Up @@ -78,9 +78,9 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.13)
actionpack (>= 4.1, < 7.1)
activemodel (>= 4.1, < 7.1)
active_model_serializers (0.10.14)
actionpack (>= 4.1)
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (6.1.4.6)
Expand Down Expand Up @@ -110,20 +110,20 @@ GEM
activerecord (>= 5.2.6)
awesome_print (1.9.2)
aws-eventstream (1.2.0)
aws-partitions (1.818.0)
aws-sdk-core (3.181.0)
aws-partitions (1.834.0)
aws-sdk-core (3.185.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-ecr (1.63.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-ecr (1.65.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sdk-eventbridge (1.49.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-eventbridge (1.51.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sdk-iam (1.86.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-iam (1.87.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
Expand Down Expand Up @@ -271,19 +271,19 @@ GEM
power_assert (>= 1.1)
mocha (1.13.0)
multipart-post (2.3.0)
net-imap (0.3.7)
net-imap (0.4.0)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
nio4r (2.5.8)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
octokit (7.1.0)
octokit (7.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
parslet (2.0.0)
Expand Down Expand Up @@ -357,7 +357,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
sidekiq (6.5.9)
sidekiq (6.5.11)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
Expand Down
13 changes: 12 additions & 1 deletion core/app/lib/uffizzi_core/concerns/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module UffizziCore::Concerns::Models::Project
extend ActiveSupport::Concern

# rubocop:disable Metrics/BlockLength
included do
include AASM
include UffizziCore::StateMachineConcern
Expand Down Expand Up @@ -43,10 +44,15 @@ module UffizziCore::Concerns::Models::Project

def after_disable
disable_deployments
disable_clusters
end

def active_deployments
deployments.active
deployments.enabled
end

def active_clusters
clusters.enabled
end

def disable_deployments
Expand All @@ -56,8 +62,13 @@ def disable_deployments
end
end

def disable_clusters
active_clusters.each(&:disable!)
end

def compose_file
compose_files.main.first
end
end
# rubocop:enable Metrics/BlockLength
end
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def prepare_service_data(service_name, service_data, global_configs_data,
def check_and_parse_build_option(value, compose_payload)
build_parser_module = find_build_parser_module

raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.not_implemented', option: :build) unless build_parser_module
raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.build_not_implemented') unless build_parser_module

build_parser_module.parse(value, compose_payload)
end
Expand Down
1 change: 1 addition & 0 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ en:
required_start_commands: "When 'test' is a list the first item must be one of: '%{available_commands}'"
volumes_should_be_array: Volumes '%{volumes}' should be an arra
healthcheck_missing_required_option: "One of these options is required: %{required_options}"
build_not_implemented: "The 'build' directive is not supported by the uffizzi command-line tool. Use 'image' instead, or configure Uffizzi CI if you want Uffizzi Cloud to build your application from source. See https://docs.uffizzi.com/references/compose-spec/"

secrets:
duplicates_exists: Secret with key %{secrets} already exist.
Expand Down
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.22'
VERSION = '2.2.23'
end
2 changes: 1 addition & 1 deletion core/test/services/compose_file_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class UffizziCore::ComposeFileServiceTest < ActiveSupport::TestCase
UffizziCore::ComposeFileService.parse(content)
end

assert_match("'build' option is not implemented", e.message)
assert_match("The 'build' directive is not supported", e.message)
end

test '#parse - parses compose file with healthcheck and converts time to seconds when the test command is array' do
Expand Down

0 comments on commit 013e16e

Please sign in to comment.