Repository navigation
Return written report files when recording stops through the API - #2095
Open
waldekmastykarz wants to merge 2 commits into
Open
waldekmastykarz wants to merge 2 commits into
waldekmastykarz wants to merge 2 commits into
Conversation
POST /proxy {"recording": false} already waits for plugins and reporters
to finish. It now also returns the absolute paths of the report files
reporters wrote, so scripts don't have to poll the folder or parse logs:
{"recording": false, "reports": ["/abs/path/ExecutionSummaryPlugin_JsonReporter.json"]}
Closes dotnet#2069
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Overlapping recording stops can overwrite the shared report collector, causing responses to omit their own files or return another recording’s paths.
1 open issue
What changed in this PR
This PR lets API callers retrieve written report paths when stopping a recording, avoiding output-folder polling in scripts and CI workflows.
Changes:
- Collects absolute reporter output paths and returns them in stop-recording responses.
- Adds the response-only
reportsfield while preserving GET and start-recording responses. - Adds controller and reporter tests and updates CI/CD guidance.
| File | Description |
|---|---|
skills/dev-proxy/references/ci-cd-integration.md |
Documents report paths in stop-recording responses. |
DevProxy/Proxy/ProxyStateController.cs |
Collects and returns paths after plugins finish. |
DevProxy/Proxy/IProxyStateController.cs |
Updates the stop-recording return contract. |
DevProxy/ApiControllers/ProxyInfo.cs |
Adds the optional reports response property. |
DevProxy/ApiControllers/ProxyController.cs |
Returns report paths and rejects supplied report lists. |
DevProxy.Tests/ProxyControllerTests.cs |
Tests stop/start responses and input validation. |
DevProxy.Tests/Fakes.cs |
Supports report paths in the controller fake. |
DevProxy.Plugins/Reporters/BaseReporter.cs |
Records absolute paths after successful writes. |
DevProxy.Integration.Tests/JsonReporterTests.cs |
Tests collection of written report paths. |
DevProxy.Abstractions/Utils/ProxyUtils.cs |
Defines the shared report-file collection key. |
Review effort: Balanced
… stops Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Resolves #2069
What
POST /proxy {"recording": false}already awaits all plugins'AfterRecordingStopAsync(including reporters) before responding, but it didn't tell callers what was written. It now returns the absolute paths of the report files:{"recording": false, "configFile": "...", "reports": ["/abs/path/ExecutionSummaryPlugin_JsonReporter.json"]}Scripts can use the response directly instead of polling the output folder or sleeping.
How
RecordingArgsgets aReportFilescollection, scoped to each stop so overlapping stops can't mix paths.BaseReporteradds the absolute path of each file it writes toReportFiles.ProxyStateController.StopRecordingAsyncreturns those paths (Task<IReadOnlyList<string>>) after all plugins finish. Returns an empty list when not recording.ProxyInfogets areportsproperty, serialized only when set, soGET /proxyand starting recording are unchanged. Sendingreportsin a request is rejected with a validation error (likeconfigFile).reportslists reporter outputs only. Files from generator plugins (HAR, OpenAPI, etc.) are referenced inside their reports, consistent with the issue's proposal.Testing
reportsin body rejected) and an integration test forJsonReporterrecording absolute paths.ExecutionSummaryPlugin+JsonReporter.