Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add args to enable passing input to resource export #680

Merged
merged 1 commit into from
Mar 10, 2025

Conversation

SteveL-MSFT
Copy link
Member

PR Summary

Missing args to dsc to enable passing input to direct resource export. Created export test resource to validate.

PR Context

Fix #678

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request adds support for passing input arguments to the resource export functionality and includes test coverage for the new export command.

  • Adds a new Export struct and related tests in dsctest.
  • Updates command-line argument parsing and resource command handling to accept and process export input.
  • Integrates the export command in both the testing tool and the main DSC CLI.

Reviewed Changes

File Description
tools/dsctest/src/export.rs Introduces the Export struct with a count field for testing.
tools/dsctest/src/main.rs Implements export subcommand handling with JSON input parsing.
tools/dsctest/src/args.rs Adds export command support via Clap arguments.
dsc/src/args.rs Updates resource export arguments to include input and file options.
dsc/src/subcommand.rs Modifies export subcommand dispatch to process input via get_input.
dsc/src/resource_command.rs Updates the export function to accept and process the input JSON.

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

tools/dsctest/src/main.rs:74

  • [nitpick] Consider rephrasing the error message for clarity, for example: 'Error: Export input JSON does not match expected schema: {err}'.
eprintln!("Error JSON does not match schema: {err}");

dsc/src/resource_command.rs:217

  • [nitpick] Consider exiting the process after the adapter resource is not found (instead of returning) to maintain consistency with other error handling in resource commands.
error!("{}: {requires}", t!("resource_command.adapterNotFound")); return;

@SteveL-MSFT SteveL-MSFT added this to the 3.1-Approved milestone Mar 7, 2025
@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue Mar 10, 2025
Merged via the queue into PowerShell:main with commit 1080ca7 Mar 10, 2025
4 checks passed
@SteveL-MSFT SteveL-MSFT deleted the export-input branch March 10, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent handling of export
2 participants