Repository navigation
Don't register as system proxy or install root cert by default in CI - #2093
Open
waldekmastykarz wants to merge 1 commit into
Open
waldekmastykarz wants to merge 1 commit into
waldekmastykarz wants to merge 1 commit into
Conversation
When the CI environment variable is set, asSystemProxy and installCert default to false unless set explicitly in the config file or on the command line. Dev Proxy logs the effective values and how to override them at startup. Closes dotnet#2059 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the CI-specific proxy and certificate default changes.
No open issues 🎉
What changed in this PR
This PR makes Dev Proxy safer in CI by defaulting system proxy registration and root certificate installation to off when CI is set, while preserving explicit configuration and command-line overrides.
Changes:
- Apply and track CI-specific defaults for
asSystemProxyandinstallCert. - Log when CI defaults remain active and validate certificate options against effective configuration values.
- Add unit tests and update configuration and CI/CD guidance.
| File | Description |
|---|---|
skills/dev-proxy/references/configuration.md |
Document CI-dependent defaults for proxy registration and certificate installation. |
skills/dev-proxy/references/ci-cd-integration.md |
Explain CI defaults, overrides, and explicit proxy setup. |
DevProxy/Proxy/ProxyConfiguration.cs |
Apply CI defaults to settings omitted from configuration and track them. |
DevProxy/Commands/DevProxyCommand.cs |
Use effective configuration during validation and log active CI defaults. |
DevProxy.Tests/ProxyConfigurationCiDefaultsTests.cs |
Test defaults, configuration overrides, and logging conditions. |
Review effort: Balanced
This branch has not been deployed
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.
When the
CIenvironment variable is set, Dev Proxy no longer registers itself as the system proxy or installs/trusts its root certificate by default. Explicit values in the config file (asSystemProxy,installCert) or on the command line (--as-system-proxy,--install-cert) still win.CIset via the configenvsection or--envis honored too.At startup, Dev Proxy logs one line when a CI default was applied:
Changes:
ProxyConfiguration: after binding the config file, apply CI defaults for keys the config file doesn't set, and track which were defaulted.DevProxyCommand: log the line above unless both values were set on the command line. The--install-certvalidator now falls back to the effective config values instead of hard-codedtrue, so--install-cert falsein CI (or withasSystemProxy: falsein the config) no longer needs an explicit--as-system-proxy false.Release note: behavior change for CI pipelines that relied on Dev Proxy registering as the system proxy or installing the certificate. Set
asSystemProxy/installCerttotruein the config file or pass--as-system-proxy true/--install-cert trueto keep the old behavior. The public CI/CD overview docs need a matching update.Resolves #2059
Note: overlaps with #2089, which edits the
--as-system-proxy/--install-certoption descriptions inDevProxyCommand.cs. This PR doesn't change those descriptions; it only changes the--install-certvalidator lines just below, so any conflict should be trivial.