-
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
(GH-224) Convert schema constants to enums #238
Merged
SteveL-MSFT
merged 5 commits into
PowerShell:main
from
michaeltlombardi:gh-224/main/update-schema-uri
Oct 24, 2023
Merged
(GH-224) Convert schema constants to enums #238
SteveL-MSFT
merged 5 commits into
PowerShell:main
from
michaeltlombardi:gh-224/main/update-schema-uri
Oct 24, 2023
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
This change converts the string constants for the canonical schema URIs for both the configuration document and resource manifest schemas to enums, defining the valid URIs as variants. For each supported version of a schema, there are three variants: 1. `Version<YYYY>_<MM>` - The canonical URI to the non-bundled schema. Using this schema requires retrieving every referenced schema, but it is also the least-munged. 1. `Bundled<YYYY>_<MM>` - The canonical URI to the bundled schema. When using this schema, only the bundled schema needs to be retrieved. 1. `VSCode<YYYY>_<MM>` - The canonical URI to the enhanced authoring schema. This schema is specifically implemented to support contextual help and DevX when authoring in VS Code. It is much larger than the other schemas. Which gives six variants: - `Version2023_08`, `Bundled2023_08`, and `VSCode2023_08` for 2023/08 - `Version2023_10`, `Bundled2023_10`, and `VSCode2023_10` for 2023/10 Currently, the specified schema is not actually used by DSC to validate the document or manifest. In the future, we could use the version to identify how to validate and process the data.
michaeltlombardi
force-pushed
the
gh-224/main/update-schema-uri
branch
from
October 20, 2023 18:40
d86642f
to
d9d355b
Compare
Working through this PR, I think it would be worth considering a shortened links, like: # Unbundled configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
+https://aka.ms/dsc/schemas/2023/10/config/document.json
# Bundled configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.json
+https://aka.ms/dsc/schemas/2023/10/config/document.bundled.json
# Enhanced authoring configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/config/document.vscode.json
+https://aka.ms/dsc/schemas/2023/10/config/document.vscode.json
# Unbundled configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/resource/manifest.json
+https://aka.ms/dsc/schemas/2023/10/resource/manifest.json
# Bundled configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.json
+https://aka.ms/dsc/schemas/2023/10/resource/manifest.bundled.json
# Enhanced authoring configuration document schema
-https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/bundled/resource/manifest.vscode.json
+https://aka.ms/dsc/schemas/2023/10/resource/manifest.vscode.json |
michaeltlombardi
force-pushed
the
gh-224/main/update-schema-uri
branch
from
October 20, 2023 19:05
d9d355b
to
1a91807
Compare
michaeltlombardi
force-pushed
the
gh-224/main/update-schema-uri
branch
from
October 20, 2023 19:24
1a91807
to
2366487
Compare
SteveL-MSFT
approved these changes
Oct 24, 2023
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
This change converts the string constants for the canonical schema URIs for both the configuration document and resource manifest schemas to enums, defining the valid URIs as variants.
For each supported version of a schema, there are three variants:
Version<YYYY>_<MM>
- The canonical URI to the non-bundled schema. Using this schema requires retrieving every referenced schema, but it is also the least-munged.Bundled<YYYY>_<MM>
- The canonical URI to the bundled schema. When using this schema, only the bundled schema needs to be retrieved.VSCode<YYYY>_<MM>
- The canonical URI to the enhanced authoring schema. This schema is specifically implemented to support contextual help and DevX when authoring in VS Code. It is much larger than the other schemas.Which gives six variants:
Version2023_08
,Bundled2023_08
, andVSCode2023_08
for 2023/08Version2023_10
,Bundled2023_10
, andVSCode2023_10
for 2023/10Currently, the specified schema is not actually used by DSC to validate the document or manifest. In the future, we could use the version to identify how to validate and process the data.
PR Context
With the breaking changes made in recent PRs, and keeping in mind that we will eventually need to handle different versions of the schema, this PR:
$schema
URIs for manifests to2023/10
#224