Repository navigation
devproxy logs: say which instance is shown when multiple are running - #1935
Merged
waldekmastykarz merged 7 commits intoOct 21, 2026
Merged
Conversation
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix devproxy logs to notify instance selection
devproxy logs: say which instance is shown when multiple are running
Oct 20, 2026
waldekmastykarz
marked this pull request as ready for review
October 20, 2026 17:49
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Selection behavior and stdout remain unchanged, and no blocking issues were identified.
No open issues 🎉
What changed in this PR
Addresses #1932 by making devproxy logs identify its selected instance without changing selection behavior or stdout log output.
Changes:
- Shares primary-instance selection through
StateManager.SelectPrimaryState. - Adds a stderr notice identifying the selected PID, other instances, and
--pid. - Adds selection/notice tests and updates dependency lock files.
| File | Description |
|---|---|
| DevProxy/State/StateManager.cs | Extracts the existing instance-selection logic. |
| DevProxy/packages.lock.json | Updates transitive dependency records. |
| DevProxy/Commands/LogsCommand.cs | Reports automatic instance selection to stderr. |
| DevProxy.Tests/LogsCommandTests.cs | Covers notice suppression and both selection priorities. |
| DevProxy.Proxy.Kestrel/packages.lock.json | Updates transitive dependency records. |
Review effort: Balanced
Collaborator
|
@copilot build is failing, fix |
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
Contributor
Author
…-instance-selection-fix
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e60f5fc3-be43-4e01-9202-7c2fc537f546
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.
If several Dev Proxy instances are running and
--pidisn't given,devproxy logspicks one: the system-proxy instance if there is one, otherwise the most recently started. Until now it did this silently. This PR keeps the same choice but tells the user which instance it chose and how to pick another.Changes
StateManager.SelectPrimaryState: the instance-selection ordering now lives in its own function.LoadStateAsyncandLogsCommandboth use it.LogsCommand: loads all running instances. When more than one is running, it prints the notice above to stderr, so piped or redirected log output is unchanged.DevProxy.Tests/LogsCommandTests.cscovers the single-instance case (no notice), the system-proxy choice, and the most-recently-started fallback.For reviewers
This PR takes the issue's "at least" option: it reports the choice and doesn't make
logsbehave likestop/status. Requiring--pidwhen several instances are running would match those commands. It would also break scripts that calldevproxy logswith no options. That can be a follow-up if we want it.