KEMBAR78
Dscv3 command base by JohnMcPMS · Pull Request #5280 · microsoft/winget-cli · GitHub
Skip to content

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Mar 7, 2025

Change

Adds infrastructure for writing DSC v3 resource commands.
Adds a new hidden command dscv3 to put the resources under.
Adds a file content resource (DscTestFileResource) that is only available when tests hooks are enabled.

The resource infrastructure generates the resource manifest based on the defined functions and modifiers given to the base via winget dscv3 <resource> --manifest. It directs the DscFunctions it is given to the appropriate virtual method (--get maps to ResourceFunctionGet).

Resources can define properties using the helper macro WINGET_DSC_DEFINE_COMPOSABLE_PROPERTY and create an object to represent their properties with DscComposableObject. This makes extracting and writing properties to JSON easy, as well as generating a schema.

Validation

Updated E2E tests to use this test resource rather than the built-in registry resource from DSC v3.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner March 7, 2025 19:30
yao-msft
yao-msft previously approved these changes Mar 10, 2025
<value>Test the resource state</value>
</data>
<data name="DscResourceFunctionDescriptionDelete" xml:space="preserve">
<value>Delete resource state</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consistency wise, some of the strings use "the" resource and others without "the"

@mdanish-kh
Copy link
Contributor

Following up from #5252 (comment)

We now have the stable release of DSCv3 merged into winget-pkgs as Microsoft.DSC. Should we update the azure-pipelines file to use this instead of the preview? That preview release doesn't work well with the CLI & breaks if invoked via symlink (PowerShell/DSC#618). That may get removed from winget-pkgs at some point because of other challenges with separate release variants for portable without channels support in the CLI, but we wouldn't want to do it if it's referenced here. The only concern (if it's a concern) being that the MSIX variant isn't available in the stable release assets

- powershell: |
Install-WinGetPackage -Id Microsoft.DSC.Preview -Source winget
displayName: Install DSC v3
condition: succeededOrFailed()

@JohnMcPMS
Copy link
Member Author

I will make a separate change for that, once we get the MSIX in the release artifacts:
PowerShell/DSC#697

@denelon
Copy link
Collaborator

denelon commented Mar 14, 2025

@SteveL-MSFT are you planning on adding the MSIX version of DSC to the release artifacts?

FoundDscExecutablePath,
// Whether to request detailed traces from the processor.
// Read / Write
DiagnosticTraceLevel,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the name "*TraceLevel" makes me think it's taking a trace level setting like warning, verbose while after reading the code, it's more like "DiagnosticTraceEnabled"

Copy link
Member Author

Choose a reason for hiding this comment

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

I will do that first thing in my next change so I don't need to wait for another build cycle.

@JohnMcPMS JohnMcPMS merged commit 2f344f0 into microsoft:master Mar 14, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the dscv3-command-base branch March 14, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants