fastlane 2.31.0.beta.20170517010031 → 2.31.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a30951842470091899d3906a174d24afb87bf26
4
- data.tar.gz: 5d4f934013d9170cd40f388888c4a86804af7f26
3
+ metadata.gz: 7eb8e75562fffaf1d53fcf0f5a1c6346660358fd
4
+ data.tar.gz: c432cf04407935b14f37f5b17a9c737520f7cfe2
5
5
  SHA512:
6
- metadata.gz: 3305e215b86980217d17d9223fa98864e8733e27d603e20a4c754e381a0d5c374cce905d82a60fe425b4c73dbace93cae462432128f4c2b5def3dcf725b61af0
7
- data.tar.gz: 33181d1e04b10e8bc9c6fddcf0e77c7dca5eddbda0584ed3310eb562004ad7464e82694b09c7476a99c9c8339ada975558f3ccb29fbeb67e2b9a84c03a2cb0e5
6
+ metadata.gz: 470b62aedec8b26f967e0ca741ccae2f2518d0b00425f819792d175e35af28c4fbbac68c3faa02425b7ed228dbfa1813dbf14600fe400d7d4540afdc1108db1a
7
+ data.tar.gz: 47d3a16fa480d2bf86b40578738916defa97c4ce933e1c2b187586ee7fa3255803497eb59932521ca963f65f71ad28fce5c9ba4c7076dd295fcd0c9f4491d383
@@ -52,7 +52,7 @@ module Fastlane
52
52
  message += "\n#{result}" if print_command_output
53
53
 
54
54
  error_callback.call(result) if error_callback
55
- UI.user_error!(message)
55
+ UI.shell_error!(message)
56
56
  end
57
57
  end
58
58
 
@@ -257,14 +257,13 @@ module Fastlane
257
257
  FastlaneCore::Interface::FastlaneTestFailure => e # test_failure!
258
258
  raise e
259
259
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
260
- FastlaneCore::CrashReporter.report_crash(type: :user_error, exception: e, action: method_sym)
260
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: method_sym)
261
261
  collector.did_raise_error(method_sym)
262
262
  raise e
263
263
  rescue Exception => e # rubocop:disable Lint/RescueException
264
264
  # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
265
265
  # Catches all exceptions, since some plugins might use system exits to get out
266
- type = e.kind_of?(FastlaneCore::Interface::FastlaneCrash) ? :crash : :exception
267
- FastlaneCore::CrashReporter.report_crash(type: type, exception: e, action: method_sym)
266
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: method_sym)
268
267
  collector.did_crash(method_sym)
269
268
  raise e
270
269
  end
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.31.0.beta.20170517010031'.freeze
2
+ VERSION = '2.31.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -34,6 +34,10 @@ require 'fastlane_core/build_watcher'
34
34
  require 'fastlane_core/crash_reporter/crash_reporter'
35
35
  require 'fastlane_core/crash_reporter/crash_report_generator'
36
36
  require 'fastlane_core/crash_reporter/crash_report_sanitizer'
37
+ require 'fastlane_core/ui/errors/fastlane_exception'
38
+ require 'fastlane_core/ui/errors/fastlane_error'
39
+ require 'fastlane_core/ui/errors/fastlane_crash'
40
+ require 'fastlane_core/ui/errors/fastlane_shell_error'
37
41
 
38
42
  # Third Party code
39
43
  require 'colored'
@@ -1,38 +1,29 @@
1
1
  module FastlaneCore
2
2
  class CrashReportGenerator
3
3
  class << self
4
- def types
5
- {
6
- user_error: '[USER_ERROR]',
7
- crash: '[FASTLANE_CRASH]',
8
- exception: '[EXCEPTION]',
9
- connection_failure: '[CONNECTION_FAILURE]',
10
- system: '[SYSTEM_ERROR]',
11
- option_parser: '[OPTION_PARSER]',
12
- invalid_command: '[INVALID_COMMAND]',
13
- unknown: '[UNKNOWN]'
14
- }
15
- end
16
-
17
- def generate(type: :unknown, exception: nil, action: nil)
18
- message = crash_report_message(type: type, exception: exception)
4
+ def generate(exception: nil, action: nil)
5
+ message = format_crash_report_message(exception: exception)
19
6
  crash_report_payload(message: message, action: action)
20
7
  end
21
8
 
22
9
  private
