From 358791010774ba2eec108e9b840d07a2a0c7b4c6 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 17:26:32 +0400 Subject: [PATCH 01/24] added disconnect command --- lib/uffizzi/cli.rb | 6 ++++ lib/uffizzi/cli/disconnect.rb | 47 +++++++++++++++++++++++++++ lib/uffizzi/clients/api/api_client.rb | 7 ++++ lib/uffizzi/clients/api/api_routes.rb | 4 +++ 4 files changed, 64 insertions(+) create mode 100644 lib/uffizzi/cli/disconnect.rb diff --git a/lib/uffizzi/cli.rb b/lib/uffizzi/cli.rb index d19e34ad..f68353c6 100644 --- a/lib/uffizzi/cli.rb +++ b/lib/uffizzi/cli.rb @@ -54,5 +54,11 @@ def connect(credential_type, credential_file_path = nil) require_relative 'cli/connect' Connect.new.run(credential_type, credential_file_path) end + + desc 'disconect CREDENTIAL_TYPE', 'Disonnect credentials from Uffizzi' + def disconnect(credential_type) + require_relative 'cli/disconnect' + Disconnect.new.run(credential_type) + end end end diff --git a/lib/uffizzi/cli/disconnect.rb b/lib/uffizzi/cli/disconnect.rb new file mode 100644 index 00000000..de3c2ac6 --- /dev/null +++ b/lib/uffizzi/cli/disconnect.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'uffizzi' + +module Uffizzi + class CLI::Disconnect + include ApiClient + + def run(credential_type) + return Uffizzi.ui.say('Unsupported credential type.') unless credential_type_supported?(credential_type) + + credential_type_name = case credential_type + when 'docker-hub' + Uffizzi.configuration.credential_types[:dockerhub] + when 'acr' + Uffizzi.configuration.credential_types[:azure] + when 'ecr' + Uffizzi.configuration.credential_types[:amazon] + when 'gcr' + Uffizzi.configuration.credential_types[:google] + end + + response = delete_credential(ConfigFile.read_option(:hostname), credential_type_name) + + if ResponseHelper.no_content?(response) + Uffizzi.ui.say("Successfully disconnected #{credential_source(credential_type)} credential") + else + ResponseHelper.handle_failed_response(response) + end + end + + private + + def credential_type_supported?(credential_type) + ['docker-hub', 'acr', 'ecr', 'gcr'].include?(credential_type) + end + + def credential_source(credential_type) + { + 'docker-hub' => 'DockerHub', + 'acr' => 'ACR', + 'ecr' => 'ECR', + 'gcr' => 'GCR', + }[credential_type] + end + end +end diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 57acb2cd..260da7b3 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -41,6 +41,13 @@ def fetch_deployment_services(hostname, project_slug, deployment_id) build_response(response) end + def delete_credential(hostname, credential_type) + uri = delete_credential_uri(hostname, credential_type) + response = Uffizzi::HttpClient.make_request(uri, :delete) + + build_response(response) + end + def set_compose_file(hostname, params, project_slug) uri = compose_file_uri(hostname, project_slug) response = Uffizzi::HttpClient.make_post_request(uri, params) diff --git a/lib/uffizzi/clients/api/api_routes.rb b/lib/uffizzi/clients/api/api_routes.rb index eea86260..3bd5e1c7 100644 --- a/lib/uffizzi/clients/api/api_routes.rb +++ b/lib/uffizzi/clients/api/api_routes.rb @@ -55,4 +55,8 @@ def credentials_uri(hostname) def preview_services_uri(hostname, project_slug, deployment_id) "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers" end + + def delete_credential_uri(hostname, credential_type) + "#{hostname}/api/cli/v1/account/credentials/#{credential_type}" + end end From c6009238a63e33801b2f7ba2929d2755d6acfe23 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 17:26:45 +0400 Subject: [PATCH 02/24] added tests for disconnect --- .../uffizzi_delete_credential_failed.json | 7 ++ test/uffizzi/cli/disconnect_test.rb | 65 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 test/fixtures/files/uffizzi/uffizzi_delete_credential_failed.json create mode 100644 test/uffizzi/cli/disconnect_test.rb diff --git a/test/fixtures/files/uffizzi/uffizzi_delete_credential_failed.json b/test/fixtures/files/uffizzi/uffizzi_delete_credential_failed.json new file mode 100644 index 00000000..3b1ec215 --- /dev/null +++ b/test/fixtures/files/uffizzi/uffizzi_delete_credential_failed.json @@ -0,0 +1,7 @@ +{ + "errors": { + "title": [ + "Resource Not Found" + ] + } +} diff --git a/test/uffizzi/cli/disconnect_test.rb b/test/uffizzi/cli/disconnect_test.rb new file mode 100644 index 00000000..598bbcf8 --- /dev/null +++ b/test/uffizzi/cli/disconnect_test.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +require 'test_helper' + +class DisconnectTest < Minitest::Test + def setup + @cli = Uffizzi::CLI.new + + sign_in + end + + def test_disconnect_docker_hub_success + stubbed_uffizzi_delete_credential = stub_uffizzi_delete_credential(Uffizzi.configuration.credential_types[:dockerhub]) + + @cli.disconnect('docker-hub') + + assert_equal('Successfully disconnected DockerHub credential', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_delete_credential) + end + + def test_disconnect_azure_success + stubbed_uffizzi_delete_credential = stub_uffizzi_delete_credential(Uffizzi.configuration.credential_types[:azure]) + + @cli.disconnect('acr') + + assert_equal('Successfully disconnected ACR credential', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_delete_credential) + end + + def test_disconnect_amazon_success + stubbed_uffizzi_delete_credential = stub_uffizzi_delete_credential(Uffizzi.configuration.credential_types[:amazon]) + + @cli.disconnect('ecr') + + assert_equal('Successfully disconnected ECR credential', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_delete_credential) + end + + def test_disconnect_google_success + stubbed_uffizzi_delete_credential = stub_uffizzi_delete_credential(Uffizzi.configuration.credential_types[:google]) + + @cli.disconnect('gcr') + + assert_equal('Successfully disconnected GCR credential', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_delete_credential) + end + + def test_unknown_credential_type + credential_type = generate(:string) + + @cli.disconnect(credential_type) + + assert_equal('Unsupported credential type.', Uffizzi.ui.last_message) + end + + def test_disconnect_credential_failed + body = json_fixture('files/uffizzi/uffizzi_delete_credential_failed.json') + stubbed_uffizzi_delete_credential = stub_uffizzi_delete_credential_fail(body, Uffizzi.configuration.credential_types[:dockerhub]) + + @cli.disconnect('docker-hub') + + assert_equal(body[:errors][:title].first, Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_delete_credential) + end +end From 73c3cabb6016e0ac4594da70eaf8d4f804989598 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 18:02:04 +0400 Subject: [PATCH 03/24] updated README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5363149f..696049c6 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,16 @@ $ uffizzi config delete OPTION Deletes specified option. +### disconnect ### + +``` +$ uffizzi disconnect CREDENTIAL_TYPE +``` + +Deletes credential of specified type + +Supported credential types - `docker-hub`, `acr`, `ecr`, `gcr` + ## Git workflow for the app: 1. Clone the repository and checkout to `develop` branch From fdd5fcf1b1ec264be5f916cd91252980cb18a68b Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 19:01:06 +0400 Subject: [PATCH 04/24] improved naming --- lib/uffizzi/cli/disconnect.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/uffizzi/cli/disconnect.rb b/lib/uffizzi/cli/disconnect.rb index de3c2ac6..0d9ec045 100644 --- a/lib/uffizzi/cli/disconnect.rb +++ b/lib/uffizzi/cli/disconnect.rb @@ -9,7 +9,7 @@ class CLI::Disconnect def run(credential_type) return Uffizzi.ui.say('Unsupported credential type.') unless credential_type_supported?(credential_type) - credential_type_name = case credential_type + connection_type = case credential_type when 'docker-hub' Uffizzi.configuration.credential_types[:dockerhub] when 'acr' @@ -20,10 +20,10 @@ def run(credential_type) Uffizzi.configuration.credential_types[:google] end - response = delete_credential(ConfigFile.read_option(:hostname), credential_type_name) + response = delete_credential(ConfigFile.read_option(:hostname), connection_type) if ResponseHelper.no_content?(response) - Uffizzi.ui.say("Successfully disconnected #{credential_source(credential_type)} credential") + Uffizzi.ui.say("Successfully disconnected #{connection_name(credential_type)} connection") else ResponseHelper.handle_failed_response(response) end @@ -35,7 +35,7 @@ def credential_type_supported?(credential_type) ['docker-hub', 'acr', 'ecr', 'gcr'].include?(credential_type) end - def credential_source(credential_type) + def connection_name(credential_type) { 'docker-hub' => 'DockerHub', 'acr' => 'ACR', From 0c0c52c726f3a44ad7588ac703b09324f0267db4 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 19:10:49 +0400 Subject: [PATCH 05/24] linter fixes --- lib/uffizzi/cli/disconnect.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/uffizzi/cli/disconnect.rb b/lib/uffizzi/cli/disconnect.rb index 0d9ec045..c9fd1b86 100644 --- a/lib/uffizzi/cli/disconnect.rb +++ b/lib/uffizzi/cli/disconnect.rb @@ -10,14 +10,14 @@ def run(credential_type) return Uffizzi.ui.say('Unsupported credential type.') unless credential_type_supported?(credential_type) connection_type = case credential_type - when 'docker-hub' - Uffizzi.configuration.credential_types[:dockerhub] - when 'acr' - Uffizzi.configuration.credential_types[:azure] - when 'ecr' - Uffizzi.configuration.credential_types[:amazon] - when 'gcr' - Uffizzi.configuration.credential_types[:google] + when 'docker-hub' + Uffizzi.configuration.credential_types[:dockerhub] + when 'acr' + Uffizzi.configuration.credential_types[:azure] + when 'ecr' + Uffizzi.configuration.credential_types[:amazon] + when 'gcr' + Uffizzi.configuration.credential_types[:google] end response = delete_credential(ConfigFile.read_option(:hostname), connection_type) From 7d76bb35254b4ed9ead32ff764c3586fcc46af88 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 19:11:50 +0400 Subject: [PATCH 06/24] fixed tests --- test/uffizzi/cli/disconnect_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/uffizzi/cli/disconnect_test.rb b/test/uffizzi/cli/disconnect_test.rb index 598bbcf8..7da4e84c 100644 --- a/test/uffizzi/cli/disconnect_test.rb +++ b/test/uffizzi/cli/disconnect_test.rb @@ -14,7 +14,7 @@ def test_disconnect_docker_hub_success @cli.disconnect('docker-hub') - assert_equal('Successfully disconnected DockerHub credential', Uffizzi.ui.last_message) + assert_equal('Successfully disconnected DockerHub connection', Uffizzi.ui.last_message) assert_requested(stubbed_uffizzi_delete_credential) end @@ -23,7 +23,7 @@ def test_disconnect_azure_success @cli.disconnect('acr') - assert_equal('Successfully disconnected ACR credential', Uffizzi.ui.last_message) + assert_equal('Successfully disconnected ACR connection', Uffizzi.ui.last_message) assert_requested(stubbed_uffizzi_delete_credential) end @@ -32,7 +32,7 @@ def test_disconnect_amazon_success @cli.disconnect('ecr') - assert_equal('Successfully disconnected ECR credential', Uffizzi.ui.last_message) + assert_equal('Successfully disconnected ECR connection', Uffizzi.ui.last_message) assert_requested(stubbed_uffizzi_delete_credential) end @@ -41,7 +41,7 @@ def test_disconnect_google_success @cli.disconnect('gcr') - assert_equal('Successfully disconnected GCR credential', Uffizzi.ui.last_message) + assert_equal('Successfully disconnected GCR connection', Uffizzi.ui.last_message) assert_requested(stubbed_uffizzi_delete_credential) end From 898cb79c342609006eb8f400a8457963e466ae58 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 19:18:03 +0400 Subject: [PATCH 07/24] fixes after rebase --- lib/uffizzi/clients/api/api_client.rb | 2 +- test/support/uffizzi_stub_support.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 260da7b3..62a0bbfc 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -43,7 +43,7 @@ def fetch_deployment_services(hostname, project_slug, deployment_id) def delete_credential(hostname, credential_type) uri = delete_credential_uri(hostname, credential_type) - response = Uffizzi::HttpClient.make_request(uri, :delete) + response = Uffizzi::HttpClient.make_delete_request(uri) build_response(response) end diff --git a/test/support/uffizzi_stub_support.rb b/test/support/uffizzi_stub_support.rb index e4a183b2..51a6e6a0 100644 --- a/test/support/uffizzi_stub_support.rb +++ b/test/support/uffizzi_stub_support.rb @@ -78,4 +78,16 @@ def stub_uffizzi_create_credential_fail(body) stub_request(:post, uri).to_return(status: 422, body: body.to_json) end + + def stub_uffizzi_delete_credential(credential_type) + uri = delete_credential_uri(Uffizzi.configuration.hostname, credential_type) + + stub_request(:delete, uri).to_return(status: 204, body: '') + end + + def stub_uffizzi_delete_credential_fail(body, credential_type) + uri = delete_credential_uri(Uffizzi.configuration.hostname, credential_type) + + stub_request(:delete, uri).to_return(status: 422, body: body.to_json) + end end From 6da86ed495efd5fd7c87b14d5d0531b5a2565a5f Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Mon, 28 Mar 2022 19:24:29 +0400 Subject: [PATCH 08/24] removed unused body from stub --- test/support/uffizzi_stub_support.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/uffizzi_stub_support.rb b/test/support/uffizzi_stub_support.rb index 51a6e6a0..62bb22b0 100644 --- a/test/support/uffizzi_stub_support.rb +++ b/test/support/uffizzi_stub_support.rb @@ -82,7 +82,7 @@ def stub_uffizzi_create_credential_fail(body) def stub_uffizzi_delete_credential(credential_type) uri = delete_credential_uri(Uffizzi.configuration.hostname, credential_type) - stub_request(:delete, uri).to_return(status: 204, body: '') + stub_request(:delete, uri).to_return(status: 204) end def stub_uffizzi_delete_credential_fail(body, credential_type) From 63e2fb165008977f47b214f1b55e0cef5c122647 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Wed, 30 Mar 2022 17:57:31 +0400 Subject: [PATCH 09/24] improved checking credential type --- lib/uffizzi.rb | 4 ++-- lib/uffizzi/cli/disconnect.rb | 4 ++-- lib/uffizzi/error.rb | 5 +++++ test/uffizzi/cli/disconnect_test.rb | 6 ++++-- 4 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 lib/uffizzi/error.rb diff --git a/lib/uffizzi.rb b/lib/uffizzi.rb index 98a2f386..7e6ab5ff 100644 --- a/lib/uffizzi.rb +++ b/lib/uffizzi.rb @@ -2,6 +2,8 @@ require 'io/console' +require 'thor' +require 'uffizzi/error' require 'uffizzi/shell' require 'uffizzi/version' require 'uffizzi/clients/api/api_client' @@ -10,8 +12,6 @@ require_relative '../config/uffizzi' module Uffizzi - class Error < StandardError; end - class << self def ui @ui ||= Uffizzi::UI::Shell.new diff --git a/lib/uffizzi/cli/disconnect.rb b/lib/uffizzi/cli/disconnect.rb index c9fd1b86..7d1b7187 100644 --- a/lib/uffizzi/cli/disconnect.rb +++ b/lib/uffizzi/cli/disconnect.rb @@ -7,8 +7,6 @@ class CLI::Disconnect include ApiClient def run(credential_type) - return Uffizzi.ui.say('Unsupported credential type.') unless credential_type_supported?(credential_type) - connection_type = case credential_type when 'docker-hub' Uffizzi.configuration.credential_types[:dockerhub] @@ -18,6 +16,8 @@ def run(credential_type) Uffizzi.configuration.credential_types[:amazon] when 'gcr' Uffizzi.configuration.credential_types[:google] + else + raise Uffizzi::Error.new('Unsupported credential type.') end response = delete_credential(ConfigFile.read_option(:hostname), connection_type) diff --git a/lib/uffizzi/error.rb b/lib/uffizzi/error.rb new file mode 100644 index 00000000..bff31faf --- /dev/null +++ b/lib/uffizzi/error.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Uffizzi + class Error < Thor::Error; end +end diff --git a/test/uffizzi/cli/disconnect_test.rb b/test/uffizzi/cli/disconnect_test.rb index 7da4e84c..c7f4a016 100644 --- a/test/uffizzi/cli/disconnect_test.rb +++ b/test/uffizzi/cli/disconnect_test.rb @@ -48,9 +48,11 @@ def test_disconnect_google_success def test_unknown_credential_type credential_type = generate(:string) - @cli.disconnect(credential_type) + error = assert_raises(Uffizzi::Error) do + @cli.disconnect(credential_type) + end - assert_equal('Unsupported credential type.', Uffizzi.ui.last_message) + assert_equal('Unsupported credential type.', error.message) end def test_disconnect_credential_failed From 422154d74b575c99ccbb6df51b4b73179df766a5 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Wed, 30 Mar 2022 17:59:45 +0400 Subject: [PATCH 10/24] removed unused method --- lib/uffizzi/cli/disconnect.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/uffizzi/cli/disconnect.rb b/lib/uffizzi/cli/disconnect.rb index 7d1b7187..350ff36c 100644 --- a/lib/uffizzi/cli/disconnect.rb +++ b/lib/uffizzi/cli/disconnect.rb @@ -31,10 +31,6 @@ def run(credential_type) private - def credential_type_supported?(credential_type) - ['docker-hub', 'acr', 'ecr', 'gcr'].include?(credential_type) - end - def connection_name(credential_type) { 'docker-hub' => 'DockerHub', From bc2d8d5e708463b925887a89c490ffcfc9524101 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Thu, 30 Dec 2021 18:29:26 +0400 Subject: [PATCH 11/24] cli part done --- lib/uffizzi/clients/api/api_client.rb | 2 +- test/uffizzi/cli/apply_test.rb | 64 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 test/uffizzi/cli/apply_test.rb diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 62a0bbfc..30c45cfa 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -83,7 +83,7 @@ def delete_secret(hostname, project_slug, id) build_response(response) end - def describe_compose_file(hostname, project_slug) + def describe_compose_file(hostname, params, project_slug) uri = compose_file_uri(hostname, project_slug) response = Uffizzi::HttpClient.make_get_request(uri) diff --git a/test/uffizzi/cli/apply_test.rb b/test/uffizzi/cli/apply_test.rb new file mode 100644 index 00000000..f4b76112 --- /dev/null +++ b/test/uffizzi/cli/apply_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require 'test_helper' + +class ApplyTest < Minitest::Test + def setup + @cli = Uffizzi::CLI.new + + sign_in + Uffizzi::ConfigFile.write_option(:project, 'dbp') + end + + def test_apply_success + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + body = json_fixture('files/uffizzi/uffizzi_create_deployment_success.json') + stubbed_uffizzi_create_deployment = stub_uffizzi_create_deployment(Uffizzi.configuration.hostname, 201, body, {}) + + @cli.options = { file: 'test/compose_files/test_compose_success.yml' } + @cli.apply + + assert_equal('deployment created', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_create_deployment) + assert_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_invalid_compose + body = json_fixture('files/uffizzi/uffizzi_create_compose_without_images.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 422, body, {}) + + error_message = body[:errors][:path].last + + @cli.options = { file: 'test/compose_files/test_compose_without_images.yml' } + @cli.apply + + assert_equal(error_message, Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_invalid_path_to_dependency_file + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + @cli.options = { file: 'test/compose_files/test_compose_with_invalid_env_path.yml' } + + assert_raises(Errno::ENOENT) do + @cli.apply + end + + refute_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_empty_path_to_dependency_file + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + @cli.options = { file: 'test/compose_files/test_compose_with_empty_env_path.yml' } + + assert_raises(TypeError) do + @cli.apply + end + + assert_equal('env_file contains an empty value', Uffizzi.ui.last_message) + refute_requested(stubbed_uffizzi_create_compose) + end +end From 0b4966b873d4ee3c2620401a5f9b7de3f14ceb1a Mon Sep 17 00:00:00 2001 From: moklidia Date: Fri, 25 Mar 2022 13:25:44 +0300 Subject: [PATCH 12/24] fixes after rebase --- lib/uffizzi/clients/api/api_client.rb | 2 +- test/uffizzi/cli/apply_test.rb | 64 --------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 test/uffizzi/cli/apply_test.rb diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 30c45cfa..62a0bbfc 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -83,7 +83,7 @@ def delete_secret(hostname, project_slug, id) build_response(response) end - def describe_compose_file(hostname, params, project_slug) + def describe_compose_file(hostname, project_slug) uri = compose_file_uri(hostname, project_slug) response = Uffizzi::HttpClient.make_get_request(uri) diff --git a/test/uffizzi/cli/apply_test.rb b/test/uffizzi/cli/apply_test.rb deleted file mode 100644 index f4b76112..00000000 --- a/test/uffizzi/cli/apply_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class ApplyTest < Minitest::Test - def setup - @cli = Uffizzi::CLI.new - - sign_in - Uffizzi::ConfigFile.write_option(:project, 'dbp') - end - - def test_apply_success - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - body = json_fixture('files/uffizzi/uffizzi_create_deployment_success.json') - stubbed_uffizzi_create_deployment = stub_uffizzi_create_deployment(Uffizzi.configuration.hostname, 201, body, {}) - - @cli.options = { file: 'test/compose_files/test_compose_success.yml' } - @cli.apply - - assert_equal('deployment created', Uffizzi.ui.last_message) - assert_requested(stubbed_uffizzi_create_deployment) - assert_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_invalid_compose - body = json_fixture('files/uffizzi/uffizzi_create_compose_without_images.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 422, body, {}) - - error_message = body[:errors][:path].last - - @cli.options = { file: 'test/compose_files/test_compose_without_images.yml' } - @cli.apply - - assert_equal(error_message, Uffizzi.ui.last_message) - assert_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_invalid_path_to_dependency_file - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - @cli.options = { file: 'test/compose_files/test_compose_with_invalid_env_path.yml' } - - assert_raises(Errno::ENOENT) do - @cli.apply - end - - refute_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_empty_path_to_dependency_file - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - @cli.options = { file: 'test/compose_files/test_compose_with_empty_env_path.yml' } - - assert_raises(TypeError) do - @cli.apply - end - - assert_equal('env_file contains an empty value', Uffizzi.ui.last_message) - refute_requested(stubbed_uffizzi_create_compose) - end -end From c6899655dd6cd548e3a67d651fa0e87cdb7b64ce Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Thu, 30 Dec 2021 18:29:26 +0400 Subject: [PATCH 13/24] cli part done --- test/support/uffizzi_stub_support.rb | 12 ++++++ test/uffizzi/cli/apply_test.rb | 64 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 test/uffizzi/cli/apply_test.rb diff --git a/test/support/uffizzi_stub_support.rb b/test/support/uffizzi_stub_support.rb index 62bb22b0..bceddfe9 100644 --- a/test/support/uffizzi_stub_support.rb +++ b/test/support/uffizzi_stub_support.rb @@ -90,4 +90,16 @@ def stub_uffizzi_delete_credential_fail(body, credential_type) stub_request(:delete, uri).to_return(status: 422, body: body.to_json) end + + def stub_uffizzi_create_compose(base_url, status, body, headers) + url = compose_files_uri(base_url) + + stub_request(:post, url).to_return(status: status, body: body.to_json, headers: headers) + end + + def stub_uffizzi_create_deployment(base_url, status, body, headers) + url = deployments_uri(base_url) + + stub_request(:post, url).to_return(status: status, body: body.to_json, headers: headers) + end end diff --git a/test/uffizzi/cli/apply_test.rb b/test/uffizzi/cli/apply_test.rb new file mode 100644 index 00000000..f4b76112 --- /dev/null +++ b/test/uffizzi/cli/apply_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require 'test_helper' + +class ApplyTest < Minitest::Test + def setup + @cli = Uffizzi::CLI.new + + sign_in + Uffizzi::ConfigFile.write_option(:project, 'dbp') + end + + def test_apply_success + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + body = json_fixture('files/uffizzi/uffizzi_create_deployment_success.json') + stubbed_uffizzi_create_deployment = stub_uffizzi_create_deployment(Uffizzi.configuration.hostname, 201, body, {}) + + @cli.options = { file: 'test/compose_files/test_compose_success.yml' } + @cli.apply + + assert_equal('deployment created', Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_create_deployment) + assert_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_invalid_compose + body = json_fixture('files/uffizzi/uffizzi_create_compose_without_images.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 422, body, {}) + + error_message = body[:errors][:path].last + + @cli.options = { file: 'test/compose_files/test_compose_without_images.yml' } + @cli.apply + + assert_equal(error_message, Uffizzi.ui.last_message) + assert_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_invalid_path_to_dependency_file + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + @cli.options = { file: 'test/compose_files/test_compose_with_invalid_env_path.yml' } + + assert_raises(Errno::ENOENT) do + @cli.apply + end + + refute_requested(stubbed_uffizzi_create_compose) + end + + def test_apply_empty_path_to_dependency_file + body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') + stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) + @cli.options = { file: 'test/compose_files/test_compose_with_empty_env_path.yml' } + + assert_raises(TypeError) do + @cli.apply + end + + assert_equal('env_file contains an empty value', Uffizzi.ui.last_message) + refute_requested(stubbed_uffizzi_create_compose) + end +end From e764cadc3b30ebbf3765acbd42f1a25eb3a0b32f Mon Sep 17 00:00:00 2001 From: moklidia Date: Tue, 22 Mar 2022 12:51:38 +0300 Subject: [PATCH 14/24] implemented service logs command --- lib/uffizzi/cli/preview/service.rb | 43 ++++++++++++++++++- lib/uffizzi/clients/api/api_client.rb | 12 ++++++ lib/uffizzi/clients/api/api_routes.rb | 8 ++++ .../uffizzi_preview_service_logs_success.json | 33 ++++++++++++++ test/support/uffizzi_preview_stub_support.rb | 6 +++ test/uffizzi/cli/preview/service_test.rb | 16 +++++++ 6 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index cdb1425b..8ef3ad88 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -9,6 +9,22 @@ module Uffizzi class CLI::Preview::Service < Thor include ApiClient + desc 'logs', 'logs' + def logs(logs_type, deployment_name, container_name) + return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in? + return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set? + + deployment_id = deployment_name.split('-').last + response = service_logs_response(logs_type, deployment_id, container_name) + return Uffizzi.ui.say(response[:errors]) if response[:errors] + + if ResponseHelper.ok?(response) + handle_succeed_logs_response(response, container_name) + else + ResponseHelper.handle_failed_response(response) + end + end + desc 'list', 'list' def list(deployment_name) return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in? @@ -20,7 +36,7 @@ def list(deployment_name) response = fetch_deployment_services(hostname, project_slug, deployment_id) if ResponseHelper.ok?(response) - handle_succeed_response(response, deployment_name) + handle_succeed_list_response(response, deployment_name) else ResponseHelper.handle_failed_response(response) end @@ -28,7 +44,21 @@ def list(deployment_name) private - def handle_succeed_response(response, deployment_name) + def service_logs_response(logs_type, deployment_id, container_name) + project_slug = ConfigFile.read_option(:project) + hostname = ConfigFile.read_option(:hostname) + + case logs_type + when 'container' + fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name) + when 'build' + fetch_deployment_service_build_logs(hostname, project_slug, deployment_id, container_name) + else + { errors: 'Unknown log type' } + end + end + + def handle_succeed_list_response(response, deployment_name) services = response[:body][:containers] || [] return Uffizzi.ui.say("There are no services associated with the preview #{deployment_name}") if services.empty? @@ -36,5 +66,14 @@ def handle_succeed_response(response, deployment_name) Uffizzi.ui.say(service) end end + + def handle_succeed_logs_response(response, container_name) + logs = response[:body][:logs] || [] + return Uffizzi.ui.say("The service #{container_name} has no logs") if logs.empty? + + logs.each do |log| + Uffizzi.ui.say(log) + end + end end end diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 62a0bbfc..3fa47c6a 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -44,6 +44,18 @@ def fetch_deployment_services(hostname, project_slug, deployment_id) def delete_credential(hostname, credential_type) uri = delete_credential_uri(hostname, credential_type) response = Uffizzi::HttpClient.make_delete_request(uri) + end + + def fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name) + uri = preview_service_logs_uri(hostname, project_slug, deployment_id, container_name) + response = Uffizzi::HttpClient.make_get_request(uri) + + build_response(response) + end + + def fetch_deployment_service_build_logs(hostname, project_slug, deployment_id, container_name) + uri = preview_service_build_logs_uri(hostname, project_slug, deployment_id, container_name) + response = Uffizzi::HttpClient.make_get_request(uri) build_response(response) end diff --git a/lib/uffizzi/clients/api/api_routes.rb b/lib/uffizzi/clients/api/api_routes.rb index 3bd5e1c7..b0e558bc 100644 --- a/lib/uffizzi/clients/api/api_routes.rb +++ b/lib/uffizzi/clients/api/api_routes.rb @@ -59,4 +59,12 @@ def preview_services_uri(hostname, project_slug, deployment_id) def delete_credential_uri(hostname, credential_type) "#{hostname}/api/cli/v1/account/credentials/#{credential_type}" end + + def preview_service_logs_uri(hostname, project_slug, deployment_id, container_name) + "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}" + end + + def preview_service_build_logs_uri(hostname, project_slug, deployment_id, container_name) + "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/build/logs" + end end diff --git a/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json b/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json new file mode 100644 index 00000000..062203c3 --- /dev/null +++ b/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json @@ -0,0 +1,33 @@ +{ + "logs": [ + "/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration", + "/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/", + "/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh", + "10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf", + "10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf", + "/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh", + "/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh", + "/docker-entrypoint.sh: Configuration complete; ready for start up", + "2022/03/22 00:33:42 [notice] 1#1: using the \"epoll\" event method", + "2022/03/22 00:33:42 [notice] 1#1: nginx/1.21.6", + "2022/03/22 00:33:42 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) ", + "2022/03/22 00:33:42 [notice] 1#1: OS: Linux 5.4.144+", + "2022/03/22 00:33:42 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576", + "2022/03/22 00:33:42 [notice] 1#1: start worker processes", + "2022/03/22 00:33:42 [notice] 1#1: start worker process 33", + "10.20.3.2 - - [22/Mar/2022:00:35:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)\" \"169.254.169.252\"", + "10.20.3.2 - - [22/Mar/2022:00:35:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)\" \"10.128.0.114\"", + "10.20.3.2 - - [22/Mar/2022:00:35:42 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\" \"10.128.0.22\"", + "10.20.3.2 - - [22/Mar/2022:00:35:43 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\" \"169.254.169.252\"", + "10.20.3.2 - - [22/Mar/2022:00:35:48 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 15_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/604.1\" \"10.128.0.116\"", + "10.20.3.2 - - [22/Mar/2022:00:37:27 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36\" \"10.128.0.2\"", + "10.20.3.2 - - [22/Mar/2022:00:38:19 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36\" \"10.128.0.114\"", + "10.20.3.2 - - [22/Mar/2022:00:40:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36\" \"10.128.0.114\"", + "2022/03/22 00:40:32 [error] 33#33: *7 open() \"/usr/share/nginx/html/favicon.ico\" failed (2: No such file or directory), client: 10.20.3.2, server: localhost, request: \"GET /favicon.ico HTTP/1.1\", host: \"deployment-1284.default-adam.app.qa-gke.uffizzi.com\", referrer: \"https://deployment-1284.default-adam.app.qa-gke.uffizzi.com/\"", + "10.20.3.2 - - [22/Mar/2022:00:40:32 +0000] \"GET /favicon.ico HTTP/1.1\" 404 555 \"https://deployment-1284.default-adam.app.qa-gke.uffizzi.com/\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36\" \"10.128.0.114\"", + "10.20.3.2 - - [22/Mar/2022:03:27:13 +0000] \"GET / HTTP/1.1\" 200 615 \"www.ecosia.org\" \"Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\" \"10.128.0.114\"", + "2022/03/22 03:27:14 [error] 33#33: *9 open() \"/usr/share/nginx/html/favicon.ico\" failed (2: No such file or directory), client: 10.20.3.2, server: localhost, request: \"GET /favicon.ico HTTP/1.1\", host: \"deployment-1284.default-adam.app.qa-gke.uffizzi.com\", referrer: \"www.ecosia.org\"", + "10.20.3.2 - - [22/Mar/2022:03:27:14 +0000] \"GET /favicon.ico HTTP/1.1\" 404 153 \"www.ecosia.org\" \"Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\" \"10.128.0.2\"", + "" + ] +} diff --git a/test/support/uffizzi_preview_stub_support.rb b/test/support/uffizzi_preview_stub_support.rb index b0f20fa1..4bad7cc4 100644 --- a/test/support/uffizzi_preview_stub_support.rb +++ b/test/support/uffizzi_preview_stub_support.rb @@ -52,4 +52,10 @@ def stub_uffizzi_preview_services_list(body, project_slug, deployment_id) stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {}) end + + def stub_uffizzi_preview_service_logs(base_url, status, body, headers, params) + url = preview_service_logs_uri(base_url, params[:project_slug], params[:deployment_id], params[:container_name]) + + stub_request(:get, url).to_return(status: status, body: body.to_json, headers: headers) + end end diff --git a/test/uffizzi/cli/preview/service_test.rb b/test/uffizzi/cli/preview/service_test.rb index 06d68b52..d37fa675 100644 --- a/test/uffizzi/cli/preview/service_test.rb +++ b/test/uffizzi/cli/preview/service_test.rb @@ -20,4 +20,20 @@ def test_list_preview_services assert_requested(stubbed_uffizzi_preview_services_list) end + + def test_list_preview_service_logs + body = json_fixture('files/uffizzi/uffizzi_preview_service_logs_success.json') + container_name = 'redis' + deployment_id = 318 + params = { + project_slug: @project_slug, + deployment_id: deployment_id, + container_name: container_name, + } + stubbed_uffizzi_preview_service_logs = stub_uffizzi_preview_service_logs(Uffizzi.configuration.hostname, 200, body, {}, params) + + @service.logs('container', "deployment-#{deployment_id}", container_name) + + assert_requested(stubbed_uffizzi_preview_service_logs) + end end From e8bebbadf59f7a59c3fcf27b6989e001a208c61b Mon Sep 17 00:00:00 2001 From: moklidia Date: Wed, 23 Mar 2022 19:05:16 +0300 Subject: [PATCH 15/24] fixed api path --- lib/uffizzi/cli.rb | 4 ++++ lib/uffizzi/clients/api/api_routes.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/uffizzi/cli.rb b/lib/uffizzi/cli.rb index f68353c6..47331ed9 100644 --- a/lib/uffizzi/cli.rb +++ b/lib/uffizzi/cli.rb @@ -8,6 +8,10 @@ class CLI < Thor require_relative 'cli/common' class_option :help, type: :boolean, aliases: ['-h', 'help'] + def self.exit_on_failure? + true + end + desc 'version', 'show version' def version require_relative 'version' diff --git a/lib/uffizzi/clients/api/api_routes.rb b/lib/uffizzi/clients/api/api_routes.rb index b0e558bc..b3d24836 100644 --- a/lib/uffizzi/clients/api/api_routes.rb +++ b/lib/uffizzi/clients/api/api_routes.rb @@ -61,7 +61,7 @@ def delete_credential_uri(hostname, credential_type) end def preview_service_logs_uri(hostname, project_slug, deployment_id, container_name) - "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}" + "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/logs" end def preview_service_build_logs_uri(hostname, project_slug, deployment_id, container_name) From b32062fd9172ba7767560932656e516447e2ccb9 Mon Sep 17 00:00:00 2001 From: moklidia Date: Thu, 24 Mar 2022 09:47:20 +0300 Subject: [PATCH 16/24] added manual, implemented handling of wrong number of arguments error --- lib/uffizzi/cli/preview/service.rb | 5 +- man/uffizzi-preview_service_logs | 62 +++++++++++ man/uffizzi-preview_service_logs.html | 142 ++++++++++++++++++++++++++ man/uffizzi-preview_service_logs.ronn | 53 ++++++++++ 4 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 man/uffizzi-preview_service_logs create mode 100644 man/uffizzi-preview_service_logs.html create mode 100644 man/uffizzi-preview_service_logs.ronn diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index 8ef3ad88..4d77d5c9 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -8,12 +8,15 @@ module Uffizzi class CLI::Preview::Service < Thor include ApiClient + LOGS_REQUIRED_ARGUMENTS_NUMBER = 3 desc 'logs', 'logs' - def logs(logs_type, deployment_name, container_name) + def logs(*args) + return Cli::Common.show_manual(:preview_service_logs) if args.length != LOGS_REQUIRED_ARGUMENTS_NUMBER return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in? return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set? + logs_type, deployment_name, container_name = args deployment_id = deployment_name.split('-').last response = service_logs_response(logs_type, deployment_id, container_name) return Uffizzi.ui.say(response[:errors]) if response[:errors] diff --git a/man/uffizzi-preview_service_logs b/man/uffizzi-preview_service_logs new file mode 100644 index 00000000..afddbc15 --- /dev/null +++ b/man/uffizzi-preview_service_logs @@ -0,0 +1,62 @@ +.\" generated with Ronn-NG/v0.9.1 +.\" http://github.com/apjanke/ronn-ng/tree/0.9.1 +.TH "PREVIEW" "" "March 2022" "" +.SH "NAME" +\fBpreview\fR \- manage previews +.SH "NAME" +.nf +uffizzi preview service logs \- show the logs for a container service +of a preview +.fi +.SH "SYNOPSIS" +.nf +uffizzi preview service logs LOG_TYPE [PREVIEW_ID] [SERVICE] [UFFIZZI_WIDE_FLAG \|\.\|\.\|\.] +.fi +.SH "DESCRIPTION" +.nf +Shows the logs for a given container service of a given preview\. + +This command can fail for the following reasons: + \- There is no preview with the given PREVIEW_ID + \- There is no service with the name SERVICE + +For more information on service logs, see: +https://docs\.uffizzi\.com/cli +.fi +.SH "LOG_TYPE" +.nf +LOG_TYPE is one of the following: + +build + The build logs of a service\. + +container + The container logs of a service\. +.fi +.SH "POSITIONAL ARGUMENTS" +.nf +[PREVIEW_ID] + The ID of the preview that includes the service you want to + show logs for\. + +[SERVICE] + The name of the service you want to show logs for\. +.fi +.SH "UFFIZZI WIDE FLAGS" +.nf +These flags are available to all commands: \-\-project\. Run $ uffizzi +help for details\. +.fi +.SH "EXAMPLES" +.nf +The following command shows build logs for the service web\-app of the +preview with ID deployment\-14: + + $ uffizzi preview service logs build deployment\-14 web\-app + +The following command shows container logs for the service postgres\-db of +the preview with ID deployment\-14: + + $ uffizzi preview service logs container deployment\-14 postgres\-db +.fi + diff --git a/man/uffizzi-preview_service_logs.html b/man/uffizzi-preview_service_logs.html new file mode 100644 index 00000000..aefb4a8e --- /dev/null +++ b/man/uffizzi-preview_service_logs.html @@ -0,0 +1,142 @@ + + + + + + manage previews + + + + +
+ + + +
    +
  1. preview
  2. +
  3. +
  4. preview
  5. +
