From da6971518e5c8022b514c95070a2613fde48b095 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 5 Dec 2024 15:12:40 -0700 Subject: [PATCH] remove unnecessary log messages --- nuget/lib/dependabot/nuget/file_fetcher.rb | 1 - nuget/lib/dependabot/nuget/file_parser.rb | 1 - .../native_discovery_json_reader.rb | 11 ----------- nuget/script/run | 14 -------------- 4 files changed, 27 deletions(-) diff --git a/nuget/lib/dependabot/nuget/file_fetcher.rb b/nuget/lib/dependabot/nuget/file_fetcher.rb index 5f6a84b034..5dacfd983e 100644 --- a/nuget/lib/dependabot/nuget/file_fetcher.rb +++ b/nuget/lib/dependabot/nuget/file_fetcher.rb @@ -32,7 +32,6 @@ def fetch_files credentials: credentials ) - NativeDiscoveryJsonReader.debug_report_discovery_files(error_if_missing: false) discovery_json_reader.dependency_file_paths.map do |p| relative_path = Pathname.new(p).relative_path_from(directory).to_path fetch_file_from_host(relative_path) diff --git a/nuget/lib/dependabot/nuget/file_parser.rb b/nuget/lib/dependabot/nuget/file_parser.rb index 334f18622a..8022071b37 100644 --- a/nuget/lib/dependabot/nuget/file_parser.rb +++ b/nuget/lib/dependabot/nuget/file_parser.rb @@ -27,7 +27,6 @@ def parse sig { returns(T::Array[Dependabot::Dependency]) } def dependencies @dependencies ||= T.let(begin - NativeDiscoveryJsonReader.debug_report_discovery_files(error_if_missing: true) directory = source&.directory || "/" discovery_json_reader = NativeDiscoveryJsonReader.run_discovery_in_directory( repo_contents_path: T.must(repo_contents_path), diff --git a/nuget/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb b/nuget/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb index 2dd7ebff0b..7bcaadb865 100644 --- a/nuget/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb +++ b/nuget/lib/dependabot/nuget/native_discovery/native_discovery_json_reader.rb @@ -41,17 +41,6 @@ def self.testonly_clear_discovery_files FileUtils.rm_rf(discovery_directory) end - sig { params(error_if_missing: T::Boolean).void } - def self.debug_report_discovery_files(error_if_missing:) - if File.exist?(discovery_map_file_path) - Dependabot.logger.info("Discovery map file (#{discovery_map_file_path}) contents: " \ - "#{File.read(discovery_map_file_path)}") - Dependabot.logger.info("Discovery files: #{Dir.glob(File.join(discovery_directory, '*'))}") - elsif error_if_missing - Dependabot.logger.error("discovery map file missing") - end - end - # Runs NuGet dependency discovery in the given directory and returns a new instance of NativeDiscoveryJsonReader. # The location of the resultant JSON file is saved. sig do diff --git a/nuget/script/run b/nuget/script/run index ea09331823..eaea942642 100644 --- a/nuget/script/run +++ b/nuget/script/run @@ -7,19 +7,5 @@ echo "NuGet native updater experiment value: $nuget_experiment_value" if echo "$nuget_experiment_value" | grep -q 'true'; then pwsh "$DEPENDABOT_HOME/dependabot-updater/bin/main.ps1" $* else - operation=$1 - dot_dependabot_directory="$DEPENDABOT_HOME/.dependabot" - discovery_map_path="$dot_dependabot_directory/discovery_map.json" - - # ensure discovery file exists before running update - if [[ "$operation" == "update_files" && ! -f $discovery_map_path ]]; then - echo "ERROR running update_files without discovery_map.json" - fi - "$DEPENDABOT_HOME/dependabot-updater/bin/run-original" $* - - # ensure discovery file exists after running fetch - if [[ "$operation" == "fetch_files" && ! -f $discovery_map_path ]]; then - echo "ERROR ran fetch_files without producing discovery_map.json" - fi fi