Skip to content

C#: TSP note and compilation info for unreachable feeds. - #22364

Merged
michaelnebel merged 4 commits into
github:mainfrom
michaelnebel:csharp/tspreportbadfeeds
Aug 27, 2026
Merged

C#: TSP note and compilation info for unreachable feeds.#22364
michaelnebel merged 4 commits into
github:mainfrom
michaelnebel:csharp/tspreportbadfeeds

Conversation

@michaelnebel

@michaelnebelmichaelnebel commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

In this PR, the tool status page note is improved to contain unreachable explicit feeds.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves C# buildless diagnostics by identifying unreachable explicitly configured NuGet feeds.

Changes:

  • Reports unreachable feeds in warnings, tool status diagnostics, and compilation metadata.
  • Updates integration queries and expected results to support string-valued metadata.
  • Adds a change note.
Show a summary per file
FileDescription
csharp/ql/lib/change-notes/2026-08-18-tsp-nuget-feed-reachability.mdDocuments the diagnostic enhancement.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_fallback/diagnostics.expectedExpects the unreachable fallback feed.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_fallback/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_fallback/CompilationInfo.expectedExpects unreachable-feed metadata.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error/CompilationInfo.expectedExpects the failed feed URL.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error_timeout/diagnostics.expectedExpects multiple unreachable feeds.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error_timeout/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_config_error_timeout/CompilationInfo.expectedExpects multiple failed feed URLs.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_clear/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/posix/standalone_dependencies_nuget_clear/CompilationInfo.expectedUpdates string-formatted expectations.
csharp/ql/integration-tests/all-platforms/standalone_winforms/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/all-platforms/standalone_winforms/CompilationInfo.expectedUpdates string-formatted expectations.
csharp/ql/integration-tests/all-platforms/standalone_slnx/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/all-platforms/standalone_slnx/CompilationInfo.expectedUpdates string-formatted expectations.
csharp/ql/integration-tests/all-platforms/standalone_resx/CompilationInfo.qlReads string metadata values.
csharp/ql/integration-tests/all-platforms/standalone_resx/CompilationInfo.expectedUpdates string-formatted expectations.
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.csComputes and reports unreachable explicit feeds.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 18/18 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +547 to +550
catch
{
return feed;
}

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs:549

  • Returning the original value when URI parsing fails defeats the redaction this helper is intended to provide. FeedManager accepts any source beginning with HTTP(S), so a malformed credential-bearing value such as https://user:secret@ can fail new Uri, be classified as unreachable, and then be written verbatim to compilation telemetry and the status-page diagnostic. Do not echo an unparsed value on this path.
 return feed;
  • Files reviewed: 18/18 changed files
  • Comments generated: 1
  • Review effort level: Balanced

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs:550

  • Malformed explicit feeds still bypass the redaction: feed discovery only checks the http(s):// prefix, so a value such as https://user:token@ reaches this branch after both URI construction and the reachability request fail. Returning it verbatim then exposes the credential through the warning, compilation_info, and the telemetry-enabled diagnostic. Use a non-sensitive placeholder (or a separately validated redaction) when parsing fails.
 return feed;
  • Files reviewed: 18/18 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@michaelnebel
michaelnebelforce-pushed the csharp/tspreportbadfeeds branch from fc43f8f to 65184b8CompareAugust 25, 2026 07:15
@michaelnebel
michaelnebelforce-pushed the csharp/tspreportbadfeeds branch from 65184b8 to 9446394CompareAugust 25, 2026 12:47
@michaelnebel

Copy link
Copy Markdown
ContributorAuthor

DCA looks good.

@michaelnebel
michaelnebel marked this pull request as ready for review August 26, 2026 11:04
@michaelnebel
michaelnebel requested a review from a team as a code ownerAugust 26, 2026 11:04

@hvitvedhvitved left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michaelnebel
michaelnebel merged commit d0aa8f8 into github:mainAug 27, 2026
25 checks passed
@michaelnebel
michaelnebel deleted the csharp/tspreportbadfeeds branch August 27, 2026 10:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@michaelnebel@hvitved@github-advanced-security