From 5afafed2b16a7549f4e2a8b23925e049364739bf Mon Sep 17 00:00:00 2001 From: raj-meka <166544023+raj-meka@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:17:28 -0400 Subject: [PATCH 1/4] #9555:sorbet error fix --- nuget/lib/dependabot/nuget/native_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget/lib/dependabot/nuget/native_helpers.rb b/nuget/lib/dependabot/nuget/native_helpers.rb index 4047feb226d..65515c6d28c 100644 --- a/nuget/lib/dependabot/nuget/native_helpers.rb +++ b/nuget/lib/dependabot/nuget/native_helpers.rb @@ -91,7 +91,7 @@ def self.get_nuget_discover_tool_command(repo_root:, workspace_path:, output_pat sig do params( - repo_root: String, + repo_root: T.nilable(String), workspace_path: String, output_path: String, credentials: T::Array[Dependabot::Credential] From 30860e62484cfd057ad5c974fb8fc73a5a35a5b7 Mon Sep 17 00:00:00 2001 From: raj-meka <166544023+raj-meka@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:25:22 -0400 Subject: [PATCH 2/4] #9555:sorbet error fix --- nuget/lib/dependabot/nuget/file_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget/lib/dependabot/nuget/file_parser.rb b/nuget/lib/dependabot/nuget/file_parser.rb index a13b0a00504..583cb5d5a09 100644 --- a/nuget/lib/dependabot/nuget/file_parser.rb +++ b/nuget/lib/dependabot/nuget/file_parser.rb @@ -27,7 +27,7 @@ def parse key = workspace_path cache[key] ||= begin # run discovery for the repo - NativeHelpers.run_nuget_discover_tool(repo_root: T.must(repo_contents_path), + NativeHelpers.run_nuget_discover_tool(repo_root: repo_contents_path, workspace_path: workspace_path, output_path: DiscoveryJsonReader.discovery_file_path, credentials: credentials) From 0609af1b08beefbe69590b8a9e0129f180286bcb Mon Sep 17 00:00:00 2001 From: raj-meka <166544023+raj-meka@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:25:14 -0400 Subject: [PATCH 3/4] #9555:sorbet error fix --- nuget/lib/dependabot/nuget/file_parser.rb | 4 ++-- nuget/lib/dependabot/nuget/native_helpers.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nuget/lib/dependabot/nuget/file_parser.rb b/nuget/lib/dependabot/nuget/file_parser.rb index 583cb5d5a09..d3395d796b1 100644 --- a/nuget/lib/dependabot/nuget/file_parser.rb +++ b/nuget/lib/dependabot/nuget/file_parser.rb @@ -21,13 +21,13 @@ class FileParser < Dependabot::FileParsers::Base def parse workspace_path = project_files.first&.directory return [] unless workspace_path - + return [] unless repo_contents_path # `workspace_path` is the only unique value here so we use it as the cache key cache = T.let(CacheManager.cache("file_parser.parse"), T::Hash[String, T::Array[Dependabot::Dependency]]) key = workspace_path cache[key] ||= begin # run discovery for the repo - NativeHelpers.run_nuget_discover_tool(repo_root: repo_contents_path, + NativeHelpers.run_nuget_discover_tool(repo_root: T.must(repo_contents_path), workspace_path: workspace_path, output_path: DiscoveryJsonReader.discovery_file_path, credentials: credentials) diff --git a/nuget/lib/dependabot/nuget/native_helpers.rb b/nuget/lib/dependabot/nuget/native_helpers.rb index 65515c6d28c..4047feb226d 100644 --- a/nuget/lib/dependabot/nuget/native_helpers.rb +++ b/nuget/lib/dependabot/nuget/native_helpers.rb @@ -91,7 +91,7 @@ def self.get_nuget_discover_tool_command(repo_root:, workspace_path:, output_pat sig do params( - repo_root: T.nilable(String), + repo_root: String, workspace_path: String, output_path: String, credentials: T::Array[Dependabot::Credential] From 2d2bf5821d86083bc58bbb28ca9dcbdefc5e6abf Mon Sep 17 00:00:00 2001 From: Ankit Honey Date: Fri, 26 Apr 2024 16:32:34 -0700 Subject: [PATCH 4/4] fix lint issue --- nuget/lib/dependabot/nuget/file_parser.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/nuget/lib/dependabot/nuget/file_parser.rb b/nuget/lib/dependabot/nuget/file_parser.rb index d3395d796b1..69cc68970c9 100644 --- a/nuget/lib/dependabot/nuget/file_parser.rb +++ b/nuget/lib/dependabot/nuget/file_parser.rb @@ -22,6 +22,7 @@ def parse workspace_path = project_files.first&.directory return [] unless workspace_path return [] unless repo_contents_path + # `workspace_path` is the only unique value here so we use it as the cache key cache = T.let(CacheManager.cache("file_parser.parse"), T::Hash[String, T::Array[Dependabot::Dependency]]) key = workspace_path