23
10
 
24
- def crash_report_message(type: :unknown, exception: nil)
11
+ def format_crash_report_message(exception: nil)
25
12
  return if exception.nil?
26
- backtrace = FastlaneCore::CrashReportSanitizer.sanitize_backtrace(type: type, backtrace: exception.backtrace).join("\n")
27
- message = types[type]
28
- sanitized_exception_message = FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.message)
29
- if type == :user_error
30
- message += ': '
13
+ backtrace = exception.respond_to?(:trimmed_backtrace) ? exception.trimmed_backtrace : exception.backtrace
14
+ backtrace = FastlaneCore::CrashReportSanitizer.sanitize_backtrace(backtrace: backtrace).join("\n")
15
+ message = exception.respond_to?(:prefix) ? exception.prefix : '[EXCEPTION]'
16
+ message += ': '
17
+
18
+ if exception.respond_to?(:crash_report_message)
19
+ exception_message = FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.crash_report_message)
31
20
  else
32
- message += ": #{sanitized_exception_message}"
21
+ exception_message = "#{exception.class.name}: #{FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.message)}"
33
22
  end
23
+
24
+ message += exception_message
34
25
  message = message[0..100]
35
- message += "\n" unless type == :user_error
26
+ message += "\n" unless exception.respond_to?(:could_contain_pii?) && exception.could_contain_pii?
36
27
  message + backtrace
37
28
  end
38
29
 
@@ -1,18 +1,8 @@
1
1
  module FastlaneCore
2
2
  class CrashReportSanitizer
3
3
  class << self
4
- def sanitize_backtrace(backtrace: nil, type: :unknown)
5
- if type == :user_error || type == :crash
6
- # If the crash is from `UI` we only want to include the stack trace
7
- # up to the point where the crash was initiated.
8
- # The two stack frames we are dropping are `method_missing` and
9
- # the call to `crash!` or `user_error!`.
10
- stack = backtrace.drop(2)
11
- else
12
- stack = backtrace
13
- end
14
-
15
- stack.map do |frame|
4
+ def sanitize_backtrace(backtrace: nil)
5
+ backtrace.map do |frame|
16
6
  sanitize_string(string: frame)
17
7
  end
18
8
  end
@@ -16,7 +16,7 @@ module FastlaneCore
16
16
  !FastlaneCore::Env.truthy?("FASTLANE_OPT_OUT_CRASH_REPORTING")
17
17
  end
18
18
 
19
- def report_crash(type: :unknown, exception: nil, action: nil)
19
+ def report_crash(exception: nil, action: nil)
20
20
  return unless enabled?
21
21
  return if @did_report_crash
22
22
 
@@ -25,7 +25,7 @@ module FastlaneCore
25
25
  # we want to test it
26
26
  return if Helper.test? && !@explitly_enabled_for_testing
27
27
 
28
- payload = CrashReportGenerator.generate(type: type, exception: exception, action: action)
28
+ payload = CrashReportGenerator.generate(exception: exception, action: action)
29
29
  send_report(payload: payload)
30
30
  save_file(payload: payload)
31
31
  show_message unless did_show_message?
