ci_toolkit 1.5.24 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/Gemfile.lock +44 -37
- data/ci_toolkit.gemspec +1 -1
- data/lib/ci_toolkit/seetest_client.rb +10 -20
- 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: 86cd888726c86a779288d7e4a7d04bea4a1d1a52c479dcb862812f40ffa4f509
|
4
|
+
data.tar.gz: 75833b08101042e0d7d9b3dae759d5ff505525f95bc547295eb2eaa734381ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83eed0a9c51b4b4266648a505ba5cb1b861903631eca68ddc8bcb8ca8ade51e15727d882bde644f88f11ed2d2eb6375f5c990f98f2c112fc9b0971f98ddc9e80
|
7
|
+
data.tar.gz: d05f1b050e19d31291d570132deb5c3898fc1616629f7a4887813fec95e128bed07a08b38c5cfea82de491c375541a4b17a04bb5c7488f35bc41ff2c9e3a96b8
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ci_toolkit (1.
|
4
|
+
ci_toolkit (1.6.0)
|
5
5
|
faraday
|
6
6
|
faraday-multipart
|
7
7
|
faraday_middleware
|
@@ -14,22 +14,23 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
addressable (2.8.
|
18
|
-
public_suffix (>= 2.0.2, <
|
17
|
+
addressable (2.8.4)
|
18
|
+
public_suffix (>= 2.0.2, < 6.0)
|
19
19
|
ast (2.4.2)
|
20
|
-
date (3.
|
21
|
-
diff-lcs (1.
|
20
|
+
date (3.3.3)
|
21
|
+
diff-lcs (1.5.0)
|
22
22
|
docile (1.4.0)
|
23
|
-
faraday (1.
|
23
|
+
faraday (1.10.3)
|
24
24
|
faraday-em_http (~> 1.0)
|
25
25
|
faraday-em_synchrony (~> 1.0)
|
26
26
|
faraday-excon (~> 1.1)
|
27
|
-
faraday-httpclient (~> 1.0
|
27
|
+
faraday-httpclient (~> 1.0)
|
28
|
+
faraday-multipart (~> 1.0)
|
28
29
|
faraday-net_http (~> 1.0)
|
29
|
-
faraday-net_http_persistent (~> 1.
|
30
|
+
faraday-net_http_persistent (~> 1.0)
|
30
31
|
faraday-patron (~> 1.0)
|
31
32
|
faraday-rack (~> 1.0)
|
32
|
-
|
33
|
+
faraday-retry (~> 1.0)
|
33
34
|
ruby2_keywords (>= 0.0.4)
|
34
35
|
faraday-em_http (1.0.0)
|
35
36
|
faraday-em_synchrony (1.0.0)
|
@@ -41,6 +42,7 @@ GEM
|
|
41
42
|
faraday-net_http_persistent (1.2.0)
|
42
43
|
faraday-patron (1.0.0)
|
43
44
|
faraday-rack (1.0.0)
|
45
|
+
faraday-retry (1.0.3)
|
44
46
|
faraday_middleware (1.2.0)
|
45
47
|
faraday (~> 1.0)
|
46
48
|
gitlab (4.19.0)
|
@@ -49,38 +51,36 @@ GEM
|
|
49
51
|
httparty (0.21.0)
|
50
52
|
mini_mime (>= 1.0.0)
|
51
53
|
multi_xml (>= 0.5.2)
|
52
|
-
|
53
|
-
|
54
|
-
jwt (2.3.0)
|
54
|
+
json (2.6.3)
|
55
|
+
jwt (2.7.0)
|
55
56
|
mini_mime (1.1.2)
|
56
57
|
multi_xml (0.6.0)
|
57
|
-
multipart-post (2.
|
58
|
-
octokit (
|
59
|
-
faraday (>=
|
60
|
-
sawyer (~> 0.
|
61
|
-
openssl (
|
62
|
-
ipaddr
|
58
|
+
multipart-post (2.3.0)
|
59
|
+
octokit (6.1.1)
|
60
|
+
faraday (>= 1, < 3)
|
61
|
+
sawyer (~> 0.9)
|
62
|
+
openssl (3.1.0)
|
63
63
|
parallel (1.23.0)
|
64
64
|
parser (3.2.2.1)
|
65
65
|
ast (~> 2.4.1)
|
66
|
-
public_suffix (
|
66
|
+
public_suffix (5.0.1)
|
67
67
|
rainbow (3.1.1)
|
68
68
|
rake (13.0.6)
|
69
69
|
regexp_parser (2.8.0)
|
70
70
|
rexml (3.2.5)
|
71
|
-
rspec (3.
|
72
|
-
rspec-core (~> 3.
|
73
|
-
rspec-expectations (~> 3.
|
74
|
-
rspec-mocks (~> 3.
|
75
|
-
rspec-core (3.
|
76
|
-
rspec-support (~> 3.
|
77
|
-
rspec-expectations (3.
|
71
|
+
rspec (3.12.0)
|
72
|
+
rspec-core (~> 3.12.0)
|
73
|
+
rspec-expectations (~> 3.12.0)
|
74
|
+
rspec-mocks (~> 3.12.0)
|
75
|
+
rspec-core (3.12.2)
|
76
|
+
rspec-support (~> 3.12.0)
|
77
|
+
rspec-expectations (3.12.3)
|
78
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
|
-
rspec-support (~> 3.
|
80
|
-
rspec-mocks (3.
|
79
|
+
rspec-support (~> 3.12.0)
|
80
|
+
rspec-mocks (3.12.5)
|
81
81
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
-
rspec-support (~> 3.
|
83
|
-
rspec-support (3.
|
82
|
+
rspec-support (~> 3.12.0)
|
83
|
+
rspec-support (3.12.0)
|
84
84
|
rubocop (1.51.0)
|
85
85
|
json (~> 2.3)
|
86
86
|
parallel (~> 1.10)
|
@@ -93,16 +93,22 @@ GEM
|
|
93
93
|
unicode-display_width (>= 2.4.0, < 3.0)
|
94
94
|
rubocop-ast (1.28.1)
|
95
95
|
parser (>= 3.2.1.0)
|
96
|
+
rubocop-capybara (2.18.0)
|
97
|
+
rubocop (~> 1.41)
|
98
|
+
rubocop-factory_bot (2.23.1)
|
99
|
+
rubocop (~> 1.33)
|
96
100
|
rubocop-rake (0.6.0)
|
97
101
|
rubocop (~> 1.0)
|
98
|
-
rubocop-rspec (2.
|
99
|
-
rubocop (~> 1.
|
102
|
+
rubocop-rspec (2.22.0)
|
103
|
+
rubocop (~> 1.33)
|
104
|
+
rubocop-capybara (~> 2.17)
|
105
|
+
rubocop-factory_bot (~> 2.22)
|
100
106
|
ruby-progressbar (1.13.0)
|
101
107
|
ruby2_keywords (0.0.5)
|
102
|
-
sawyer (0.
|
108
|
+
sawyer (0.9.2)
|
103
109
|
addressable (>= 2.3.5)
|
104
|
-
faraday (
|
105
|
-
simplecov (0.
|
110
|
+
faraday (>= 0.17.3, < 3)
|
111
|
+
simplecov (0.22.0)
|
106
112
|
docile (~> 1.1)
|
107
113
|
simplecov-html (~> 0.11)
|
108
114
|
simplecov_json_formatter (~> 0.1)
|
@@ -110,16 +116,17 @@ GEM
|
|
110
116
|
simplecov-json (0.2.3)
|
111
117
|
json
|
112
118
|
simplecov
|
113
|
-
simplecov_json_formatter (0.1.
|
119
|
+
simplecov_json_formatter (0.1.4)
|
114
120
|
terminal-table (3.0.2)
|
115
121
|
unicode-display_width (>= 1.1.1, < 3)
|
116
|
-
time (0.2.
|
122
|
+
time (0.2.2)
|
117
123
|
date
|
118
124
|
unicode-display_width (2.4.2)
|
119
125
|
|
120
126
|
PLATFORMS
|
121
127
|
universal-darwin-20
|
122
128
|
x86_64-darwin-21
|
129
|
+
x86_64-darwin-22
|
123
130
|
x86_64-linux
|
124
131
|
|
125
132
|
DEPENDENCIES
|
data/ci_toolkit.gemspec
CHANGED
@@ -19,7 +19,6 @@ module CiToolkit
|
|
19
19
|
@faraday_conn = bot.faraday_conn
|
20
20
|
end
|
21
21
|
|
22
|
-
# rubocop:disable Metrics/AbcSize
|
23
22
|
# rubocop:disable Metrics/MethodLength
|
24
23
|
def upload_file(
|
25
24
|
project_name:,
|
@@ -35,16 +34,8 @@ module CiToolkit
|
|
35
34
|
).body
|
36
35
|
|
37
36
|
# Application already exists. Replace it.
|
38
|
-
if response[
|
39
|
-
|
40
|
-
response[:data][:id],
|
41
|
-
project_name,
|
42
|
-
unique_name,
|
43
|
-
full_path_to_file,
|
44
|
-
content_type
|
45
|
-
)
|
46
|
-
# Application with unique name already exist. Replace it.
|
47
|
-
elsif response[:status] == ERROR && !response[:data].nil? && !response[:data][:uniqueName].nil?
|
37
|
+
if (response["status"] == SUCCESS && response["data"]["created"] == "false") ||
|
38
|
+
(response["status"] == ERROR && response.dig("data", "uniqueName"))
|
48
39
|
response = replace_existing_application_by_unique_name(
|
49
40
|
project_name,
|
50
41
|
unique_name,
|
@@ -53,14 +44,13 @@ module CiToolkit
|
|
53
44
|
)
|
54
45
|
end
|
55
46
|
|
56
|
-
unless response[
|
47
|
+
unless response["status"] == SUCCESS
|
57
48
|
raise StandardError,
|
58
49
|
"Upload response from Seetest returned an error. Response body is: '#{response}'"
|
59
50
|
end
|
60
51
|
|
61
|
-
response[
|
52
|
+
response["status"]
|
62
53
|
end
|
63
|
-
# rubocop:enable Metrics/AbcSize Metrics/MethodLength
|
64
54
|
# rubocop:enable Metrics/MethodLength
|
65
55
|
|
66
56
|
private
|
@@ -74,7 +64,7 @@ module CiToolkit
|
|
74
64
|
)
|
75
65
|
response = faraday_delete_application(application_id)
|
76
66
|
|
77
|
-
if response[
|
67
|
+
if response["status"] == SUCCESS && response["code"] == OKAY
|
78
68
|
response = faraday_upload_file_with_error_handling(project_name, unique_name, full_path_to_file, content_type)
|
79
69
|
end
|
80
70
|
response
|
@@ -83,11 +73,11 @@ module CiToolkit
|
|
83
73
|
def replace_existing_application_by_unique_name(project_name, unique_name, full_path_to_file, content_type)
|
84
74
|
application_info_response = faraday_get_application_info(unique_name)
|
85
75
|
application_info_response.each do |app_response|
|
86
|
-
next unless app_response[
|
76
|
+
next unless app_response["uniqueName"] == unique_name
|
87
77
|
|
88
|
-
response = replace_existing_application(app_response[
|
78
|
+
response = replace_existing_application(app_response["id"], project_name, unique_name, full_path_to_file,
|
89
79
|
content_type)
|
90
|
-
return response if response[
|
80
|
+
return response if response["status"] == SUCCESS
|
91
81
|
end
|
92
82
|
end
|
93
83
|
|
@@ -98,7 +88,7 @@ module CiToolkit
|
|
98
88
|
content_type
|
99
89
|
)
|
100
90
|
response = faraday_upload(project_name, unique_name, full_path_to_file, content_type).body
|
101
|
-
unless response[
|
91
|
+
unless response["status"] == SUCCESS && response["data"]["created"] == "true"
|
102
92
|
raise StandardError,
|
103
93
|
"Upload response from Seetest returned an error. Response body is: '#{response}'"
|
104
94
|
end
|
@@ -134,7 +124,7 @@ module CiToolkit
|
|
134
124
|
|
135
125
|
def faraday_delete_application(application_id)
|
136
126
|
response = @faraday_conn.post("/api/#{API_VERSION}/applications/#{application_id}/delete").body
|
137
|
-
unless response[
|
127
|
+
unless response["status"] == SUCCESS && response["code"] == OKAY
|
138
128
|
raise StandardError,
|
139
129
|
"Delete application id: #{application_id} from Seetest returned an error. " \
|
140
130
|
"Response body is: '#{response}'"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ci_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gero Keller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|