-
Notifications
You must be signed in to change notification settings - Fork 34
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 exporter
kind of resource
#682
Merged
Merged
Conversation
This file contains 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces a new resource kind, "exporter", that generates complete resource instances as JSONLines when exporting a configuration. Key changes include:
- Adding a new module (exporter.rs) with definitions for Exporter and Resource.
- Extending the CLI (main.rs and args.rs) to support an exporter subcommand and schema.
- Updating configuration processing (configure/mod.rs) and resource manifest (resource_manifest.rs) to incorporate the new Exporter kind.
Reviewed Changes
File | Description |
---|---|
tools/dsctest/src/exporter.rs | Adds the Exporter and Resource structs for handling exporter-specific behavior. |
tools/dsctest/src/main.rs | Implements the exporter subcommand, including JSON parsing and printing of resources. |
dsc_lib/src/configure/mod.rs | Updates configuration logic to support exporter resources by deserializing full resources. |
tools/dsctest/src/args.rs | Adds CLI support for the exporter subcommand and its associated schema. |
dsc_lib/src/dscresources/resource_manifest.rs | Introduces the Exporter variant in the resource Kind enum. |
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
dsc_lib/src/configure/mod.rs:67
- [nitpick] The inner variable 'resource' shadows an outer variable with the same name, which can be confusing. Consider renaming the inner variable (e.g., to 'parsed_resource') to improve clarity.
let resource = serde_json::from_value::<Resource>(instance.clone())?;
tgauth
reviewed
Mar 10, 2025
Co-authored-by: Tess Gauthier <tgauth@bu.edu>
tgauth
approved these changes
Mar 11, 2025
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.
PR Summary
Add a new kind of resource called
exporter
kind. This resource should only implementexport
method and returns JSONLines that would be a complete instance of aresource
in theresources
member of a configuration.The test exporter resource would emit:
This configuration:
results in:
A normal
export
from a resource would only provide the contents ofproperties
, but anexporter
needs to fill in the entire resource (and optionally include things likedependsOn
.Only the input to an exporter is validated, the output only needs to conform to a proper
resource
within a configuration (so none of the properties are validated against a schema).PR Context
Fix #515