Skip to content

Experimental support for DSC v3 processing #5252

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

Merged
merged 18 commits into from
Mar 3, 2025

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Feb 26, 2025

Change

Adds experimental support for DSC v3 processing of configurations. When enabled, one can use DSC v3 instead of PowerShell DSC v2 by setting their processor to dscv3 for the configuration like:

$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
metadata:
  winget:
    processor: dscv3
resources:
<continue with schema 0.3 resource definitions>

This is currently on-par with DSC v2 in terms of functionality, except for 2 things:

  1. It does not attempt to ensure dsc.exe is present. It will find and use the preview MSIX packaged version of dsc.exe (Store ID: 9PCX3HX4HZ0Z) if installed. Otherwise, you can specify the --processor-path to dsc.exe.
  2. Resources for DSC v3 must be present on the system. There is not currently any mechanism to find and install new resources, as the paradigm is that they are part of the configurable item. There is no special handling of DSC v2 resources in the configuration; that could potentially come later.

Also makes 0.3 schema not experimental and fixes configuration history for environments.

Validation

Added unit and E2E tests.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner February 26, 2025 02:24

This comment was marked as outdated.

This comment was marked as outdated.

yao-msft
yao-msft previously approved these changes Feb 27, 2025

if (dscExecutablePath.empty())
{
dscExecutablePath = m_dynamicFactory->Lookup(ToHString(PropertyName::FoundDscExecutablePath));
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the FoundDscExecutablePath always exist?

ProcessorEngine result = ProcessorEngine::Unknown;

winrt::hstring processorIdentifier = set.Environment().ProcessorIdentifier();
if (processorIdentifier.empty() || processorIdentifier == L"pwsh")
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to be more permissive by doing case insensitive checks?

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: btw, the tests in ConfigurationSetAuthoringTests.cs used dsc3 as ProcessorIdentifier, we may want to update those to avoid confusion.

@Gijsreyn
Copy link
Contributor

Gijsreyn commented Mar 2, 2025

@JohnMcPMS, nice work! I really love seeing the content coming and WinGet's integration with DSC v3. Perhaps a tiny tiny remark. I can see that you've implemented a workaround in the azure-pipelines to install dsc.exe from the winget source. If I'm not mistaken, that will install the portable version, which is not the latest rc.1 version. I couldn't get the latest version in the winget-pkgs, because the .msixbundle was not added in the assets (see discussion).

@JohnMcPMS
Copy link
Member Author

@JohnMcPMS, nice work! I really love seeing the content coming and WinGet's integration with DSC v3. Perhaps a tiny tiny remark. I can see that you've implemented a workaround in the azure-pipelines to install dsc.exe from the winget source. If I'm not mistaken, that will install the portable version, which is not the latest rc.1 version. I couldn't get the latest version in the winget-pkgs, because the .msixbundle was not added in the assets (see discussion).

I will move to using the fully released build in my next change after it becomes available. That will likely be this week.

@JohnMcPMS JohnMcPMS merged commit b57977b into microsoft:master Mar 3, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the dscv3-impl branch March 3, 2025 18:19
@mdanish-kh mdanish-kh mentioned this pull request Mar 14, 2025
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.

3 participants