+ + + +

NAME

+

+ preview - manage previews +

+

NAME

+
uffizzi preview service logs - show the logs for a container service 
+of a preview
+
+ +

SYNOPSIS

+
uffizzi preview service logs LOG_TYPE [PREVIEW_ID] [SERVICE] [UFFIZZI_WIDE_FLAG ...] 
+
+ +

DESCRIPTION

+
Shows the logs for a given container service of a given preview.
+
+This command can fail for the following reasons: 
+    - There is no preview with the given PREVIEW_ID
+    - There is no service with the name SERVICE
+
+For more information on service logs, see:
+https://docs.uffizzi.com/cli
+
+ +

LOG_TYPE

+
LOG_TYPE is one of the following:
+
+build
+    The build logs of a service.
+
+container
+    The container logs of a service.
+
+ +

POSITIONAL ARGUMENTS

+
[PREVIEW_ID]
+    The ID of the preview that includes the service you want to 
+    show logs for.
+
+[SERVICE]
+    The name of the service you want to show logs for.
+
+ +

UFFIZZI WIDE FLAGS

+
These flags are available to all commands: --project. Run $ uffizzi 
+help for details.
+
+ +

EXAMPLES

+
The following command shows build logs for the service web-app of the 
+preview with ID deployment-14:
+
+    $ uffizzi preview service logs build deployment-14 web-app
+
+The following command shows container logs for the service postgres-db of 
+the preview with ID deployment-14:
+
+    $ uffizzi preview service logs container deployment-14 postgres-db
+
+ +
    +
  1. +
  2. March 2022
  3. +
  4. preview
  5. +
