fastlane-plugin-stream_actions 0.4.21 → 0.4.22
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 +4 -4
- data/lib/fastlane/plugin/stream_actions/actions/is_check_required.rb +2 -2
- data/lib/fastlane/plugin/stream_actions/actions/show_detailed_sdk_size.rb +2 -2
- data/lib/fastlane/plugin/stream_actions/actions/show_sdk_size.rb +1 -1
- data/lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb +2 -4
- data/lib/fastlane/plugin/stream_actions/helper/metrics_helper.rb +30 -0
- data/lib/fastlane/plugin/stream_actions/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4784999ab4dfa4274ec20304e8ff6f1e1228cc583a91e6ab4127a102cc34027f
|
|
4
|
+
data.tar.gz: 1853aa6c5258f011f768edbf4683dcca02b5081805c8d6e5e9169595e0e58272
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9236659fd7094336030f5994005e57a71e7b4a1d693aa3cc9a918fefd8b01bcf17b09d1b3fb3c0ca8ed3c0527622c52ceb4a7181b2cce7f4e5fb62aaa5e951f5
|
|
7
|
+
data.tar.gz: 7527de60fc668057e9ed3b1231174ad7999e6390346c7d6f63966cb41efc27bff7e35d633788080da9c04dca043c3bd0b93f2b57936767588dca997477c02bd3
|
|
@@ -27,7 +27,7 @@ module Fastlane
|
|
|
27
27
|
|
|
28
28
|
# The current push does not touch :sources. It is only safe to skip if :sources were already
|
|
29
29
|
# verified, i.e. all required checks passed on some commit that has the current :sources tree.
|
|
30
|
-
is_check_required = self.required_due_to_history(params, required_checks)
|
|
30
|
+
is_check_required = self.required_due_to_history?(params, required_checks)
|
|
31
31
|
UI.important("Check is required: #{is_check_required}")
|
|
32
32
|
is_check_required
|
|
33
33
|
end
|
|
@@ -39,7 +39,7 @@ module Fastlane
|
|
|
39
39
|
# Walks the PR commits from newest to oldest. Every commit newer than the last :sources change
|
|
40
40
|
# has the current :sources tree, so a passing run on any of them means :sources were verified.
|
|
41
41
|
# The walk stops at the commit that changed :sources, since older commits have different sources.
|
|
42
|
-
def self.required_due_to_history(params, required_checks)
|
|
42
|
+
def self.required_due_to_history?(params, required_checks)
|
|
43
43
|
repo = (params[:github_repository] || ENV['GITHUB_REPOSITORY']).to_s
|
|
44
44
|
if repo.empty?
|
|
45
45
|
UI.important("No repository provided; cannot verify previous runs, running check")
|
|
@@ -40,7 +40,7 @@ module Fastlane
|
|
|
40
40
|
header = "## #{sdk} XCSize"
|
|
41
41
|
content = "#{header}\nNo changes in SDK size."
|
|
42
42
|
unless differences.empty?
|
|
43
|
-
sorted_differences = differences.sort_by { |_, diff| -diff.to_s.gsub(/[
|
|
43
|
+
sorted_differences = differences.sort_by { |_, diff| -diff.to_s.gsub(/[+-]/, '').to_i }
|
|
44
44
|
content = "#{header}\n#{build_collapsible_table(sorted_differences.to_h)}"
|
|
45
45
|
end
|
|
46
46
|
UI.important(content)
|
|
@@ -58,7 +58,7 @@ module Fastlane
|
|
|
58
58
|
else
|
|
59
59
|
sh('git add -A')
|
|
60
60
|
sh("git commit -m 'Update #{metrics_path}'")
|
|
61
|
-
|
|
61
|
+
Helper::MetricsHelper.push
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
end
|
|
@@ -8,7 +8,7 @@ module Fastlane
|
|
|
8
8
|
upcoming_line = -1
|
|
9
9
|
changes_since_last_release = ''
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
file_data.each_with_index do |line, index|
|
|
12
12
|
if upcoming_line != -1
|
|
13
13
|
break if line.start_with?('# [')
|
|
14
14
|
|
|
@@ -28,9 +28,7 @@ module Fastlane
|
|
|
28
28
|
file_data.insert(upcoming_line + 2, '### 🔄 Changed')
|
|
29
29
|
file_data.insert(upcoming_line + 3, '')
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
changelog.puts(file_data)
|
|
33
|
-
changelog.close
|
|
31
|
+
File.open(params[:changelog_path], 'w') { |changelog| changelog.puts(file_data) }
|
|
34
32
|
UI.success("Successfully updated #{params[:changelog_path]}")
|
|
35
33
|
|
|
36
34
|
changes_since_last_release
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module Fastlane
|
|
2
|
+
module Helper
|
|
3
|
+
# Pushes commits to GetStream/stream-internal-metrics, which other repositories push to as well.
|
|
4
|
+
class MetricsHelper
|
|
5
|
+
# Rebases onto the latest metrics and pushes, retrying when another push got there first. Run it inside the
|
|
6
|
+
# metrics clone, after committing.
|
|
7
|
+
def self.push(attempts: 3)
|
|
8
|
+
1.upto(attempts) do |attempt|
|
|
9
|
+
rebase
|
|
10
|
+
begin
|
|
11
|
+
return Actions.sh('git push')
|
|
12
|
+
rescue FastlaneCore::Interface::FastlaneShellError
|
|
13
|
+
raise if attempt == attempts
|
|
14
|
+
|
|
15
|
+
UI.important("Pushing to stream-internal-metrics was rejected, retrying (#{attempt}/#{attempts}).")
|
|
16
|
+
sleep(attempt * 5)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# A conflict isn't retried: it would fail again on the unfinished rebase and hide the conflict.
|
|
22
|
+
def self.rebase
|
|
23
|
+
Actions.sh('git pull --rebase')
|
|
24
|
+
rescue FastlaneCore::Interface::FastlaneShellError
|
|
25
|
+
Actions.sh('git rebase --abort', error_callback: ->(_) {})
|
|
26
|
+
raise
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastlane-plugin-stream_actions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GetStream
|
|
@@ -142,14 +142,14 @@ dependencies:
|
|
|
142
142
|
requirements:
|
|
143
143
|
- - '='
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version:
|
|
145
|
+
version: 1.92.0
|
|
146
146
|
type: :development
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - '='
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version:
|
|
152
|
+
version: 1.92.0
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: rubocop-performance
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -266,6 +266,7 @@ files:
|
|
|
266
266
|
- lib/fastlane/plugin/stream_actions/actions/update_sdk_size_in_readme.rb
|
|
267
267
|
- lib/fastlane/plugin/stream_actions/actions/update_testplan.rb
|
|
268
268
|
- lib/fastlane/plugin/stream_actions/actions/wait_android_emu_idle.rb
|
|
269
|
+
- lib/fastlane/plugin/stream_actions/helper/metrics_helper.rb
|
|
269
270
|
- lib/fastlane/plugin/stream_actions/helper/test_coverage_map_helper.rb
|
|
270
271
|
- lib/fastlane/plugin/stream_actions/version.rb
|
|
271
272
|
homepage: https://github.com/GetStream/fastlane-plugin-stream_actions
|