Skip to content

Dscv3 package resource #5395

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 21 commits into from
Apr 23, 2025
Merged

Dscv3 package resource #5395

merged 21 commits into from
Apr 23, 2025

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Apr 17, 2025

Change

Add a new DSC v3 resource: package. This largely follows the design of the v2 resource, but uses the v3 paradigm for existence.

Other minor changes:

  • Adds a StdErrLogger and attaches it during resource execution. This currently writes all logs at Error or higher to std::cerr, allowing dsc.exe to receive (and pass on) failure information.
  • Uses the type of the standard input handle to determine if it should be read from (will not read JSON input from the interactive console, only piped input).
  • Adds support for localized schema generation for resources.
  • Moves ManifestComparator to common for re-use.

Validation

Added E2E tests to invoke the package resource in a variety of situations.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner April 17, 2025 02:49
yao-msft
yao-msft previously approved these changes Apr 21, 2025
<value>Indicates whether to accept agreements for package installs.</value>
</data>
<data name="CorrelationArgumentDescription" xml:space="preserve">
<value>An unused argument for logging</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intended to be in product code?

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 did consider making it test specific, but it seems reasonable to allow it to be passed in by anyone so that log files can be tagged.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe a description like "hidden argument" would be better than "unused"

{
return MatchType::Exact;
}
else if (lowerValue == "equals""case""insensitive")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it for preventing spelling check errors?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the spell checker is ok with this and C rules means that this is the same as "equalscaseinsensitive".


if (package.Scope != Manifest::ScopeEnum::Unknown)
{
output.Scope(ConvertScope(Manifest::ScopeToString(package.Scope), true));
Copy link
Contributor

Choose a reason for hiding this comment

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

If we export Scope, during apply, will it be enforced during installer selection and may cause failures? i.e. we have many installers that do not specify scope.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point; I think we would need to support the "OrUnknown" variants for this to work as simply as it is now. Alternately, we would need to check that the current scope is an available installer or track scope intent as we do for some other values.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, the other thing (for export) besides scope that could be a challenge is the install location.

Copy link
Contributor

@yao-msft yao-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

@JohnMcPMS JohnMcPMS merged commit 3556a3e into microsoft:master Apr 23, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the dscv3-package branch April 23, 2025 23:27
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