@@ -0,0 +1,17 @@
1
+ module FastlaneCore
2
+ class Interface
3
+ class FastlaneCrash < FastlaneException
4
+ def prefix
5
+ '[FASTLANE_CRASH]'
6
+ end
7
+
8
+ def trimmed_backtrace
9
+ trim_backtrace(method_name: 'crash!')
10
+ end
11
+
12
+ def could_contain_pii?
13
+ caused_by_calling_ui_method?(method_name: 'crash!')
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ module FastlaneCore
2
+ class Interface
3
+ class FastlaneError < FastlaneException
4
+ attr_reader :show_github_issues
5
+ attr_reader :error_info
6
+
7
+ def initialize(show_github_issues: false, error_info: nil)
8
+ @show_github_issues = show_github_issues
9
+ @error_info = error_info
10
+ end
11
+
12
+ def prefix
13
+ '[USER_ERROR]'
14
+ end
15
+
16
+ def trimmed_backtrace
17
+ trim_backtrace(method_name: 'user_error!')
18
+ end
19
+
20
+ def could_contain_pii?
21
+ caused_by_calling_ui_method?(method_name: 'user_error!')
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,41 @@
1
+ module FastlaneCore
2
+ class Interface
3
+ class FastlaneException < StandardError
4
+ def prefix
5
+ '[FASTLANE_EXCEPTION]'
6
+ end
7
+
8
+ def caused_by_calling_ui_method?(method_name: nil)
9
+ return false if backtrace.nil? || backtrace[0].nil? || method_name.nil?
10
+ first_frame = backtrace[0]
11
+ if first_frame.include?(method_name) && first_frame.include?('interface.rb')
12
+ true
13
+ else
14
+ false
15
+ end
16
+ end
17
+
18
+ def trim_backtrace(method_name: nil)
19
+ if caused_by_calling_ui_method?(method_name: method_name)
20
+ backtrace.drop(2)
21
+ else
22
+ backtrace
23
+ end
24
+ end
25
+
26
+ def could_contain_pii?
27
+ caused_by_calling_ui_method?
28
+ end
29
+
30
+ def crash_report_message
31
+ return '' if could_contain_pii?
32
+ exception.message
33
+ end
34
+ end
35
+ class FastlaneBuildFailure < FastlaneException
36
+ end
37
+
38
+ class FastlaneTestFailure < FastlaneException
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,22 @@
1
+ module FastlaneCore
2
+ class Interface
3
+ class FastlaneShellError < FastlaneException
4
+ def prefix
5
+ '[SHELL_ERROR]'
6
+ end
7
+
8
+ def trimmed_backtrace
9
+ backtrace = trim_backtrace(method_name: 'shell_error!')
10
+
11
+ # we also want to trim off the shell invocation itself, which means
12
+ # removing any lines from the backtrace that contain functions
13
+ # in `sh_helper.rb`
14
+ backtrace.drop_while { |frame| frame.include?('sh_helper.rb') }
15
+ end
16
+
17
+ def could_contain_pii?
18
+ caused_by_calling_ui_method?(method_name: 'shell_error!')
19
+ end
20
+ end
21
+ end
22
+ end
@@ -35,20 +35,14 @@ module Commander
35
35
 
36
36
  begin
37
37
  collector.did_launch_action(@program[:name])
38
- # PILOT_MAINTENANCE Temporaroy `begin/rescue` block for pilot mainenance mode
39
- begin
40
- run_active_command
41
- rescue => e
42
- raise e unless @program[:name] == 'pilot'
43
- raise_pilot_maintenance_mode_exception!(e)
44
- end
38
+ run_active_command
45
39
  rescue InvalidCommandError => e
46
40
  # calling `abort` makes it likely that tests stop without failing, so
47
41
  # we'll disable that during tests.
48
42
  if FastlaneCore::Helper.test?
49
43
  raise e
50
44
  else
51
- FastlaneCore::CrashReporter.report_crash(type: :invalid_command, exception: e, action: @program[:name])
45
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
52
46
  abort "#{e}. Use --help for more information"
53
47
  end
54
48
  rescue Interrupt => e
@@ -67,7 +61,7 @@ module Commander
67
61
  if FastlaneCore::Helper.test?
68
62
  raise e
69
63
  else
70
- FastlaneCore::CrashReporter.report_crash(type: :option_parser, exception: e, action: @program[:name])
64
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
71
65
  abort e.to_s
72
66
  end
73
67
  rescue \
@@ -77,7 +71,7 @@ module Commander
77
71
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
78
72
  collector.did_raise_error(@program[:name])
79
73
  show_github_issues(e.message) if e.show_github_issues
80
- FastlaneCore::CrashReporter.report_crash(type: :user_error, exception: e, action: @program[:name])
74
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
81
75
  display_user_error!(e, e.message)
82
76
  rescue Errno::ENOENT => e
83
77
  # We're also printing the new-lines, as otherwise the message is not very visible in-between the error and the stacktrace
@@ -85,7 +79,7 @@ module Commander
85
79
  FastlaneCore::UI.important("Error accessing file, this might be due to fastlane's directory handling")
86
80
  FastlaneCore::UI.important("Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details")
87
81
  puts ""
88
- FastlaneCore::CrashReporter.report_crash(type: :system, exception: e, action: @program[:name])
82
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
89
83
  raise e
90
84
  rescue Faraday::SSLError => e # SSL issues are very common
91
85
  handle_ssl_error!(e)
@@ -93,12 +87,11 @@ module Commander
93
87
  if e.message.include? 'Connection reset by peer - SSL_connect'
