Support creating YAML config files via devproxy config new (extension or --format)#1559
Conversation
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
devproxy config new
|
@garrytrinder should we also have a |
|
@copilot fix the merge conflicts |
Good idea. @copilot add a new optional option to the command that can determine the format to be used without specifying the filename |
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Implemented in e24a670. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
devproxy config newdevproxy config new (extension or --format)
There was a problem hiding this comment.
Pull request overview
This PR extends the devproxy config new command to support creating YAML configuration files in addition to the existing JSON format.
Changes:
- Added format detection based on file extension (
.yaml/.ymlfor YAML,.json/.jsoncfor JSON) - Introduced a
--formatoption to explicitly specify the output format (json or yaml) - Implemented JSON-to-YAML conversion using
System.Text.JsonandYamlDotNet
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
waldekmastykarz
left a comment
There was a problem hiding this comment.
LGTM. Build passes, review feedback (JsonDocument disposal, UInt64 precision) has been addressed. The format inference from file extension and the --format option work correctly.
Minor nit: there's a missing blank line between ConvertJsonElement and ResolveConfigFile (around line 617-618), but not a blocker.
Retracting approval: unable to verify e2e because the v2.2.0 snippets URL is not live yet. The JSON-to-YAML conversion logic was verified in isolation and works correctly. Pending full e2e test once the snippets URL is published.
|
Code review looks the JSON-to-YAML conversion logic works correctly in isolation (build passes, disposal and precision feedback addressed). However, we cannot verify e2e because Blocking on: snippets URL for v2.2.0 being published. Once it is live, we can do a full e2e test and re-approve. |
|
Converted to draft as we need to update the toolkit with YAML snippets and create new aka.ms links for JSON and YAML snippets for v2.2.0 |
|
@garrytrinder as we're fixing this, let's add an empty line in the code, in the place mentioned earlier in comments |
|
aka.ms links for v2.2.0 snippets are now live |
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
Done in 0d9ecd2. Added the missing blank line between
I ran a targeted Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Download snippets from /json or /yaml endpoint instead of a single URL. Removes client-side JSON-to-YAML conversion since YAML snippets are now served natively. Closes #1559
garrytrinder
left a comment
There was a problem hiding this comment.
Tested config new command with format-specific snippets URLs. All scenarios pass: default JSON, --format yaml, --format json, extension-based inference, format override, and overwrite protection. LGTM.
Original prompt
devproxy config new#1558💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.