fastlane-plugin-sonarcloud_metric_kit 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3002e5c1f9aeb9fb87cccee5d719e4b4ff7efd3e088db5a35b5dd55d19728426
|
|
4
|
+
data.tar.gz: 89135f2c805e7e14e5c673c000c2c5da8756565d551b991aec5bee399c133d61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 434f43511a8c5c5745d6cfde729fc9cb52945f2f3052f91414f4dc6f92a8a7479f1c6e04c02e6eca8690a6497d370f5813f6df830830f37a197937bc97371e35
|
|
7
|
+
data.tar.gz: 8171c035d8ab2960dc26a327945fb815cd596c7ebd5ce3fe86c80d20c55c135a06f9c73b05505e4d3d7a0d64432f32b394ee2ee5cd0d654163423442e00285a8
|
|
@@ -36,15 +36,21 @@ module Fastlane
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def self.get_measures(params)
|
|
39
|
-
queries = "componentKey=#{params[:project_key]}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
json_parse(
|
|
39
|
+
queries = ["componentKey=#{params[:project_key]}", "metricKeys=#{metric_keys.join(',')}"]
|
|
40
|
+
queries << "branch=#{params[:branch]}" if params[:branch]
|
|
41
|
+
url = URI("#{api_url}/measures/component?#{queries.join('&')}")
|
|
42
|
+
response = json_parse(request(url, token: params[:sonar_token]).read_body)
|
|
43
|
+
UI.user_error!(response) unless response['component']
|
|
44
|
+
response['component']['measures']
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
def self.get_quality_gate(params)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
queries = ["projectKey=#{params[:project_key]}"]
|
|
49
|
+
queries << "branch=#{params[:branch]}" if params[:branch]
|
|
50
|
+
url = URI("#{api_url}/qualitygates/project_status?#{queries.join('&')}")
|
|
51
|
+
response = json_parse(request(url, token: params[:sonar_token]).read_body)
|
|
52
|
+
UI.user_error!(response) unless response['projectStatus']
|
|
53
|
+
response['projectStatus']
|
|
48
54
|
end
|
|
49
55
|
|
|
50
56
|
def self.request(url, token:)
|
|
@@ -166,6 +172,12 @@ module Fastlane
|
|
|
166
172
|
is_string: false,
|
|
167
173
|
optional: true,
|
|
168
174
|
default_value: false
|
|
175
|
+
),
|
|
176
|
+
FastlaneCore::ConfigItem.new(
|
|
177
|
+
key: :branch,
|
|
178
|
+
description: 'Git branch to use for collecting metrics',
|
|
179
|
+
is_string: true,
|
|
180
|
+
optional: true
|
|
169
181
|
)
|
|
170
182
|
]
|
|
171
183
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastlane-plugin-sonarcloud_metric_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- alteral
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-05-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|