knapsack_pro 5.3.5 → 5.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/knapsack_pro/client/connection.rb +3 -6
- data/lib/knapsack_pro/config/ci/app_veyor.rb +4 -0
- data/lib/knapsack_pro/config/ci/base.rb +15 -0
- data/lib/knapsack_pro/config/ci/buildkite.rb +4 -0
- data/lib/knapsack_pro/config/ci/circle.rb +4 -0
- data/lib/knapsack_pro/config/ci/cirrus_ci.rb +4 -0
- data/lib/knapsack_pro/config/ci/codefresh.rb +4 -0
- data/lib/knapsack_pro/config/ci/codeship.rb +4 -0
- data/lib/knapsack_pro/config/ci/github_actions.rb +4 -0
- data/lib/knapsack_pro/config/ci/gitlab_ci.rb +4 -0
- data/lib/knapsack_pro/config/ci/heroku.rb +4 -0
- data/lib/knapsack_pro/config/ci/semaphore.rb +4 -0
- data/lib/knapsack_pro/config/ci/semaphore2.rb +4 -0
- data/lib/knapsack_pro/config/ci/travis.rb +4 -0
- data/lib/knapsack_pro/config/env.rb +4 -0
- data/lib/knapsack_pro/version.rb +1 -1
- data/spec/knapsack_pro/client/connection_spec.rb +5 -0
- data/spec/knapsack_pro/config/env_spec.rb +39 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e62965afc4edc8d9b00b2a2706499f2013b7e17df08d1864ba8bd6e25aae29ab
|
4
|
+
data.tar.gz: 2b5c2d0a48780c1f71fa8d99dcae03d23d1001cabcd9a7dbe6a243b32e152e75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a4d493dc1b46234b78f231567d7bfc7c1a6cf356dc0e02306f7a7c3261afd600b72be07c389c051ed96e09e491abc95f8d703c1432a22d1ed97d875b8d1fdf6
|
7
|
+
data.tar.gz: d406b157ef48520309ac3fb043738515105612f89389753a153ed074398f9b7f5bf5f6766f3c57a3407c25eb0982d81b5bc8109f8f8a4ac09911847a2c512c16
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
### 5.4.1
|
4
|
+
|
5
|
+
* Fixes RSpec conflict (see https://github.com/KnapsackPro/knapsack_pro-ruby/issues/217)
|
6
|
+
|
7
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/218
|
8
|
+
|
9
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.4.0...v5.4.1
|
10
|
+
|
11
|
+
### 5.4.0
|
12
|
+
|
13
|
+
* Send to the API the CI provider with a header
|
14
|
+
|
15
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/216
|
16
|
+
|
17
|
+
https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.5...v5.4.0
|
18
|
+
|
3
19
|
### 5.3.5
|
4
20
|
|
5
21
|
* Handle RSpec exceptions when running RSpec in Queue Mode
|
@@ -59,18 +59,15 @@ module KnapsackPro
|
|
59
59
|
request_hash.to_json
|
60
60
|
end
|
61
61
|
|
62
|
-
def test_suite_token
|
63
|
-
KnapsackPro::Config::Env.test_suite_token
|
64
|
-
end
|
65
|
-
|
66
62
|
def json_headers
|
67
63
|
{
|
68
64
|
'Content-Type' => 'application/json',
|
69
65
|
'Accept' => 'application/json',
|
70
66
|
'KNAPSACK-PRO-CLIENT-NAME' => client_name,
|
71
67
|
'KNAPSACK-PRO-CLIENT-VERSION' => KnapsackPro::VERSION,
|
72
|
-
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => test_suite_token,
|
73
|
-
|
68
|
+
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => KnapsackPro::Config::Env.test_suite_token,
|
69
|
+
'KNAPSACK-PRO-CI-PROVIDER' => KnapsackPro::Config::Env.ci_provider,
|
70
|
+
}.compact
|
74
71
|
end
|
75
72
|
|
76
73
|
def client_name
|
@@ -32,6 +32,21 @@ module KnapsackPro
|
|
32
32
|
def fixed_queue_split
|
33
33
|
true
|
34
34
|
end
|
35
|
+
|
36
|
+
def ci_provider
|
37
|
+
return 'AWS CodeBuild' if ENV.key?('CODEBUILD_BUILD_ARN')
|
38
|
+
return 'Azure Pipelines' if ENV.key?('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI')
|
39
|
+
return 'Bamboo' if ENV.key?('bamboo_planKey')
|
40
|
+
return 'Bitbucket Pipelines' if ENV.key?('BITBUCKET_COMMIT')
|
41
|
+
return 'Buddy.works' if ENV.key?('BUDDY')
|
42
|
+
return 'Drone.io' if ENV.key?('DRONE')
|
43
|
+
return 'Google Cloud Build' if ENV.key?('BUILDER_OUTPUT')
|
44
|
+
return 'Jenkins' if ENV.key?('JENKINS_URL')
|
45
|
+
return 'TeamCity' if ENV.key?('TEAMCITY_VERSION')
|
46
|
+
return 'Other' if KnapsackPro::Config::Env.ci?
|
47
|
+
|
48
|
+
nil
|
49
|
+
end
|
35
50
|
end
|
36
51
|
end
|
37
52
|
end
|
data/lib/knapsack_pro/version.rb
CHANGED
@@ -289,6 +289,7 @@ describe KnapsackPro::Client::Connection do
|
|
289
289
|
stub_const('ENV', {
|
290
290
|
'KNAPSACK_PRO_ENDPOINT' => 'http://api.knapsackpro.test:3000',
|
291
291
|
'KNAPSACK_PRO_TEST_SUITE_TOKEN' => test_suite_token,
|
292
|
+
'GITHUB_ACTIONS' => 'true',
|
292
293
|
})
|
293
294
|
end
|
294
295
|
|
@@ -323,6 +324,7 @@ describe KnapsackPro::Client::Connection do
|
|
323
324
|
'KNAPSACK-PRO-CLIENT-NAME' => 'knapsack_pro-ruby',
|
324
325
|
'KNAPSACK-PRO-CLIENT-VERSION' => KnapsackPro::VERSION,
|
325
326
|
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => test_suite_token,
|
327
|
+
'KNAPSACK-PRO-CI-PROVIDER' => 'GitHub Actions',
|
326
328
|
}
|
327
329
|
).and_return(http_response)
|
328
330
|
end
|
@@ -346,6 +348,7 @@ describe KnapsackPro::Client::Connection do
|
|
346
348
|
'KNAPSACK-PRO-CLIENT-NAME' => 'knapsack_pro-ruby',
|
347
349
|
'KNAPSACK-PRO-CLIENT-VERSION' => KnapsackPro::VERSION,
|
348
350
|
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => test_suite_token,
|
351
|
+
'KNAPSACK-PRO-CI-PROVIDER' => 'GitHub Actions',
|
349
352
|
}
|
350
353
|
).and_return(http_response)
|
351
354
|
end
|
@@ -368,6 +371,7 @@ describe KnapsackPro::Client::Connection do
|
|
368
371
|
'KNAPSACK-PRO-CLIENT-NAME' => 'knapsack_pro-ruby',
|
369
372
|
'KNAPSACK-PRO-CLIENT-VERSION' => KnapsackPro::VERSION,
|
370
373
|
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => test_suite_token,
|
374
|
+
'KNAPSACK-PRO-CI-PROVIDER' => 'GitHub Actions',
|
371
375
|
}
|
372
376
|
).and_return(http_response)
|
373
377
|
end
|
@@ -391,6 +395,7 @@ describe KnapsackPro::Client::Connection do
|
|
391
395
|
'KNAPSACK-PRO-CLIENT-NAME' => 'knapsack_pro-ruby',
|
392
396
|
'KNAPSACK-PRO-CLIENT-VERSION' => KnapsackPro::VERSION,
|
393
397
|
'KNAPSACK-PRO-TEST-SUITE-TOKEN' => test_suite_token,
|
398
|
+
'KNAPSACK-PRO-CI-PROVIDER' => 'GitHub Actions',
|
394
399
|
}
|
395
400
|
).and_return(http_response)
|
396
401
|
end
|
@@ -676,7 +676,7 @@ describe KnapsackPro::Config::Env do
|
|
676
676
|
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }],
|
677
677
|
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }],
|
678
678
|
['Travis CI', { 'TRAVIS' => 'true' }],
|
679
|
-
['Unsupported', {}],
|
679
|
+
['Unsupported CI', {}],
|
680
680
|
].each do |ci, env|
|
681
681
|
it "on #{ci} it is false" do
|
682
682
|
logger = instance_double(Logger)
|
@@ -704,7 +704,7 @@ describe KnapsackPro::Config::Env do
|
|
704
704
|
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }],
|
705
705
|
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }],
|
706
706
|
['Travis CI', { 'TRAVIS' => 'true' }],
|
707
|
-
['Unsupported', {}],
|
707
|
+
['Unsupported CI', {}],
|
708
708
|
].each do |ci, env|
|
709
709
|
it "on #{ci} it is true" do
|
710
710
|
logger = instance_double(Logger)
|
@@ -733,7 +733,7 @@ describe KnapsackPro::Config::Env do
|
|
733
733
|
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }, false],
|
734
734
|
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }, false],
|
735
735
|
['Travis CI', { 'TRAVIS' => 'true' }, true],
|
736
|
-
['Unsupported', {}, true],
|
736
|
+
['Unsupported CI', {}, true],
|
737
737
|
].each do |ci, env, expected|
|
738
738
|
it "on #{ci} it is #{expected}" do
|
739
739
|
logger = instance_double(Logger)
|
@@ -1032,7 +1032,7 @@ describe KnapsackPro::Config::Env do
|
|
1032
1032
|
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }, KnapsackPro::Config::CI::Semaphore],
|
1033
1033
|
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }, KnapsackPro::Config::CI::Semaphore2],
|
1034
1034
|
['Travis CI', { 'TRAVIS' => 'true' }, KnapsackPro::Config::CI::Travis],
|
1035
|
-
['Unsupported', {}, KnapsackPro::Config::CI::Base],
|
1035
|
+
['Unsupported CI', {}, KnapsackPro::Config::CI::Base],
|
1036
1036
|
].each do |ci, env, expected|
|
1037
1037
|
it "detects #{ci}" do
|
1038
1038
|
stub_const("ENV", env)
|
@@ -1046,7 +1046,7 @@ describe KnapsackPro::Config::Env do
|
|
1046
1046
|
[
|
1047
1047
|
['CI from env', { 'CI' => 'True' }, true],
|
1048
1048
|
['Travis CI', { 'TRAVIS' => 'true' }, true],
|
1049
|
-
['
|
1049
|
+
['missing CI from ENV or development', {}, false],
|
1050
1050
|
].each do |ci, env, expected|
|
1051
1051
|
it "detects #{ci}" do
|
1052
1052
|
stub_const("ENV", env)
|
@@ -1055,4 +1055,38 @@ describe KnapsackPro::Config::Env do
|
|
1055
1055
|
end
|
1056
1056
|
end
|
1057
1057
|
end
|
1058
|
+
|
1059
|
+
describe '.ci_provider' do
|
1060
|
+
[
|
1061
|
+
['AppVeyor', { 'APPVEYOR' => '123' }],
|
1062
|
+
['Azure Pipelines', { 'SYSTEM_TEAMFOUNDATIONCOLLECTIONURI' => '123' }],
|
1063
|
+
['AWS CodeBuild', { 'CODEBUILD_BUILD_ARN' => '123' }],
|
1064
|
+
['Bamboo', { 'bamboo_planKey' => '123' }],
|
1065
|
+
['Bitbucket Pipelines', { 'BITBUCKET_COMMIT' => '123' }],
|
1066
|
+
['Buddy.works', { 'BUDDY' => 'true' }],
|
1067
|
+
['Buildkite', { 'BUILDKITE' => 'true' }],
|
1068
|
+
['CircleCI', { 'CIRCLECI' => 'true' }],
|
1069
|
+
['Cirrus CI', { 'CIRRUS_CI' => 'true' }],
|
1070
|
+
['Codefresh', { 'CF_BUILD_ID' => '123' }],
|
1071
|
+
['Codeship', { 'CI_NAME' => 'codeship' }],
|
1072
|
+
['Drone.io', { 'DRONE' => 'true' }],
|
1073
|
+
['GitHub Actions', { 'GITHUB_ACTIONS' => 'true' }],
|
1074
|
+
['Gitlab CI', { 'GITLAB_CI' => 'true' }],
|
1075
|
+
['Google Cloud Build', { 'BUILDER_OUTPUT' => '123' }],
|
1076
|
+
['Heroku CI', { 'HEROKU_TEST_RUN_ID' => '123' }],
|
1077
|
+
['Jenkins', { 'JENKINS_URL' => '123' }],
|
1078
|
+
['Semaphore CI 1.0', { 'SEMAPHORE_BUILD_NUMBER' => '123' }],
|
1079
|
+
['Semaphore CI 2.0', { 'SEMAPHORE' => 'true', 'SEMAPHORE_WORKFLOW_ID' => '123' }],
|
1080
|
+
['TeamCity', { 'TEAMCITY_VERSION' => '123' }],
|
1081
|
+
['Travis CI', { 'TRAVIS' => 'true' }],
|
1082
|
+
['Other', { 'CI' => 'true'}],
|
1083
|
+
[nil, {}],
|
1084
|
+
].each do |ci, env|
|
1085
|
+
it "detects #{ci} name" do
|
1086
|
+
stub_const("ENV", env)
|
1087
|
+
|
1088
|
+
expect(described_class.ci_provider).to eq(ci)
|
1089
|
+
end
|
1090
|
+
end
|
1091
|
+
end
|
1058
1092
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knapsack_pro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ArturT
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|