fastlane 2.85.0.beta.20180305050037 → 2.85.0.beta.20180306050019

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: c836c02d001d7e4ffdfb3d679f97efafb6ac7d96
4
- data.tar.gz: '0930b2e5387981c19ebaa540c257c891eb30733c'
3
+ metadata.gz: c6410f4a733ca2e3c93d41b316e80175f6964eeb
4
+ data.tar.gz: 160dcdc066d6f388d8f09bcddf3c12e786b2753c
5
5
  SHA512:
6
- metadata.gz: 62ece6d30f477f070347728b8fc822aa9a8a0c4e757081ef2baccaae45ec00ebf147ac083306ec02582ef662afa0c60a0902a52d56aaa00e82383d4a1d13d9bb
7
- data.tar.gz: f9f6abe8f4366865db84a6f35f76933e162b4002f07b5cf8efe56794d5ccb536f86d5fc5ecab48d38a90040336b8c666ebca517f6900b3b8d22f4486b4730fa0
6
+ metadata.gz: 19cc5f40c9d01b6df813b634873d87b5886232e08cf46536fd3798e7b380017d7e8bb86dee3f2eed16737aae28f66f21ab85784a3f4d573b52edc25c28ea2273
7
+ data.tar.gz: 3e2dd536400a319219000dbc20785a9cb175c5d09b016d67a8b761c8898b1d69064b30cf336bb3ff5eef88e0be2f4ace9dc44f01929d997bfaf2e2e386fe6f48
@@ -1,7 +1,6 @@
1
1
  require 'precheck/options'
2
2
  require 'precheck/runner'
3
3
  require 'fastlane_core/configuration/configuration'
4
- require 'fastlane_core/crash_reporter/crash_reporter'
5
4
  require 'fastlane_core/ipa_upload_package_builder'
6
5
  require 'fastlane_core/pkg_upload_package_builder'
7
6
  require 'fastlane_core/itunes_transporter'
@@ -78,9 +77,6 @@ module Deliver
78
77
  UI.error("fastlane precheck just tried to inspect your app's metadata for App Store guideline violations and ran into a problem. We're not sure what the problem was, but precheck failed to finished. You can run it in verbose mode if you want to see the whole error. We'll have a fix out soon 🚀")
79
78
  UI.verbose(ex.inspect)
80
79
  UI.verbose(ex.backtrace.join("\n"))
81
-
82
- # always report this back, since this is a new tool, we don't want to crash, but we still want to see this
83
- FastlaneCore::CrashReporter.report_crash(exception: ex)
84
80
  end
85
81
 
86
82
  return precheck_success
@@ -46,10 +46,10 @@ module Deliver
46
46
  }
47
47
 
48
48
  # Localized app details values, that are editable in live state
49
- LOCALISED_LIVE_VALUES = [:description, :release_notes, :support_url, :marketing_url, :promotional_text]
49
+ LOCALISED_LIVE_VALUES = [:description, :release_notes, :support_url, :marketing_url, :promotional_text, :privacy_url]
50
50
 
51
51
  # Non localized app details values, that are editable in live state
52
- NON_LOCALISED_LIVE_VALUES = [:privacy_url]
52
+ NON_LOCALISED_LIVE_VALUES = [:copyright]
53
53
 
54
54
  # Directory name it contains trade representative contact information
55
55
  TRADE_REPRESENTATIVE_CONTACT_INFORMATION_DIR = "trade_representative_contact_information"
@@ -131,6 +131,7 @@ The bundle identifier (e.g. "com.krausefx.app")
131
131
  Your Apple ID email address
132
132
 
133
133
  ##### ipa
134
+
134
135
  A path to a signed ipa file, which will be uploaded. If you don't provide this value, only app metadata will be uploaded. If you want to submit the app for review make sure to either use `fastlane deliver --submit_for_review` or add `submit_for_review true` to your `Deliverfile`
135
136
 
136
137
  ```ruby-skip-tests
@@ -411,9 +412,47 @@ _deliver_ uses the following techniques under the hood:
411
412
 
412
413
  ## Available language codes
413
414
  ```no-highlight
