Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rip out more dead analytics code #13741

Merged
merged 4 commits into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions fastlane/lib/fastlane/action_collector.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
require 'fastlane_core/tool_collector'

module Fastlane
class ActionCollector < FastlaneCore::ToolCollector
# Is this an official fastlane action, that is bundled with fastlane?
def is_official?(name)
return true if name == :lane_switch
Actions.get_all_official_actions.include?(name)
end

def name_to_track(name)
return name if is_official?(name)

Fastlane.plugin_manager.plugin_references.each do |plugin_name, value|
return "#{plugin_name}/#{name}" if value[:actions].include?(name)
end

return nil
end

class ActionCollector
def show_message
UI.message("Sending Crash/Success information. Learn more at https://docs.fastlane.tools/#metrics")
UI.message("No personal/sensitive data is sent. Only sharing the following:")
Expand All @@ -36,9 +18,6 @@ def determine_version(name)
# :xcversion
# "fastlane-plugin-my_plugin/xcversion"
def self.determine_version(name)
result = super(name)
return result if result

if name.to_s.include?(PluginManager.plugin_prefix)
# That's an action from a plugin, we need to fetch its version number
begin
Expand Down
4 changes: 1 addition & 3 deletions fastlane/lib/fastlane/fast_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,7 @@ def fastlane_require(gem_name)
end

def generated_fastfile_id(id)
# This value helps us track success/failure metrics for Fastfiles we
# generate as part of an automated process.
ENV['GENERATED_FASTFILE_ID'] = id
UI.important("The `generated_fastfile_id` action was deprecated, you can remove the line from your `Fastfile`")
end

def import(path = nil)
Expand Down
27 changes: 0 additions & 27 deletions fastlane/spec/action_collector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@
before(:all) { ENV.delete("FASTLANE_OPT_OUT_USAGE") }

let(:collector) { Fastlane::ActionCollector.new }
let(:plugin_references) do
{
"fastlane-plugin-my_plugin" => {
version_number: "0.1.0",
actions: [:xcversion, :xcyolo_something]
}
}
end

describe "#name_to_track" do
it "returns the original name when it's a built-in action" do
expect(collector.name_to_track(:gym)).to eq(:gym)
end

it "returns nil when it's an external action" do
expect(collector).to receive(:is_official?).and_return(false)
expect(collector.name_to_track(:fastlane)).to eq(nil)
end

it "returns the plugin's name if the action is part of a plugin" do
allow(collector).to receive(:is_official?).and_return(false)
allow(Fastlane.plugin_manager).to receive(:plugin_references).and_return(plugin_references)

expect(collector.name_to_track(:xcyolo_something)).to eq("fastlane-plugin-my_plugin/xcyolo_something")
expect(collector.name_to_track(:xc_not_availalbe)).to eq(nil)
end
end

describe "#determine_version" do
it "accesses the version number of the other tools" do
Expand Down
1 change: 0 additions & 1 deletion fastlane_core/lib/fastlane_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
require_relative 'fastlane_core/project'
require_relative 'fastlane_core/device_manager'
require_relative 'fastlane_core/ui/ui'
require_relative 'fastlane_core/tool_collector'
require_relative 'fastlane_core/fastlane_folder'
require_relative 'fastlane_core/keychain_importer'
require_relative 'fastlane_core/swag'
Expand Down
304 changes: 0 additions & 304 deletions fastlane_core/lib/fastlane_core/tool_collector.rb

This file was deleted.

Loading