Skip to content

Return written report files when recording stops through the API - #2095

Open
waldekmastykarz wants to merge 2 commits into
dotnet:mainfrom
waldekmastykarz:signal-report-completion-api
Open

waldekmastykarz wants to merge 2 commits into
dotnet:mainfrom
waldekmastykarz:signal-report-completion-api

Conversation

@waldekmastykarz

@waldekmastykarz waldekmastykarz commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • RecordingArgs gets a ReportFiles collection, scoped to each stop so overlapping stops can't mix paths.
  • BaseReporter adds the absolute path of each file it writes to ReportFiles.
  • ProxyStateController.StopRecordingAsync returns those paths (Task<IReadOnlyList<string>>) after all plugins finish. Returns an empty list when not recording.
  • ProxyInfo gets a reports property, serialized only when set, so GET /proxy and starting recording are unchanged. Sending reports in a request is rejected with a validation error (like configFile).
  • Updated the CI/CD skill reference.

reports lists reporter outputs only. Files from generator plugins (HAR, OpenAPI, etc.) are referenced inside their reports, consistent with the issue's proposal.

Testing

  • Unit tests for the controller (stop returns reports, start omits them, reports in body rejected) and an integration test for JsonReporter recording absolute paths.
  • Manually verified against a detached proxy with ExecutionSummaryPlugin + JsonReporter.

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>
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner November 5, 2026 10:44
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:44

Copilot AI 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.

🟡 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 reports field 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

Comment thread DevProxy/Proxy/ProxyStateController.cs Resolved
… stops

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟢 Approval recommended

No active review issues remain for the change that returns report paths when a recording stops.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signal report completion when recording stops through the API

2 participants