fastlane-plugin-stream_actions 0.3.95 → 0.3.97
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: 8a193cc074f71792d8b2e31efee85fbc4009f8cbb229ab6a30ff707f413b651d
|
4
|
+
data.tar.gz: 74aac147a2e0e2c66b83bb9eaa86ea3d8f96aca71d959714792f764551e2aa99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01c68802bbb6161184467bd63f622bbee230d37de0b0565368a69b1e6afe07452f670d61e720817e490228b1437a3af7fd90074a0c60a5848b8113add263b50f
|
7
|
+
data.tar.gz: 0d66d8726903fbd9d84d3a36742e9b0194388314d1aabc63d88bf5c8357a5ebc9500b57e73932bf74e8a3f6c28945e00a3d33d23d89c484324210efaeaea2f16
|
@@ -2,42 +2,87 @@ module Fastlane
|
|
2
2
|
module Actions
|
3
3
|
class ShowDetailedSdkSizeAction < Action
|
4
4
|
def self.run(params)
|
5
|
+
is_release = other_action.current_branch.include?('release/')
|
5
6
|
metrics_dir = 'metrics'
|
6
7
|
FileUtils.remove_dir(metrics_dir, force: true)
|
7
8
|
sh("git clone git@github.com:GetStream/stream-internal-metrics.git #{metrics_dir}")
|
8
9
|
|
9
10
|
params[:sdk_names].each do |sdk|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
metrics_path = "metrics/linkmaps/#{sdk}.json"
|
12
|
+
metrics_branch = is_release ? 'release' : 'develop'
|
13
|
+
metrics = JSON.parse(File.read(metrics_path))
|
14
|
+
old_details = metrics[metrics_branch]
|
15
|
+
new_details = other_action.xcsize(
|
16
|
+
linkmap: "linkmaps/#{sdk}-LinkMap.txt",
|
17
|
+
threshold: 0 # Threshold is set to 0 to show all objects
|
16
18
|
)[:details]
|
17
19
|
|
20
|
+
# Compare old linkmap and new linkmap objects sizes
|
21
|
+
differences = {}
|
22
|
+
|
23
|
+
# Handle old linkmap objects
|
24
|
+
old_details.each do |object, value|
|
25
|
+
new_value = new_details[object] || 0
|
26
|
+
diff = new_value - value
|
27
|
+
if diff.abs >= params[:threshold]
|
28
|
+
differences[object] = diff > 0 ? "+#{diff}" : diff.to_s
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Handle objects that are present only in new linkmap
|
33
|
+
new_details.each do |object, value|
|
34
|
+
if value >= params[:threshold] && !old_details.key?(object)
|
35
|
+
differences[object] = "+#{value}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
18
39
|
header = "## #{sdk} XCSize"
|
19
40
|
content = "#{header}\nNo changes in SDK size."
|
20
|
-
unless
|
21
|
-
|
22
|
-
details.each { |object, diff| table << "| #{object} | #{diff} |\n" }
|
23
|
-
content = "#{header}\n#{table}"
|
41
|
+
unless differences.empty?
|
42
|
+
content = "#{header}\n#{build_collapsible_table(differences)}"
|
24
43
|
end
|
44
|
+
UI.important(content)
|
25
45
|
|
26
|
-
|
27
|
-
|
46
|
+
next unless other_action.is_ci
|
47
|
+
|
48
|
+
if is_release || (ENV['GITHUB_EVENT_NAME'].to_s == 'push' && other_action.current_branch == 'develop')
|
49
|
+
metrics[metrics_branch] = new_details
|
50
|
+
File.write(metrics_path, JSON.pretty_generate(metrics))
|
28
51
|
Dir.chdir(metrics_dir) do
|
29
52
|
if sh('git status -s').to_s.empty?
|
30
53
|
UI.important('No changes in linkmap.')
|
31
54
|
else
|
32
55
|
sh('git add -A')
|
33
|
-
sh("git commit -m 'Update #{
|
56
|
+
sh("git commit -m 'Update #{metrics_path}'")
|
34
57
|
sh('git push')
|
35
58
|
end
|
36
59
|
end
|
37
60
|
end
|
38
61
|
|
39
|
-
other_action.pr_comment(text: content, edit_last_comment_with_text: header)
|
62
|
+
other_action.pr_comment(text: content, edit_last_comment_with_text: header)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.build_collapsible_table(differences)
|
67
|
+
differences_list = differences.to_a
|
68
|
+
visible_count = [5, differences_list.length].min
|
69
|
+
hidden_count = differences_list.length - visible_count
|
70
|
+
main_row = "| `Object` | `Diff (bytes)` |\n| - | - |\n"
|
71
|
+
|
72
|
+
table = main_row
|
73
|
+
differences_list.first(visible_count).each do |object, diff|
|
74
|
+
table << "| #{object} | #{diff} |\n"
|
40
75
|
end
|
76
|
+
|
77
|
+
if hidden_count > 0
|
78
|
+
table << "\n<details>\n<summary>Show #{hidden_count} more objects</summary>\n\n#{main_row}"
|
79
|
+
differences_list[visible_count..-1].each do |object, diff|
|
80
|
+
table << "| #{object} | #{diff} |\n"
|
81
|
+
end
|
82
|
+
table << "</details>"
|
83
|
+
end
|
84
|
+
|
85
|
+
table
|
41
86
|
end
|
42
87
|
|
43
88
|
#####################################################
|
@@ -45,7 +90,7 @@ module Fastlane
|
|
45
90
|
#####################################################
|
46
91
|
|
47
92
|
def self.description
|
48
|
-
'Show
|
93
|
+
'Show SDK objects size'
|
49
94
|
end
|
50
95
|
|
51
96
|
def self.available_options
|
@@ -57,6 +102,13 @@ module Fastlane
|
|
57
102
|
verify_block: proc do |sdks|
|
58
103
|
UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
|
59
104
|
end
|
105
|
+
),
|
106
|
+
FastlaneCore::ConfigItem.new(
|
107
|
+
key: :threshold,
|
108
|
+
description: 'Set minimum size threshold in bytes',
|
109
|
+
optional: true,
|
110
|
+
is_string: false,
|
111
|
+
default_value: 1
|
60
112
|
)
|
61
113
|
]
|
62
114
|
end
|
@@ -58,25 +58,23 @@ module Fastlane
|
|
58
58
|
FastlaneCore::PrintTable.print_values(title: 'Benchmark', config: benchmark_sizes)
|
59
59
|
FastlaneCore::PrintTable.print_values(title: 'SDK Size', config: params[:branch_sizes])
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
61
|
+
return unless other_action.is_ci
|
62
|
+
|
63
|
+
if is_release || (ENV['GITHUB_EVENT_NAME'].to_s == 'push' && other_action.current_branch == 'develop')
|
64
|
+
benchmark_config[benchmark_key] = params[:branch_sizes]
|
65
|
+
File.write(sdk_size_path, JSON.pretty_generate(benchmark_config))
|
66
|
+
Dir.chdir(File.dirname(sdk_size_path)) do
|
67
|
+
if sh('git status -s').to_s.empty?
|
68
|
+
UI.important('No changes in SDK sizes benchmarks.')
|
69
|
+
else
|
70
|
+
sh('git add -A')
|
71
|
+
sh("git commit -m 'Update #{sdk_size_path}'")
|
72
|
+
sh('git push')
|
73
73
|
end
|
74
74
|
end
|
75
|
-
|
76
|
-
other_action.pr_comment(text: markdown_table, edit_last_comment_with_text: table_header)
|
77
75
|
end
|
78
76
|
|
79
|
-
|
77
|
+
other_action.pr_comment(text: markdown_table, edit_last_comment_with_text: table_header)
|
80
78
|
end
|
81
79
|
|
82
80
|
#####################################################
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-stream_actions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.97
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GetStream
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-10-
|
11
|
+
date: 2025-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xctest_list
|