From 380bec6079cf7cbeb29ca1d4c36bf3e62db90dd7 Mon Sep 17 00:00:00 2001 From: Grey Baker Date: Sun, 26 May 2019 17:39:45 +0100 Subject: [PATCH] Gradle: Ignore failure to fetch script plugins from submodules --- gradle/lib/dependabot/gradle/file_fetcher.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gradle/lib/dependabot/gradle/file_fetcher.rb b/gradle/lib/dependabot/gradle/file_fetcher.rb index a55e1032e6..b080660137 100644 --- a/gradle/lib/dependabot/gradle/file_fetcher.rb +++ b/gradle/lib/dependabot/gradle/file_fetcher.rb @@ -59,11 +59,20 @@ def dependency_script_plugins dependency_plugin_paths.map do |path| fetch_file_from_host(path) rescue Dependabot::DependencyFileNotFound + next nil if file_exists_in_submodule?(path) + # Experimental feature - raise an error for Dependabot team to review raise "Script plugin not found: #{path}" end.compact end + def file_exists_in_submodule?(path) + fetch_file_from_host(path, fetch_submodules: true) + true + rescue Dependabot::DependencyFileNotFound + false + end + def settings_file @settings_file ||= fetch_file_from_host("settings.gradle") rescue Dependabot::DependencyFileNotFound