-
Notifications
You must be signed in to change notification settings - Fork 46
Enable passing Bicep files directly to dsc #997
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
Conversation
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.
Pull Request Overview
This PR introduces a new Bicep extension for DSC that enables importing Bicep files directly by transpiling them to JSON using the bicep
executable. The implementation includes a new import
capability for extensions and refactors the DscManager initialization to remove unnecessary error handling.
- Adds new
import
extension capability with support for file extension-based routing - Implements Bicep extension that transpiles .bicep files to JSON using the bicep CLI
- Refactors DscManager and Discovery constructors to remove Result return types since no fallible operations occur during initialization
Reviewed Changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
extensions/bicep/bicep.dsc.extension.json | Extension manifest defining Bicep import capability |
extensions/bicep/bicep.tests.ps1 | PowerShell tests for Bicep extension functionality |
dsc_lib/src/extensions/import.rs | New module defining import method structures and argument types |
dsc_lib/src/extensions/dscextension.rs | Adds import capability and file processing logic |
dsc_lib/src/discovery/mod.rs | Adds extension discovery and capability filtering |
dsc/src/util.rs | Integrates import extensions into file processing pipeline |
dsc/examples/hello_world.dsc.bicep | Example Bicep file for testing |
Comments suppressed due to low confidence (1)
dsc_lib/src/discovery/mod.rs:77
- [nitpick] The method name
get_extensions
is ambiguous as it could imply retrieving all extensions or extensions with specific capabilities. Consider renaming toget_extensions_by_capability
for clarity.
pub fn get_extensions(&mut self, capability: &Capability) -> Vec<DscExtension> {
c57c533
to
29c2770
Compare
Co-authored-by: Tess Gauthier <tgauth@bu.edu>
Co-authored-by: Tess Gauthier <tgauth@bu.edu>
f904d09
to
ee44f94
Compare
PR Summary
New
import
extension where the output to stdout needs to be a JSON string representing a valid DSC config file.Bicep extension that implements this requiring the
bicep
exe to be in PATH to transpile the bicep file to JSON.Still need to resolve with Bicep to not strictly validate the version to be in date format to allow semver or the word
latest
.Some other changes:
use
statements to make it more organizednew()
no longer needs to return a DscError since no code is run for creation, so removed the?
operator in many placesget_extensions()
function to discovery which is used bydsc
host since that is where file reading happens rather than indsc_lib
bicep
takes a positional arg for the file path, the args specified in the manifest can be an empty string and no arg name is passed, just the arg value (file path)Note that until DSC support in Bicep is out of Experimental status, you must have a
bicepconfig.json
that enables that feature:Also made change to PSScript multi-warning test since traces are async, order is not guaranteed.
PR Context
Part of #976