C#: Re-factor DependabotProxy class to allow unit-testing. - #22477
Open
michaelnebel wants to merge 4 commits into
Open
C#: Re-factor DependabotProxy class to allow unit-testing.#22477michaelnebel wants to merge 4 commits into
michaelnebel wants to merge 4 commits into
Conversation
michaelnebel
force-pushed
the
csharp/refactordependabotproxy
branch
from
September 1, 2026 13:11
83746ff to
131e450
Compare
michaelnebel
force-pushed
the
csharp/refactordependabotproxy
branch
from
September 1, 2026 13:16
131e450 to
d870a57
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactor preserves platform and runtime behavior while adding appropriate coverage for the extracted logic.
Review tier: Balanced
Findings: None
What changed in this PR
Refactors Dependabot proxy configuration behind an injectable interface, enabling focused unit testing while preserving production behavior.
Changes:
- Adds environment-backed proxy configuration.
- Separates platform gating from testable proxy creation.
- Tests credentials, certificates, and registry URL parsing.
| File | Description |
|---|---|
csharp/extractor/Semmle.Extraction.Tests/DependabotProxy.cs |
Adds proxy unit tests and stubs. |
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDependabotProxyConfiguration.cs |
Defines injectable configuration. |
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependencyManager.cs |
Uses the refactored factory. |
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxyConfiguration.cs |
Reads configuration from environment variables. |
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs |
Extracts configuration and creation logic for testing. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we re-factor the DependabotProxy class to enable unit-testing (and also add some tests).
This is in preparation for adding support for
replaces-base(the RegistryUrl JSON object will become more "complex").DCA looks good.