414
- no, en-US, en-CA, fi, ru, zh-Hans, nl-NL, zh-Hant, en-AU, id, de-DE, sv, ko, ms, pt-BR, el, es-ES, it, fr-CA, es-MX, pt-PT, vi, th, ja, fr-FR, da, tr, en-GB
415
+ <%= FastlaneCore::Languages::ALL_LANGUAGES.join(', ') %>
415
416
  ```
416
417
 
418
+ ## Available Metadata Folder Options
419
+
420
+ _deliver_ allows for metadata to be set through `.txt` files in the metadata folder. This metadata folder location is defaulted to `./fastlane/metadata` but can be overridden through the `metadata_path` parameter. Below are all allowed metadata options.
421
+
422
+ <%- require 'deliver' -%>
423
+
424
+ ### Non-Localized Metadata
425
+
426
+ Key | Editable While Live | Directory | Filename
427
+ ----|--------|--------|--------
428
+ <%- (Deliver::UploadMetadata::NON_LOCALISED_VERSION_VALUES + Deliver::UploadMetadata::NON_LOCALISED_APP_VALUES).each do |value| -%>
429
+ `<%= value %>` | <%= Deliver::UploadMetadata::NON_LOCALISED_LIVE_VALUES.include?(value) ? 'Yes' : 'No' %> | `<metadata_path>` | `<%= value %>.txt`
430
+ <%- end %>
431
+
432
+ ### Localized Metadata
433
+
434
+ Key | Editable While Live | Directory | Filename
435
+ ----|--------|--------|--------
436
+ <%- (Deliver::UploadMetadata::LOCALISED_APP_VALUES + Deliver::UploadMetadata::LOCALISED_VERSION_VALUES).each do |value| -%>
437
+ `<%= value %>` | <%= Deliver::UploadMetadata::LOCALISED_LIVE_VALUES.include?(value) ? 'Yes' : 'No' %> | `<metadata_path>/<lang>/` | `<%= value %>.txt`
438
+ <%- end %>
439
+
440
+ ### Trade Representative Contact Information Metadata
441
+
442
+ Key | Editable While Live | Directory | Filename
443
+ ----|--------|--------|--------
444
+ <%- Deliver::UploadMetadata::TRADE_REPRESENTATIVE_CONTACT_INFORMATION_VALUES.each do |key, value| -%>
445
+ `<%= value %>` | Yes | `<metadata_path>/<%= Deliver::UploadMetadata::TRADE_REPRESENTATIVE_CONTACT_INFORMATION_DIR %>` | `<%= value %>.txt`
446
+ <%- end %>
447
+
448
+ ### Review Information Metadata
449
+
450
+ Key | Editable While Live | Directory | Filename
451
+ ----|--------|--------|--------
452
+ <%- Deliver::UploadMetadata::REVIEW_INFORMATION_VALUES.each do |key, value| -%>
453
+ `<%= value %>` | Yes | `<metadata_path>/<%= Deliver::UploadMetadata::REVIEW_INFORMATION_DIR %>` | `<%= value %>.txt`
454
+ <%- end %>
455
+
417
456
  ## Reference
418
457
 
419
458
  <details>
@@ -2,8 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class OptOutCrashReportingAction < Action
4
4
  def self.run(params)
5
- ENV['FASTLANE_OPT_OUT_CRASH_REPORTING'] = "YES"
6
- UI.message("Disabled crash reporting")
5
+ UI.message("fastlane doesn't have crash reporting any more, feel free to remove `opt_out_crash_reporting` from your Fastfile")
7
6
  end
8
7
 
9
8
  def self.description
@@ -12,10 +11,7 @@ module Fastlane
12
11
 
13
12
  def self.details
14
13
  [
15
- "By default, fastlane will send a report when it crashes",
16
- "The stack trace is sanitized so no personal information is sent.",
17
- "Learn more at https://docs.fastlane.tools/actions/opt_out_crash_reporting/",
18
- "Add `opt_out_crash_reporting` at the top of your Fastfile to disable crash reporting"
14
+ "fastlane doesn't have crash reporting any more, feel free to remove `opt_out_crash_reporting` from your Fastfile"
19
15
  ].join(' ')
20
16
  end
21
17
 
@@ -28,13 +24,11 @@ module Fastlane
28
24
  end
29
25
 
30
26
  def self.example_code
31
- [
32
- 'opt_out_crash_reporting # add this to the top of your Fastfile'
33
- ]
27
+ []
34
28
  end
35
29
 
36
30
  def self.category
37
- :misc
31
+ :deprecated
38
32
  end
39
33
  end
40
34
  end
@@ -54,6 +54,19 @@ module Fastlane
54
54
  UI.verbose("Using custom md file for action #{action.action_name}")
55
55
  return File.read(custom_file_location)
56
56
  end
57
+ return load_custom_action_md_erb(action)
58
+ end
59
+
60
+ def load_custom_action_md_erb(action)
61
+ # check if there is a custom detail view as markdown ERB available in the fastlane code base
62
+ custom_file_location = File.join(Fastlane::ROOT, custom_action_docs_path, "#{action.action_name}.md.erb")
63
+ if File.exist?(custom_file_location)
64
+ UI.verbose("Using custom md.erb file for action #{action.action_name}")
65
+
66
+ result = ERB.new(File.read(custom_file_location), 0, '-').result(binding) # https://web.archive.org/web/20160430190141/www.rrn.dk/rubys-erb-templating-system
67
+
68
+ return result
69
+ end
57
70
  return nil
58
71
  end
59
72
 
@@ -71,6 +84,8 @@ module Fastlane
71
84
  all_actions_ref_yml = []
72
85
  FileUtils.mkdir_p(File.join(docs_dir, "actions"))
73
86
  ActionsList.all_actions do |action|
87
+ @action = action # to provide a reference in the .html.erb template
88
+
74
89
  # Make sure to always assign `@custom_content`, as we're in a loop and `@` is needed for the `erb`
75
90
  @custom_content = load_custom_action_md(action)
76
91
 
@@ -83,7 +98,6 @@ module Fastlane
83
98
  end
84
99
 
85
100
  template = File.join(Fastlane::ROOT, "lib/assets/ActionDetails.md.erb")
86
- @action = action # to provide a reference in the .html.erb template
87
101
  result = ERB.new(File.read(template), 0, '-').result(binding) # https://web.archive.org/web/20160430190141/www.rrn.dk/rubys-erb-templating-system
88
102
 
89
103
  file_name = File.join("actions", "#{action.action_name}.md")
@@ -266,14 +266,11 @@ module Fastlane
266
266
  rescue FastlaneCore::Interface::FastlaneCommonException => e # these are exceptions that we dont count as crashes
267
267
  raise e
268
268
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
269
- FastlaneCore::CrashReporter.report_crash(exception: e)
270
269
  action_completed(method_sym.to_s, status: FastlaneCore::ActionCompletionStatus::USER_ERROR, exception: e)
271
270
  raise e
272
271
  rescue Exception => e # rubocop:disable Lint/RescueException
273
272
  # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
274
273
  # Catches all exceptions, since some plugins might use system exits to get out
275
- FastlaneCore::CrashReporter.report_crash(exception: e)
276
-
277
274
  action_completed(method_sym.to_s, status: FastlaneCore::ActionCompletionStatus::FAILED, exception: e)
278
275
  raise e
279
276
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.85.0.beta.20180305050037'.freeze
2
+ VERSION = '2.85.0.beta.20180306050019'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -15,7 +15,6 @@ This gem contains all shared classes and code:
15
15
  - Checking for updates for a specific gem and showing an update message
16
16
  - All output of all tools with different logging levels
17
17
  - Finding of the current Xcode and iTunes Transporter path
18
- - Crash Reporting
19
18
  - More helper methods and classes
20
19
 
21
20
  You can hide the inline changelog by setting the `FASTLANE_HIDE_CHANGELOG` environment variable
@@ -28,9 +28,6 @@ require_relative 'fastlane_core/fastlane_folder'
28
28
  require_relative 'fastlane_core/keychain_importer'
29
29
  require_relative 'fastlane_core/swag'
30
30
  require_relative 'fastlane_core/build_watcher'
31
- require_relative 'fastlane_core/crash_reporter/crash_reporter'
32
- require_relative 'fastlane_core/crash_reporter/crash_report_generator'
33
- require_relative 'fastlane_core/crash_reporter/crash_report_sanitizer'
34
31
  require_relative 'fastlane_core/ui/errors'
35
32
  require_relative 'fastlane_core/test_parser'
36
33
  require_relative 'fastlane_core/analytics/action_completion_context'
@@ -6,14 +6,6 @@ module FastlaneCore
6
6
  def prefix
7
7
  '[FASTLANE_CRASH]'
8
8
  end
9
-
10
- def trimmed_backtrace
11
- trim_backtrace(method_name: 'crash!')
12
- end
13
-
14
- def could_contain_pii?
15
- caused_by_calling_ui_method?(method_name: 'crash!')
16
- end
17
9
  end
18
10
  end
19
11
  end
@@ -14,36 +14,13 @@ module FastlaneCore
14
14
  def prefix
15
15
  '[USER_ERROR]'
16
16
  end
17
-
18
- def trimmed_backtrace
19
- trim_backtrace(method_name: 'user_error!')
20
- end
21
-
22
- def could_contain_pii?
23
- caused_by_calling_ui_method?(method_name: 'user_error!')
24
- end
25
17
  end
26
18
  end
27
19
  end
28
20
 
29
21
  class Exception
30
- def fastlane_crash_came_from_custom_action?
31
- custom_frame = exception && exception.backtrace && exception.backtrace.find { |frame| frame.start_with?('actions/') }
32
- !custom_frame.nil?
33
- end
34
-
35
- def fastlane_crash_came_from_plugin?
36
- plugin_frame = exception && exception.backtrace && exception.backtrace.find { |frame| frame.include?('fastlane-plugin-') }
37
- !plugin_frame.nil?
38
- end
39
-
40
22
  def fastlane_should_report_metrics?
41
23
  # https://github.com/fastlane/fastlane/issues/11913
42
24
  return false
43
- # if fastlane_crash_came_from_plugin? || fastlane_crash_came_from_custom_action?
44
- # false
45
- # else
46
- # true
47
- # end
48
25
  end
49
26
  end
@@ -14,34 +14,6 @@ module FastlaneCore
14
14
  false
15
15
  end
16
16
  end
17
-
18
- def includes_method_missing?
19
- return false if backtrace.nil? || backtrace[1].nil?
20
- second_frame = backtrace[1]
21
- second_frame.include?('method_missing') && second_frame.include?('ui.rb')
22
- end
23
-
24
- def trim_backtrace(method_name: nil)
25
- if caused_by_calling_ui_method?(method_name: method_name)
26
- if includes_method_missing?
27
- drop_count = 2
28
- else
29
- drop_count = 1
30
- end
31
- backtrace.drop(drop_count)
32
- else
33
- backtrace
34
- end
35
- end
36
-
37
- def could_contain_pii?
38
- caused_by_calling_ui_method?
39
- end
40
-
41
- def crash_report_message
42
- return '' if could_contain_pii?
43
- exception.message
44
- end
45
17
  end
46
18
  end
47
19
  end
@@ -6,19 +6,6 @@ module FastlaneCore
6
6
  def prefix
7
7
  '[SHELL_ERROR]'
8
8
  end
9
-
10
- def trimmed_backtrace
11
- backtrace = trim_backtrace(method_name: 'shell_error!')
12
-
13
- # we also want to trim off the shell invocation itself, which means
14
- # removing any lines from the backtrace that contain functions
15
- # in `sh_helper.rb`
16
- backtrace.drop_while { |frame| frame.include?('sh_helper.rb') }
17
- end
18
-
19
- def could_contain_pii?
20
- caused_by_calling_ui_method?(method_name: 'shell_error!')
21
- end
22
9
  end
23
10
  end
24
11
  end
@@ -24,7 +24,6 @@ require_relative '../env'
24
24
  require_relative '../globals'
25
25
  require_relative '../analytics/action_completion_context'
26
26
  require_relative '../analytics/action_launch_context'
27
- require_relative '../crash_reporter/crash_reporter'
28
27
  require_relative 'errors'
29
28
 
30
29
  module Commander
@@ -83,7 +82,6 @@ module Commander
83
82
  if FastlaneCore::Helper.test?
84
83
  raise e
85
84
  else
86
- FastlaneCore::CrashReporter.report_crash(exception: e)
87
85
  abort("#{e}. Use --help for more information")
88
86
  end
89
87
  rescue Interrupt => e
@@ -103,7 +101,6 @@ module Commander
103
101
  if FastlaneCore::Helper.test?
104
102
  raise e
105
103
  else
106
- FastlaneCore::CrashReporter.report_crash(exception: e)
107
104
  if self.active_command.name == "help" && @default_command == :help # need to access directly via @
108
105
  # This is a special case, for example for pilot
109
106
  # when the user runs `fastlane pilot -u user@google.com`
@@ -151,7 +148,6 @@ module Commander
151
148
  FastlaneCore::UI.important("Error accessing file, this might be due to fastlane's directory handling")
152
149
  FastlaneCore::UI.important("Check out https://docs.fastlane.tools/advanced/#directory-behavior for more details")
153
150
  puts("")
154
- FastlaneCore::CrashReporter.report_crash(exception: e)
155
151
  raise e
156
152
  end
157
153
 
@@ -159,14 +155,11 @@ module Commander
159
155
  if e.message.include?('Connection reset by peer - SSL_connect')
160
156
  handle_tls_error!(e)
161
157
  else
162
- FastlaneCore::CrashReporter.report_crash(exception: e)
163
158
  handle_unknown_error!(e)
164
159
  end
165
160
  end
166
161
 
167
162
  def rescue_unknown_error(e)
168
- FastlaneCore::CrashReporter.report_crash(exception: e)
169
-
170
163
  action_completed(@program[:name], status: FastlaneCore::ActionCompletionStatus::FAILED, exception: e)
171
164
 
172
165
  handle_unknown_error!(e)
@@ -176,7 +169,6 @@ module Commander
176
169
  action_completed(@program[:name], status: FastlaneCore::ActionCompletionStatus::USER_ERROR, exception: e)
177
170
 
178
171
  show_github_issues(e.message) if e.show_github_issues
179
- FastlaneCore::CrashReporter.report_crash(exception: e)
180
172
  display_user_error!(e, e.message)
181
173
  end
182
174
 
@@ -62,8 +62,8 @@ module PEM
62
62
  filename_base = PEM.config[:pem_name] || "#{certificate_type}_#{PEM.config[:app_identifier]}"
63
63
  filename_base = File.basename(filename_base, ".pem") # strip off the .pem if it was provided.
64
64
 
65
- output_path = PEM.config[:output_path]
66
- FileUtils.mkdir_p(File.expand_path(output_path))
65
+ output_path = File.expand_path(PEM.config[:output_path])
66
+ FileUtils.mkdir_p(output_path)
67
67
 
68
68
  if PEM.config[:save_private_key]
69
69
  private_key_path = File.join(output_path, "#{filename_base}.pkey")
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.85.0.beta.20180305050037
4
+ version: 2.85.0.beta.20180306050019
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manu Wallner
@@ -27,7 +27,7 @@ authors:
27
27
  autorequire:
28
28
  bindir: bin
29
29
  cert_chain: []
30
- date: 2018-03-05 00:00:00.000000000 Z
30
+ date: 2018-03-06 00:00:00.000000000 Z
31
31
  dependencies:
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: slack-notifier
@@ -966,7 +966,7 @@ files:
966
966
  - fastlane/lib/fastlane/actions/docs/get_push_certificate.md
967
967
  - fastlane/lib/fastlane/actions/docs/run_tests.md
968
968
  - fastlane/lib/fastlane/actions/docs/sync_code_signing.md
969
- - fastlane/lib/fastlane/actions/docs/upload_to_app_store.md
969
+ - fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb
970
970
  - fastlane/lib/fastlane/actions/docs/upload_to_play_store.md
971
971
  - fastlane/lib/fastlane/actions/docs/upload_to_testflight.md
972
972
  - fastlane/lib/fastlane/actions/dotgpg_environment.rb
@@ -1266,9 +1266,6 @@ files:
1266
1266
  - fastlane_core/lib/fastlane_core/configuration/configuration_file.rb
1267
1267
  - fastlane_core/lib/fastlane_core/core_ext/cfpropertylist.rb
1268
1268
  - fastlane_core/lib/fastlane_core/core_ext/string.rb
1269
- - fastlane_core/lib/fastlane_core/crash_reporter/crash_report_generator.rb
1270
- - fastlane_core/lib/fastlane_core/crash_reporter/crash_report_sanitizer.rb
1271
- - fastlane_core/lib/fastlane_core/crash_reporter/crash_reporter.rb
1272
1269
  - fastlane_core/lib/fastlane_core/device_manager.rb
1273
1270
  - fastlane_core/lib/fastlane_core/env.rb
1274
1271
  - fastlane_core/lib/fastlane_core/fastlane_folder.rb
@@ -1616,24 +1613,24 @@ metadata:
1616
1613
  post_install_message:
1617
1614
  rdoc_options: []
1618
1615
  require_paths:
1619
- - spaceship/lib
1616
+ - credentials_manager/lib
1620
1617
  - sigh/lib
1621
- - snapshot/lib
1622
- - fastlane_core/lib
1623
1618
  - frameit/lib
1619
+ - deliver/lib
1620
+ - scan/lib
1621
+ - fastlane_core/lib
1622
+ - cert/lib
1623
+ - precheck/lib
1624
1624
  - screengrab/lib
1625
+ - match/lib
1626
+ - produce/lib
1625
1627
  - fastlane/lib
1626
1628
  - pem/lib
1627
- - pilot/lib
1628
- - supply/lib
1629
- - precheck/lib
1630
- - match/lib
1631
1629
  - gym/lib
1632
- - credentials_manager/lib
1633
- - produce/lib
1634
- - cert/lib
1635
- - scan/lib
1636
- - deliver/lib
1630
+ - snapshot/lib
1631
+ - supply/lib
1632
+ - pilot/lib
1633
+ - spaceship/lib
1637
1634
  required_ruby_version: !ruby/object:Gem::Requirement
1638
1635
  requirements:
1639
1636
  - - ">="
@@ -1,52 +0,0 @@
1
- require_relative 'crash_report_sanitizer'
2
-
3
- module FastlaneCore
4
- class CrashReportGenerator
5
- class << self
6
- def generate(exception: nil)
7
- message = format_crash_report_message(exception: exception)
8
- crash_report_payload(message: message)
9
- end
10
-
11
- private
12
-
13
- def format_crash_report_message(exception: nil)
14
- return if exception.nil?
15
- backtrace = exception.respond_to?(:trimmed_backtrace) ? exception.trimmed_backtrace : exception.backtrace
16
- backtrace = FastlaneCore::CrashReportSanitizer.sanitize_backtrace(backtrace: backtrace).join("\n")
17
-
18
- if exception.fastlane_crash_came_from_plugin?
19
- message = '[PLUGIN_CRASH]'
20
- elsif exception.respond_to?(:prefix)
21
- message = exception.prefix
22
- else
23
- message = '[EXCEPTION]'
24
- end
25
-
26
- message += ': '
27
-
28
- if exception.respond_to?(:crash_report_message)
29
- exception_message = FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.crash_report_message)
30
- else
31
- exception_message = "#{exception.class.name}: #{FastlaneCore::CrashReportSanitizer.sanitize_string(string: exception.message)}"
32
- end
33
-
34
- message += exception_message
35
- message = message[0..100]
36
- message += "\n" unless exception.respond_to?(:could_contain_pii?) && exception.could_contain_pii?
37
- message + backtrace
38
- end
39
-
40
- def crash_report_payload(message: '')
41
- {
42
- 'eventTime' => Time.now.utc.to_datetime.rfc3339,
43
- 'serviceContext' => {
44
- 'service' => 'fastlane',
45
- 'version' => Fastlane::VERSION
46
- },
47
- 'message' => message
48
- }.to_json
49
- end
50
- end
51
- end
52
- end
@@ -1,34 +0,0 @@
1
- module FastlaneCore
2
- class CrashReportSanitizer
3
- class << self
4
- def sanitize_backtrace(backtrace: nil)
5
- backtrace.map do |frame|
6
- sanitize_string(string: frame)
7
- end
8
- end
9
-
10
- def sanitize_string(string: nil)
11
- string = sanitize_fastlane_gem_path(string: string)
12
- string = sanitize_gem_home(string: string)
13
- sanitize_home_dir(string: string)
14
- end
15
-
16
- private
17
-
18
- def sanitize_home_dir(string: nil)
19
- string.gsub(Dir.home, '~')
20
- end
21
-
22
- def sanitize_fastlane_gem_path(string: nil)
23
- fastlane_path = Gem.loaded_specs['fastlane'].full_gem_path
24
- return string unless fastlane_path
25
- string.gsub(fastlane_path, '[fastlane_path]')
26
- end
27
-
28
- def sanitize_gem_home(string: nil)
29
- return string unless Gem.dir
30
- string.gsub(Gem.dir, '[gem_home]')
31
- end
32
- end
33
- end
34
- end
@@ -1,104 +0,0 @@
1
- require 'json'
2
-
3
- require_relative '../env'
4
- require_relative '../helper'
5
- require_relative '../globals'
6
- require_relative '../ui/ui'
7
- require_relative 'crash_report_generator'
8
-
9
- module FastlaneCore
10
- class CrashReporter
11
- class << self
12
- @did_report_crash = false
13
-
14
- @explicitly_enabled_for_testing = false
15
-
16
- def crash_report_path
17
- File.join(FastlaneCore.fastlane_user_dir, 'latest_crash.json')
18
- end
19
-
20
- def enabled?
21
- !FastlaneCore::Env.truthy?("FASTLANE_OPT_OUT_CRASH_REPORTING")
22
- end
23
-
24
- def report_crash(exception: nil)
25
- return unless enabled?
26
- return if @did_report_crash
27
- return if exception.fastlane_crash_came_from_custom_action?
28
-
29
- # Do not run the crash reporter while tests are happening (it might try to send
30
- # a crash report), unless we have explicitly turned on the crash reporter because
31
- # we want to test it
32
- return if Helper.test? && !@explicitly_enabled_for_testing
33
- begin
34
- payload = CrashReportGenerator.generate(exception: exception)
35
- send_report(payload: payload)
36
- save_file(payload: payload)
37
- show_message unless did_show_message?
38
- @did_report_crash = true
39
- rescue
40
- if FastlaneCore::Globals.verbose?
41
- UI.error("Unable to send the crash report.")
42
- UI.error("Please open an issue on GitHub if you need help!")
43
- end
44
- end
45
- end
46
-
47
- def reset_crash_reporter_for_testing
48
- @did_report_crash = false
49
- end
50
-
51
- def enable_for_testing
52
- @explicitly_enabled_for_testing = true
53
- end
54
-
55
- def disable_for_testing
56
- @explicitly_enabled_for_testing = false
57
- end
58
-
59
- private
60
-
61
- def show_message
62
- UI.message("Sending crash report...")
63
- UI.message("The stack trace is sanitized so no personal information is sent.")
64
- UI.message("To see what we are sending, look here: #{crash_report_path}")
65
- UI.message("Learn more at https://docs.fastlane.tools/actions/opt_out_crash_reporting/")
66
- UI.message("You can disable crash reporting by adding `opt_out_crash_reporting` at the top of your Fastfile")
67
- end
68
-
69
- def did_show_message?
70
- file_name = ".did_show_opt_out_crash_info"
71
-
72
- path = File.join(FastlaneCore.fastlane_user_dir, file_name)
73
- did_show = File.exist?(path)
74
-
75
- return did_show if did_show
76
-
77
- begin
78
- File.write(path, '1')
79
- rescue
80
- if FastlaneCore::Globals.verbose?
81
- UI.error("Cannot write out file indicating that crash report announcement has been displayed.")
82
- UI.error("The following message will be displayed on the next crash as well:")
83
- end
84
- end
85
- false
86
- end
87
-
88
- def save_file(payload: "{}")
89
- File.write(crash_report_path, payload)
90
- rescue
91
- UI.message("fastlane failed to write the crash report to #{crash_report_path}.")
92
- end
93
-
94
- def send_report(payload: "{}")
95
- require 'faraday'
96
- connection = Faraday.new(url: "https://clouderrorreporting.googleapis.com/v1beta1/projects/fastlane-166414/events:report?key=AIzaSyAMACPfuI-wi4grJWEZjcPvhfV2Rhmddwo")
97
- connection.post do |request|
98
- request.headers['Content-Type'] = 'application/json'
99
- request.body = payload
100
- end
101
- end
102
- end
103
- end
104
- end