+ +
+ + diff --git a/man/uffizzi-preview_service_logs.ronn b/man/uffizzi-preview_service_logs.ronn new file mode 100644 index 00000000..d2e4ec61 --- /dev/null +++ b/man/uffizzi-preview_service_logs.ronn @@ -0,0 +1,53 @@ +uffizzi preview - manage previews +================================================================ + +## NAME + uffizzi preview service logs - show the logs for a container service + of a preview + +## SYNOPSIS + uffizzi preview service logs LOG_TYPE [PREVIEW_ID] [SERVICE] [UFFIZZI_WIDE_FLAG ...] + +## DESCRIPTION + Shows the logs for a given container service of a given preview. + + This command can fail for the following reasons: + - There is no preview with the given PREVIEW_ID + - There is no service with the name SERVICE + + For more information on service logs, see: + https://docs.uffizzi.com/cli + +## LOG_TYPE + LOG_TYPE is one of the following: + + build + The build logs of a service. + + container + The container logs of a service. + +## POSITIONAL ARGUMENTS + [PREVIEW_ID] + The ID of the preview that includes the service you want to + show logs for. + + [SERVICE] + The name of the service you want to show logs for. + + +## UFFIZZI WIDE FLAGS + These flags are available to all commands: --project. Run $ uffizzi + help for details. + +## EXAMPLES + The following command shows build logs for the service web-app of the + preview with ID deployment-14: + + $ uffizzi preview service logs build deployment-14 web-app + + The following command shows container logs for the service postgres-db of + the preview with ID deployment-14: + + $ uffizzi preview service logs container deployment-14 postgres-db + From 36714dfca52303f35dc73d1cdb5097e8387c5d40 Mon Sep 17 00:00:00 2001 From: moklidia Date: Fri, 25 Mar 2022 14:11:23 +0300 Subject: [PATCH 17/24] fix after rebase --- test/uffizzi/cli/apply_test.rb | 64 ---------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 test/uffizzi/cli/apply_test.rb diff --git a/test/uffizzi/cli/apply_test.rb b/test/uffizzi/cli/apply_test.rb deleted file mode 100644 index f4b76112..00000000 --- a/test/uffizzi/cli/apply_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require 'test_helper' - -class ApplyTest < Minitest::Test - def setup - @cli = Uffizzi::CLI.new - - sign_in - Uffizzi::ConfigFile.write_option(:project, 'dbp') - end - - def test_apply_success - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - body = json_fixture('files/uffizzi/uffizzi_create_deployment_success.json') - stubbed_uffizzi_create_deployment = stub_uffizzi_create_deployment(Uffizzi.configuration.hostname, 201, body, {}) - - @cli.options = { file: 'test/compose_files/test_compose_success.yml' } - @cli.apply - - assert_equal('deployment created', Uffizzi.ui.last_message) - assert_requested(stubbed_uffizzi_create_deployment) - assert_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_invalid_compose - body = json_fixture('files/uffizzi/uffizzi_create_compose_without_images.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 422, body, {}) - - error_message = body[:errors][:path].last - - @cli.options = { file: 'test/compose_files/test_compose_without_images.yml' } - @cli.apply - - assert_equal(error_message, Uffizzi.ui.last_message) - assert_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_invalid_path_to_dependency_file - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - @cli.options = { file: 'test/compose_files/test_compose_with_invalid_env_path.yml' } - - assert_raises(Errno::ENOENT) do - @cli.apply - end - - refute_requested(stubbed_uffizzi_create_compose) - end - - def test_apply_empty_path_to_dependency_file - body = json_fixture('files/uffizzi/uffizzi_create_compose_success.json') - stubbed_uffizzi_create_compose = stub_uffizzi_create_compose(Uffizzi.configuration.hostname, 201, body, {}) - @cli.options = { file: 'test/compose_files/test_compose_with_empty_env_path.yml' } - - assert_raises(TypeError) do - @cli.apply - end - - assert_equal('env_file contains an empty value', Uffizzi.ui.last_message) - refute_requested(stubbed_uffizzi_create_compose) - end -end From 6fe0d9dad0f27808c3e86e7e62e422bcea3adea1 Mon Sep 17 00:00:00 2001 From: moklidia Date: Mon, 28 Mar 2022 12:34:30 +0300 Subject: [PATCH 18/24] wip --- lib/uffizzi/cli/preview/service.rb | 4 +--- lib/uffizzi/clients/api/api_client.rb | 7 ------- lib/uffizzi/clients/api/api_routes.rb | 4 ---- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index 4d77d5c9..aa0fb7a6 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -54,10 +54,8 @@ def service_logs_response(logs_type, deployment_id, container_name) case logs_type when 'container' fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name) - when 'build' - fetch_deployment_service_build_logs(hostname, project_slug, deployment_id, container_name) else - { errors: 'Unknown log type' } + raise Thor::Error.new('Unknown log type') end end diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index 3fa47c6a..f47a4a2e 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -53,13 +53,6 @@ def fetch_deployment_service_logs(hostname, project_slug, deployment_id, contain build_response(response) end - def fetch_deployment_service_build_logs(hostname, project_slug, deployment_id, container_name) - uri = preview_service_build_logs_uri(hostname, project_slug, deployment_id, container_name) - response = Uffizzi::HttpClient.make_get_request(uri) - - build_response(response) - end - def set_compose_file(hostname, params, project_slug) uri = compose_file_uri(hostname, project_slug) response = Uffizzi::HttpClient.make_post_request(uri, params) diff --git a/lib/uffizzi/clients/api/api_routes.rb b/lib/uffizzi/clients/api/api_routes.rb index b3d24836..b6cd2f7d 100644 --- a/lib/uffizzi/clients/api/api_routes.rb +++ b/lib/uffizzi/clients/api/api_routes.rb @@ -63,8 +63,4 @@ def delete_credential_uri(hostname, credential_type) def preview_service_logs_uri(hostname, project_slug, deployment_id, container_name) "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/logs" end - - def preview_service_build_logs_uri(hostname, project_slug, deployment_id, container_name) - "#{hostname}/api/cli/v1/projects/#{project_slug}/deployments/#{deployment_id}/containers/#{container_name}/build/logs" - end end From 47d7304e94bf80d759540343624ca050c42f3d64 Mon Sep 17 00:00:00 2001 From: moklidia Date: Mon, 28 Mar 2022 16:33:51 +0300 Subject: [PATCH 19/24] removed unused functionality, updated the commands descrption --- lib/uffizzi/cli/preview/service.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index aa0fb7a6..a5edea01 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -10,14 +10,12 @@ class CLI::Preview::Service < Thor include ApiClient LOGS_REQUIRED_ARGUMENTS_NUMBER = 3 - desc 'logs', 'logs' - def logs(*args) - return Cli::Common.show_manual(:preview_service_logs) if args.length != LOGS_REQUIRED_ARGUMENTS_NUMBER + desc 'uffizzi preview service logs [LOGS_TYPE] [DEPLOYMENT_ID] [CONTAINER_NAME]', 'logs' + def logs(logs_type, deployment_name, container_name = args) return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in? return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set? - logs_type, deployment_name, container_name = args - deployment_id = deployment_name.split('-').last + deployment_id = PreviewService.read_deployment_id(deployment_name) response = service_logs_response(logs_type, deployment_id, container_name) return Uffizzi.ui.say(response[:errors]) if response[:errors] @@ -28,7 +26,7 @@ def logs(*args) end end - desc 'list', 'list' + desc 'uffizzi preview service logs [DEPLOYMENT_ID]', 'list' def list(deployment_name) return Uffizzi.ui.say('You are not logged in.') unless Uffizzi::AuthHelper.signed_in? return Uffizzi.ui.say('This command needs project to be set in config file') unless Uffizzi::AuthHelper.project_set? From 3d9e0b612afd7690e4b00a234be8ae04d8d22561 Mon Sep 17 00:00:00 2001 From: moklidia Date: Wed, 30 Mar 2022 16:29:27 +0300 Subject: [PATCH 20/24] added uffizzi error --- lib/uffizzi/cli/preview/service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index a5edea01..f967fd69 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -53,7 +53,7 @@ def service_logs_response(logs_type, deployment_id, container_name) when 'container' fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name) else - raise Thor::Error.new('Unknown log type') + raise Uffizzi::Error.new('Unknown log type') end end From f63d06db4065be8fd2c4787ce908c3943029a2c3 Mon Sep 17 00:00:00 2001 From: moklidia Date: Wed, 30 Mar 2022 17:42:39 +0300 Subject: [PATCH 21/24] refactoring --- lib/uffizzi/cli/preview/service.rb | 1 - test/support/uffizzi_preview_stub_support.rb | 6 +++--- test/uffizzi/cli/preview/service_test.rb | 7 +------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/uffizzi/cli/preview/service.rb b/lib/uffizzi/cli/preview/service.rb index f967fd69..28cc5cc2 100644 --- a/lib/uffizzi/cli/preview/service.rb +++ b/lib/uffizzi/cli/preview/service.rb @@ -8,7 +8,6 @@ module Uffizzi class CLI::Preview::Service < Thor include ApiClient - LOGS_REQUIRED_ARGUMENTS_NUMBER = 3 desc 'uffizzi preview service logs [LOGS_TYPE] [DEPLOYMENT_ID] [CONTAINER_NAME]', 'logs' def logs(logs_type, deployment_name, container_name = args) diff --git a/test/support/uffizzi_preview_stub_support.rb b/test/support/uffizzi_preview_stub_support.rb index 4bad7cc4..2907187b 100644 --- a/test/support/uffizzi_preview_stub_support.rb +++ b/test/support/uffizzi_preview_stub_support.rb @@ -53,9 +53,9 @@ def stub_uffizzi_preview_services_list(body, project_slug, deployment_id) stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {}) end - def stub_uffizzi_preview_service_logs(base_url, status, body, headers, params) - url = preview_service_logs_uri(base_url, params[:project_slug], params[:deployment_id], params[:container_name]) + def stub_uffizzi_preview_service_logs(body, project_slug, deployment_id, container_name) + url = preview_service_logs_uri(Uffizzi.configuration.hostname, project_slug, deployment_id, container_name) - stub_request(:get, url).to_return(status: status, body: body.to_json, headers: headers) + stub_request(:get, url).to_return(status: 200, body: body.to_json, headers: {}) end end diff --git a/test/uffizzi/cli/preview/service_test.rb b/test/uffizzi/cli/preview/service_test.rb index d37fa675..a1d28895 100644 --- a/test/uffizzi/cli/preview/service_test.rb +++ b/test/uffizzi/cli/preview/service_test.rb @@ -25,12 +25,7 @@ def test_list_preview_service_logs body = json_fixture('files/uffizzi/uffizzi_preview_service_logs_success.json') container_name = 'redis' deployment_id = 318 - params = { - project_slug: @project_slug, - deployment_id: deployment_id, - container_name: container_name, - } - stubbed_uffizzi_preview_service_logs = stub_uffizzi_preview_service_logs(Uffizzi.configuration.hostname, 200, body, {}, params) + stubbed_uffizzi_preview_service_logs = stub_uffizzi_preview_service_logs(body, @project_slug, deployment_id, container_name) @service.logs('container', "deployment-#{deployment_id}", container_name) From 97cade09fc065b05ed6cdb09be9befeefb23af5a Mon Sep 17 00:00:00 2001 From: moklidia Date: Wed, 30 Mar 2022 17:53:58 +0300 Subject: [PATCH 22/24] fix after rebase --- lib/uffizzi/clients/api/api_client.rb | 2 ++ test/support/uffizzi_stub_support.rb | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/uffizzi/clients/api/api_client.rb b/lib/uffizzi/clients/api/api_client.rb index f47a4a2e..a60bcf33 100644 --- a/lib/uffizzi/clients/api/api_client.rb +++ b/lib/uffizzi/clients/api/api_client.rb @@ -44,6 +44,8 @@ def fetch_deployment_services(hostname, project_slug, deployment_id) def delete_credential(hostname, credential_type) uri = delete_credential_uri(hostname, credential_type) response = Uffizzi::HttpClient.make_delete_request(uri) + + build_response(response) end def fetch_deployment_service_logs(hostname, project_slug, deployment_id, container_name) diff --git a/test/support/uffizzi_stub_support.rb b/test/support/uffizzi_stub_support.rb index bceddfe9..62bb22b0 100644 --- a/test/support/uffizzi_stub_support.rb +++ b/test/support/uffizzi_stub_support.rb @@ -90,16 +90,4 @@ def stub_uffizzi_delete_credential_fail(body, credential_type) stub_request(:delete, uri).to_return(status: 422, body: body.to_json) end - - def stub_uffizzi_create_compose(base_url, status, body, headers) - url = compose_files_uri(base_url) - - stub_request(:post, url).to_return(status: status, body: body.to_json, headers: headers) - end - - def stub_uffizzi_create_deployment(base_url, status, body, headers) - url = deployments_uri(base_url) - - stub_request(:post, url).to_return(status: status, body: body.to_json, headers: headers) - end end From 9011ea1cd6165d4601985889e72a6b84e2a46aee Mon Sep 17 00:00:00 2001 From: moklidia Date: Wed, 30 Mar 2022 18:18:24 +0300 Subject: [PATCH 23/24] removed sensitive info from fixture --- .../uffizzi_preview_service_logs_success.json | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json b/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json index 062203c3..11d280bd 100644 --- a/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json +++ b/test/fixtures/files/uffizzi/uffizzi_preview_service_logs_success.json @@ -14,20 +14,6 @@ "2022/03/22 00:33:42 [notice] 1#1: OS: Linux 5.4.144+", "2022/03/22 00:33:42 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576", "2022/03/22 00:33:42 [notice] 1#1: start worker processes", - "2022/03/22 00:33:42 [notice] 1#1: start worker process 33", - "10.20.3.2 - - [22/Mar/2022:00:35:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)\" \"169.254.169.252\"", - "10.20.3.2 - - [22/Mar/2022:00:35:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (compatible; CensysInspect/1.1; +https://about.censys.io/)\" \"10.128.0.114\"", - "10.20.3.2 - - [22/Mar/2022:00:35:42 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\" \"10.128.0.22\"", - "10.20.3.2 - - [22/Mar/2022:00:35:43 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko\" \"169.254.169.252\"", - "10.20.3.2 - - [22/Mar/2022:00:35:48 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (iPhone; CPU iPhone OS 15_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/604.1\" \"10.128.0.116\"", - "10.20.3.2 - - [22/Mar/2022:00:37:27 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1664.3 Safari/537.36\" \"10.128.0.2\"", - "10.20.3.2 - - [22/Mar/2022:00:38:19 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36\" \"10.128.0.114\"", - "10.20.3.2 - - [22/Mar/2022:00:40:32 +0000] \"GET / HTTP/1.1\" 200 615 \"-\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36\" \"10.128.0.114\"", - "2022/03/22 00:40:32 [error] 33#33: *7 open() \"/usr/share/nginx/html/favicon.ico\" failed (2: No such file or directory), client: 10.20.3.2, server: localhost, request: \"GET /favicon.ico HTTP/1.1\", host: \"deployment-1284.default-adam.app.qa-gke.uffizzi.com\", referrer: \"https://deployment-1284.default-adam.app.qa-gke.uffizzi.com/\"", - "10.20.3.2 - - [22/Mar/2022:00:40:32 +0000] \"GET /favicon.ico HTTP/1.1\" 404 555 \"https://deployment-1284.default-adam.app.qa-gke.uffizzi.com/\" \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36\" \"10.128.0.114\"", - "10.20.3.2 - - [22/Mar/2022:03:27:13 +0000] \"GET / HTTP/1.1\" 200 615 \"www.ecosia.org\" \"Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\" \"10.128.0.114\"", - "2022/03/22 03:27:14 [error] 33#33: *9 open() \"/usr/share/nginx/html/favicon.ico\" failed (2: No such file or directory), client: 10.20.3.2, server: localhost, request: \"GET /favicon.ico HTTP/1.1\", host: \"deployment-1284.default-adam.app.qa-gke.uffizzi.com\", referrer: \"www.ecosia.org\"", - "10.20.3.2 - - [22/Mar/2022:03:27:14 +0000] \"GET /favicon.ico HTTP/1.1\" 404 153 \"www.ecosia.org\" \"Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0\" \"10.128.0.2\"", - "" + "2022/03/22 00:33:42 [notice] 1#1: start worker process 33" ] } From ef0a499b59d3678d7a870b928392485014a7eea2 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Thu, 31 Mar 2022 08:47:01 +0000 Subject: [PATCH 24/24] v0.4.0 --- Gemfile.lock | 2 +- lib/uffizzi/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index c57f739d..5cc977c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - uffizzi-cli (0.3.8) + uffizzi-cli (0.4.0) thor tty-spinner diff --git a/lib/uffizzi/version.rb b/lib/uffizzi/version.rb index 1aa9f7f5..24b870b4 100644 --- a/lib/uffizzi/version.rb +++ b/lib/uffizzi/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uffizzi - VERSION = '0.3.8' + VERSION = '0.4.0' end