-
Notifications
You must be signed in to change notification settings - Fork 30
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
(SCHEMAS) Update schemas for preview.7 #397
Merged
SteveL-MSFT
merged 15 commits into
PowerShell:main
from
michaeltlombardi:schemas/main/update-schemas-preview.7
Apr 18, 2024
Merged
(SCHEMAS) Update schemas for preview.7 #397
SteveL-MSFT
merged 15 commits into
PowerShell:main
from
michaeltlombardi:schemas/main/update-schemas-preview.7
Apr 18, 2024
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
michaeltlombardi
force-pushed
the
schemas/main/update-schemas-preview.7
branch
4 times, most recently
from
April 16, 2024 15:45
660f61d
to
8064adb
Compare
This change updates the source schemas to account for renaming DSC Resource Providers to DSC Resource Adapters in PowerShell#334. This is a breaking schema change that requires a new canonical URI, so the change also adds new schema URIs to DSC to account for the changes. The regenerated schemas will be added in the next commit.
This commit generates the canonical schemas from source using the new canonical URI for `2024/04`, as the changes include a break from the prior `2023/08` schemas. It also updates the VS Code settings to use the newest schemas for IntelliSense and validation.
This change updates the existing tests, example configuration documents, and resource manifests to use the latest canonical schema URIs that are compatible with `preview.7`.
This change adds the `kind` property to the resource manifest schema, as implemented in PowerShell#338. It updates the source schema and regenerates the composed schemas.
This change updates the example configuration document and resource manifests to use the `2024/04` URI instead of older versions.
This change updates the output schema for the `dsc resource list` command to rename the `requires` property to the more semantically correct and unambiguous `requireAdapter` property, as implemented in PowerShell#373. It updates both the source and composed schemas.
This change updates the casing for the secure parameter types from `securestring` and `secureobject` to `secureString` and `secureObject`, as implemented in PowerShell#364. It updates both the source and composed schemas.
This change adds the `capabilities` property to the output schema for the `dsc resource list` command, as implemented in PowerShell#357. It updates both the source and composed schemas.
This change adds the `delete` method-defining property to the resource manifest schema and updates the `capabilities` enumeration to include `SetHandlesExist` and `Delete`, as implemented in PowerShell#379. It updates both the source and composed schemas.
This change updates the `metadata` property of the configuration document schema to include the validated `Microsoft.DSC` property, with the `requiredSecurityContext` child property, as implemented in PowerShell#351. This change updates both the source and composed schemas.
This change updates guidance for resources that implement the `delete` method to always define the `_exist` property in the JSON schema for the resource's properties, now that DSC can automatically determine whether to delete an instance as implemented in PowerShell#382. This change updates both the source and composed schemas.
This change updates the definition of the command arguments from an array of strings to an array that can include strings and a single object representing a JSON input argument, as implemented in PowerShell#385. The shared definition includes default snippets to simplify adding arguments to an `args` list, but not validation for the maximum number of JSON input arguments. It updates the definition for the schema command and adapter list command to expect arrays of strings instead of the shared definition for the command arguments, as those commands never get JSON data for input and their struct definition in Rust expects an optional vector of strings, not command arguments. It updates the definition for the `delete`, `export`, `get`, `set`, `test`, and `validate` commands to: 1. Make `input` optional, if it was required before, because that matches the struct definitions and DSC no longer requires the `input` kind when `args` includes a JSON input argument. 1. Add validation using three branches of the `oneOf` keyword, to handle mixed support for the `contains`, `minContains`, and `maxContains` keywords across the JSON and YAML support in VS Code. It raises specific error messages now when: - `input` isn't defined and `args` doesn't include a JSON input argument, or includes more than one JSON input argument. - `input` is defined and `args` includes more than one JSON input argument. 1. Update the default snippets to enable users to quickly define the command without any arguments, with only string arguments, and with a JSON input argument. 1. Update the in-editor help and clarify that the command must define `input`, a JSON input argument in `args`, or both. This change updates both the source and composed schemas.
This changes defines the metadata properties that DSC returns in the results for the `dsc config *` commands, as implemented in PowerShell#405. It defines each metadata property as a separate file in a new folder for metadata schemas for easier reuse, as well as two definitions of the `metadata` property used across different result objects, one for the top-level of a configuration and one for resource instances in that result. This change also required a minor fix to the build script to account for array items that are objects solely defined by a `$ref` keyword and to find and compose schemas from the new `metadata` folder. The change includes the rename for the `requiredSecurityContext` metadata property to `securityContext`.
Prior to this change, the output schemas were bundled, but not with in the format compatible with VS Code. This change adds the VS Code compatible bundle format to the composed schemas configuration. This enables us to show new examples of output data with IntelliSense to make inspecting the output structure easier and more interactive. This change also reorganizes the schema examples folder to use subfolders for configuration documents, resource manifests, and the new output data objects.
Prior to this change, the example configuration document for assertions was invalid, using the `_ensure` property instead of `_exist`. This change updates the document to be valid.
michaeltlombardi
force-pushed
the
schemas/main/update-schemas-preview.7
branch
from
April 18, 2024 13:31
cbf1e78
to
87ca2a9
Compare
SteveL-MSFT
approved these changes
Apr 18, 2024
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
These changes update the source schemas to account for the changes in
preview.7
. Because the updates include breaking changes from the prior schema,2023/10
, this requires creating a new canonical URI as2024/04
and generating the updated schemas.PRs with potential schema changes are captured in the following list. Checked items indicate the schema changes have been addressed in this PR. Unchecked items indicate that the changes need to be investigated and possibly incorporated.
provider
toadapter
#334kind
to dscresource #338requires
in DscResource schema torequireAdapter
#373delete
for resources that don't support_exist
directly #382PR Context
Changes in the next release require schema updates, including breaking changes.