From b003840e1594499d41b68c2c64a471859143b475 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Tue, 2 May 2023 18:30:15 +0200 Subject: [PATCH 1/3] Remove Solano CI support because Solano does not exist anymore --- lib/knapsack_pro.rb | 1 - lib/knapsack_pro/config/ci/solano_ci.rb | 32 -------- spec/knapsack_pro/config/ci/solano_ci_spec.rb | 73 ------------------- 3 files changed, 106 deletions(-) delete mode 100644 lib/knapsack_pro/config/ci/solano_ci.rb delete mode 100644 spec/knapsack_pro/config/ci/solano_ci_spec.rb diff --git a/lib/knapsack_pro.rb b/lib/knapsack_pro.rb index 98eafbb7..8b45d9a6 100644 --- a/lib/knapsack_pro.rb +++ b/lib/knapsack_pro.rb @@ -22,7 +22,6 @@ require_relative 'knapsack_pro/config/ci/buildkite' require_relative 'knapsack_pro/config/ci/travis' require_relative 'knapsack_pro/config/ci/snap_ci' -require_relative 'knapsack_pro/config/ci/solano_ci' require_relative 'knapsack_pro/config/ci/codeship' require_relative 'knapsack_pro/config/ci/github_actions' require_relative 'knapsack_pro/config/ci/heroku' diff --git a/lib/knapsack_pro/config/ci/solano_ci.rb b/lib/knapsack_pro/config/ci/solano_ci.rb deleted file mode 100644 index bd5ea3f1..00000000 --- a/lib/knapsack_pro/config/ci/solano_ci.rb +++ /dev/null @@ -1,32 +0,0 @@ -# http://docs.solanolabs.com/Setup/tddium-set-environment-variables/ -module KnapsackPro - module Config - module CI - class SolanoCI < Base - def node_total - # not provided - end - - def node_index - # not provided - end - - def node_build_id - ENV['TDDIUM_SESSION_ID'] - end - - def commit_hash - ENV['TDDIUM_CURRENT_COMMIT'] - end - - def branch - ENV['TDDIUM_CURRENT_BRANCH'] - end - - def project_dir - ENV['TDDIUM_REPO_ROOT'] - end - end - end - end -end diff --git a/spec/knapsack_pro/config/ci/solano_ci_spec.rb b/spec/knapsack_pro/config/ci/solano_ci_spec.rb deleted file mode 100644 index dede0770..00000000 --- a/spec/knapsack_pro/config/ci/solano_ci_spec.rb +++ /dev/null @@ -1,73 +0,0 @@ -describe KnapsackPro::Config::CI::SolanoCI do - let(:env) { {} } - - before do - stub_const('ENV', env) - end - - it { should be_kind_of KnapsackPro::Config::CI::Base } - - describe '#node_total' do - subject { described_class.new.node_total } - - it { should be nil } - end - - describe '#node_index' do - subject { described_class.new.node_index } - - it { should be nil } - end - - describe '#node_build_id' do - subject { described_class.new.node_build_id } - - context 'when environment exists' do - let(:env) { { 'TDDIUM_SESSION_ID' => 123 } } - it { should eql 123 } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#commit_hash' do - subject { described_class.new.commit_hash } - - context 'when environment exists' do - let(:env) { { 'TDDIUM_CURRENT_COMMIT' => '2e13512fc230d6f9ebf4923352718e4d' } } - it { should eql '2e13512fc230d6f9ebf4923352718e4d' } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#branch' do - subject { described_class.new.branch } - - context 'when environment exists' do - let(:env) { { 'TDDIUM_CURRENT_BRANCH' => 'master' } } - it { should eql 'master' } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#project_dir' do - subject { described_class.new.project_dir } - - context 'when environment exists' do - let(:env) { { 'TDDIUM_REPO_ROOT' => '/example/repo/root' } } - it { should eql '/example/repo/root' } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end -end From e76f0e3589b18802e9cff98363e17194f59e9abf Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Tue, 2 May 2023 18:32:09 +0200 Subject: [PATCH 2/3] Remove Snap CI support because Snap does not exist anymore --- lib/knapsack_pro.rb | 1 - lib/knapsack_pro/config/ci/snap_ci.rb | 35 ------- spec/knapsack_pro/config/ci/snap_ci_spec.rb | 104 -------------------- 3 files changed, 140 deletions(-) delete mode 100644 lib/knapsack_pro/config/ci/snap_ci.rb delete mode 100644 spec/knapsack_pro/config/ci/snap_ci_spec.rb diff --git a/lib/knapsack_pro.rb b/lib/knapsack_pro.rb index 8b45d9a6..f15da72c 100644 --- a/lib/knapsack_pro.rb +++ b/lib/knapsack_pro.rb @@ -21,7 +21,6 @@ require_relative 'knapsack_pro/config/ci/semaphore2' require_relative 'knapsack_pro/config/ci/buildkite' require_relative 'knapsack_pro/config/ci/travis' -require_relative 'knapsack_pro/config/ci/snap_ci' require_relative 'knapsack_pro/config/ci/codeship' require_relative 'knapsack_pro/config/ci/github_actions' require_relative 'knapsack_pro/config/ci/heroku' diff --git a/lib/knapsack_pro/config/ci/snap_ci.rb b/lib/knapsack_pro/config/ci/snap_ci.rb deleted file mode 100644 index fc97399c..00000000 --- a/lib/knapsack_pro/config/ci/snap_ci.rb +++ /dev/null @@ -1,35 +0,0 @@ -module KnapsackPro - module Config - module CI - class SnapCI < Base - def node_total - ENV['SNAP_WORKER_TOTAL'] - end - - def node_index - index = ENV['SNAP_WORKER_INDEX'] - index.to_i - 1 if index - end - - def node_build_id - ENV['SNAP_PIPELINE_COUNTER'] - end - - def commit_hash - ENV['SNAP_COMMIT'] - end - - # https://docs.snap-ci.com/environment-variables/ - # SNAP_BRANCH - the name of the git branch (not present on pull requests) - # SNAP_UPSTREAM_BRANCH - the upstream branch for which the pull request was opened - def branch - ENV['SNAP_BRANCH'] || ENV['SNAP_UPSTREAM_BRANCH'] - end - - def project_dir - ENV['SNAP_WORKING_DIR'] - end - end - end - end -end diff --git a/spec/knapsack_pro/config/ci/snap_ci_spec.rb b/spec/knapsack_pro/config/ci/snap_ci_spec.rb deleted file mode 100644 index 16dc9102..00000000 --- a/spec/knapsack_pro/config/ci/snap_ci_spec.rb +++ /dev/null @@ -1,104 +0,0 @@ -describe KnapsackPro::Config::CI::SnapCI do - let(:env) { {} } - - before do - stub_const('ENV', env) - end - - it { should be_kind_of KnapsackPro::Config::CI::Base } - - describe '#node_total' do - subject { described_class.new.node_total } - - context 'when environment exists' do - let(:env) { { 'SNAP_WORKER_TOTAL' => 4 } } - it { should eql 4 } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#node_index' do - subject { described_class.new.node_index } - - context 'when environment exists' do - let(:env) { { 'SNAP_WORKER_INDEX' => 4 } } - it { should eql 3 } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#node_build_id' do - subject { described_class.new.node_build_id } - - context 'when environment exists' do - let(:env) { { 'SNAP_PIPELINE_COUNTER' => 123 } } - it { should eql 123 } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#commit_hash' do - subject { described_class.new.commit_hash } - - context 'when environment exists' do - let(:env) { { 'SNAP_COMMIT' => '3fa64859337f6e56409d49f865d13fd7' } } - it { should eql '3fa64859337f6e56409d49f865d13fd7' } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#branch' do - subject { described_class.new.branch } - - context 'when environment exists' do - context 'when branch present' do - let(:env) { { 'SNAP_BRANCH' => 'master' } } - it { should eql 'master' } - end - - context 'when pull request' do - let(:env) { { 'SNAP_UPSTREAM_BRANCH' => 'feature-branch' } } - it { should eql 'feature-branch' } - end - - context 'branch has higher priority' do - let(:env) do - { - 'SNAP_BRANCH' => 'master', - 'SNAP_UPSTREAM_BRANCH' => 'feature-branch' - } - end - it { should eql 'master' } - end - end - - context "when environment doesn't exist" do - it { should be nil } - end - end - - describe '#project_dir' do - subject { described_class.new.project_dir } - - context 'when environment exists' do - let(:env) { { 'SNAP_WORKING_DIR' => '/var/snap-ci/repo' } } - it { should eql '/var/snap-ci/repo' } - end - - context "when environment doesn't exist" do - it { should be nil } - end - end -end From d79ed2f1dda739d8597d3908fa3687f22bc17bd4 Mon Sep 17 00:00:00 2001 From: Artur Trzop Date: Tue, 2 May 2023 18:33:40 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 44bab63a..e926285e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +### 3.10.0 + +* Remove Solano CI and Snap CI support because they do not exist anymore + + https://github.com/KnapsackPro/knapsack_pro-ruby/pull/194 + +https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v3.9.0...v3.10.0 + ### 3.9.0 * Suppress all RSpec spec file names displayed in stdout at the beginning of running tests in Regular Mode only when the log level is >= `warn`