94
88
  handle_tls_error!(e)
95
89
  else
96
- FastlaneCore::CrashReporter.report_crash(type: :connection_failure, exception: e, action: @program[:name])
90
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
97
91
  handle_unknown_error!(e)
98
92
  end
99
93
  rescue => e # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
100
- type = e.kind_of?(FastlaneCore::Interface::FastlaneCrash) ? :crash : :exception
101
- FastlaneCore::CrashReporter.report_crash(type: type, exception: e, action: @program[:name])
94
+ FastlaneCore::CrashReporter.report_crash(exception: e, action: @program[:name])
102
95
  collector.did_crash(@program[:name])
103
96
  handle_unknown_error!(e)
104
97
  ensure
@@ -106,31 +99,6 @@ module Commander
106
99
  end
107
100
  end
108
101
 
109
- # PILOT_MAINTENANCE Remove after pilot migration is done
110
- def raise_pilot_maintenance_mode_exception!(e)
111
- FastlaneCore::UI.important("-------------")
112
- FastlaneCore::UI.important("pilot crashed")
113
- FastlaneCore::UI.important("-------------")
114
- FastlaneCore::UI.error("Unfortunately the TestFlight update from 11th April 2017 changed")
115
- FastlaneCore::UI.error("the way Testers, Groups, and Builds are managed on iTunesConnect.")
116
- FastlaneCore::UI.error("We have already fixed a number of features including submitting")
117
- FastlaneCore::UI.error("builds for testing, adding and removing testers from groups, and")
118
- FastlaneCore::UI.error("waiting for builds to process.")
119
- FastlaneCore::UI.error("")
120
- FastlaneCore::UI.error("Please open an issue on https://github.com/fastlane/fastlane/issues")
121
- FastlaneCore::UI.error("if you believe this failure is the result of a bug in _pilot_ and we")
122
- FastlaneCore::UI.error("will be happy to look into this further.")
123
- FastlaneCore::UI.error("")
124
- FastlaneCore::UI.error("Please stay tuned for more updates from _fastlane_ as we fix more issues!")
125
- FastlaneCore::UI.error("")
126
- if FastlaneCore::Globals.verbose?
127
- raise e # on verbose mode, we want to show the original stack trace
128
- else
129
- FastlaneCore::UI.error("Original error message:")
130
- FastlaneCore::UI.user_error!(e.message)
131
- end
132
- end
133
-
134
102
  def handle_tls_error!(e)
135
103
  # Apple has upgraded its iTunes Connect servers to require TLS 1.2, but
136
104
  # system Ruby 2.0 does not support it. We want to suggest that users upgrade
@@ -107,33 +107,6 @@ module FastlaneCore
107
107
  not_implemented(__method__)
108
108
  end
109
109
 
110
- #####################################################
111
- # @!group Errors: Different kinds of exceptions
112
- #####################################################
113
-
114
- # raised from crash!
115
- class FastlaneCrash < StandardError
116
- end
117
-
118
- # raised from user_error!
119
- class FastlaneError < StandardError
120
- attr_reader :show_github_issues
121
- attr_reader :error_info
122
-
123
- def initialize(show_github_issues: false, error_info: nil)
124
- @show_github_issues = show_github_issues
125
- @error_info = error_info
126
- end
127
- end
128
-
129
- # raised from build_failure!
130
- class FastlaneBuildFailure < FastlaneError
131
- end
132
-
133
- # raised from test_failure!
134
- class FastlaneTestFailure < StandardError
135
- end
136
-
137
110
  # Pass an exception to this method to exit the program
138
111
  # using the given exception
139
112
  # Use this method instead of user_error! if this error is
@@ -154,6 +127,18 @@ module FastlaneCore
154
127
  raise FastlaneError.new(options), error_message.to_s
155
128
  end
156
129
 
130
+ # Use this method to exit the program because of a shell command
131
+ # failure -- the command returned a non-zero response. This does
132
+ # not specify the nature of the error. The error might be from a
133
+ # programming error, a user error, or an expected error because
134
+ # the user of the Fastfile doesn't have their environment set up
135
+ # properly. Because of this, when these errors occur, it means
136
+ # that the caller of the shell command did not adequate error
137
+ # handling and the caller error handling should be improved.
138
+ def shell_error!(error_message, options = {})
139
+ raise FastlaneShellError.new(options), error_message.to_s
140
+ end
141
+
157
142
  # Use this method to exit the program because of a build failure
