Repository navigation
Adds api-inventory preset for recording an app's API calls in CI - #75
Merged
Merged
Conversation
Related to dotnet/dev-proxy#2082 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The script can leave Dev Proxy running when token lookup fails and overwrite the app’s nonzero exit code when stopping recording also fails.
2 open issues
What changed in this PR
Adds an api-inventory preset to the Dev Proxy samples collection for recording an app’s API calls in CI without modifying requests or responses.
Changes:
- Configures URL discovery and request summaries with JSON and Markdown reports, plus optional HAR output.
- Adds a Bash script to manage recording around an app command.
- Documents setup and manual API-driven steps, and adds gallery metadata.
| File | Description |
|---|---|
samples/api-inventory/record-api-calls.sh |
Automates proxy startup, certificate retrieval, recording, and shutdown. |
samples/api-inventory/README.md |
Explains installation, CI usage, and report options. |
samples/api-inventory/assets/sample.json |
Registers the preset’s metadata for the samples gallery. |
samples/api-inventory/.devproxy/devproxyrc.json |
Defines recording plugins and reporters without system-proxy registration. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Adds the
api-inventorypreset, retrievable withdevproxy config get api-inventory, for recording which APIs an app calls, for example in CI.Resolves dotnet/dev-proxy#2082
What's included
.devproxy/devproxyrc.json: UrlDiscoveryPlugin, ExecutionSummaryPlugin, JsonReporter, MarkdownReporter, and HarGeneratorPlugin (disabled by default, opt in). UsesasSystemProxy: falseand the placeholderurlsToWatchhttps://api.contoso.com/*, which you override with--urls-to-watch.record-api-calls.sh: a CI script that starts Dev Proxy with--detach --output json, gets the API token withdevproxy api token --pid, gets the root certificate, starts and stops recording through the API around the app command, and shuts Dev Proxy down through the API. It returns the app's exit code.Validation
sample.jsonvalidates againsttemplates/metadata-schema.json.record-api-calls.shend to end with Dev Proxy 4.0.0,CI=true, and a Node 26 app that calls jsonplaceholder. The app's requests were recorded, the URL discovery and execution summary reports were written as JSON and Markdown (and the HAR file when the plugin was enabled), Dev Proxy stopped, and a non-zero app exit code was passed through.