158
143
  # that's caused by the source code of the user. Example for this
159
144
  # is that gym will fail when the code doesn't compile or because
@@ -111,6 +111,13 @@ module Spaceship::TestFlight
111
111
  handle_response(response)
112
112
  end
113
113
 
114
+ def resend_invite_to_external_tester(app_id: nil, tester_id: nil)
115
+ assert_required_params(__method__, binding)
116
+ url = "/testflight/v1/invites/#{app_id}/resend?testerId=#{tester_id}"
117
+ response = request(:post, url)
118
+ handle_response(response)
119
+ end
120
+
114
121
  def create_app_level_tester(app_id: nil, first_name: nil, last_name: nil, email: nil)
115
122
  assert_required_params(__method__, binding)
116
123
  url = "providers/#{team_id}/apps/#{app_id}/testers"
@@ -37,5 +37,9 @@ module Spaceship::TestFlight
37
37
  def remove_from_app!(app_id: nil)
38
38
  client.delete_tester_from_app(app_id: app_id, tester_id: self.tester_id)
39
39
  end
40
+
41
+ def resend_invite(app_id: nil)
42
+ client.resend_invite_to_external_tester(app_id: app_id, tester_id: self.tester_id)
43
+ end
40
44
  end
41
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.31.0.beta.20170517010031
4
+ version: 2.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -1108,6 +1108,10 @@ files:
1108
1108
  - fastlane_core/lib/fastlane_core/swag.rb
1109
1109
  - fastlane_core/lib/fastlane_core/tool_collector.rb
1110
1110
  - fastlane_core/lib/fastlane_core/ui/disable_colors.rb
1111
+ - fastlane_core/lib/fastlane_core/ui/errors/fastlane_crash.rb
1112
+ - fastlane_core/lib/fastlane_core/ui/errors/fastlane_error.rb
1113
+ - fastlane_core/lib/fastlane_core/ui/errors/fastlane_exception.rb
1114
+ - fastlane_core/lib/fastlane_core/ui/errors/fastlane_shell_error.rb
1111
1115
  - fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb
1112
1116
  - fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb
1113
1117
  - fastlane_core/lib/fastlane_core/ui/implementations/shell.rb
@@ -1361,23 +1365,23 @@ metadata:
1361
1365
  post_install_message:
1362
1366
  rdoc_options: []
1363
1367
  require_paths:
1364
- - supply/lib
1365
- - spaceship/lib
1366
- - snapshot/lib
1367
- - match/lib
1368
- - pem/lib
1369
1368
  - cert/lib
1370
- - sigh/lib
1371
- - screengrab/lib
1372
- - produce/lib
1373
- - fastlane/lib
1374
- - frameit/lib
1375
- - scan/lib
1376
1369
  - credentials_manager/lib
1370
+ - deliver/lib
1371
+ - fastlane/lib
1377
1372
  - fastlane_core/lib
1373
+ - frameit/lib
1378
1374
  - gym/lib
1375
+ - match/lib
1376
+ - pem/lib
1379
1377
  - pilot/lib
1380
- - deliver/lib
1378
+ - produce/lib
1379
+ - scan/lib
1380
+ - screengrab/lib
1381
+ - sigh/lib
1382
+ - snapshot/lib
1383
+ - spaceship/lib
1384
+ - supply/lib
1381
1385
  required_ruby_version: !ruby/object:Gem::Requirement
1382
1386
  requirements:
1383
1387
  - - ">="
@@ -1385,14 +1389,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
1385
1389
  version: 2.0.0
1386
1390
  required_rubygems_version: !ruby/object:Gem::Requirement
1387
1391
  requirements:
1388
- - - ">"
1392
+ - - ">="
1389
1393
  - !ruby/object:Gem::Version
1390
- version: 1.3.1
1394
+ version: '0'
1391
1395
  requirements: []
1392
1396
  rubyforge_project:
1393
- rubygems_version: 2.4.5.2
1397
+ rubygems_version: 2.5.2
1394
1398
  signing_key:
1395
1399
  specification_version: 4
1396
1400
  summary: The easiest way to automate beta deployments and releases for your iOS and
1397
1401
  Android apps
1398
1402
  test_files: []
1403
+ has_rdoc: