Skip to content
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

(MAINT) Schema improvements #203

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
(SCHEMA) Replace preTest with implementsPretest
This change updates the schemas to reflect the renaming of the
`set.preTest` setting in the resource manifest to the more
readable and semantically correct `set.implementsPretest` to
reflect the change in #197.
michaeltlombardi committed Sep 29, 2023

Verified

This commit was signed with the committer’s verified signature.
michaeltlombardi Mikey Lombardi (He/Him)
commit 133b431461ce8d5a2314980e0cb513484b6c3930
4 changes: 2 additions & 2 deletions schemas/2023/08/bundled/outputs/resource/list.json
Original file line number Diff line number Diff line change
@@ -260,7 +260,7 @@
"input": {
"$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/inputKind.json"
},
"preTest": {
"implementsPretest": {
"title": "Resource Performs Pre-Test",
"description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.",
"type": "boolean",
@@ -278,7 +278,7 @@
"set"
],
"input": "stdin",
"preTest": true,
"implementsPretest": true,
"return": "state"
}
},
4 changes: 2 additions & 2 deletions schemas/2023/08/bundled/resource/manifest.json
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@
"input": {
"$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/inputKind.json"
},
"preTest": {
"implementsPretest": {
"title": "Resource Performs Pre-Test",
"description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.",
"type": "boolean",
@@ -191,7 +191,7 @@
"set"
],
"input": "stdin",
"preTest": true,
"implementsPretest": true,
"return": "state"
}
},
16 changes: 8 additions & 8 deletions schemas/2023/08/bundled/resource/manifest.vscode.json
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
"${9:argument}"
],
"input": "${10:stdin}",
"preTest": "^${11:false}",
"implementsPretest": "^${11:false}",
"return": "${12:state}"
},
"schema": {
@@ -73,7 +73,7 @@
"${14:argument}"
],
"input": "${15:stdin}",
"preTest": "^${16:false}",
"implementsPretest": "^${16:false}",
"return": "${17:state}"
},
"schema": {
@@ -128,7 +128,7 @@
"${14:argument}"
],
"input": "${15:stdin}",
"preTest": "^${16:false}",
"implementsPretest": "^${16:false}",
"return": "${17:state}"
},
"provider": {
@@ -501,12 +501,12 @@
"$ref": "#/$defs/PowerShell/DSC/main/schemas/2023/08/definitions/inputKind.json",
"markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines how DSC should pass input to the command, either as arguments or JSON over `stdin`.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#input\n"
},
"preTest": {
"implementsPretest": {
"title": "Resource Performs Pre-Test",
"description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.",
"type": "boolean",
"default": false,
"markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#pretest\n"
"markdownDescription": "***\n[_Online Documentation_][01]\n***\n\nDefines whether the DSC Resource performs its own test to ensure idempotency when calling the\n`set` command. Set this value to `true` if the DSC Resource tests input before modifying\nsystem state.\n\n[01]: https://learn.microsoft.com/powershell/dsc/reference/schemas/resource/manifest/set?view=dsc-3.0&preserve-view=true#implementspretest\n"
},
"return": {
"description": "Defines whether the command returns a JSON blob of the DSC Resource's state after the set operation or the state and an array of the properties the DSC Resource modified.",
@@ -526,7 +526,7 @@
"set"
],
"input": "stdin",
"preTest": true,
"implementsPretest": true,
"return": "state"
}
],
@@ -536,7 +536,7 @@
"markdownDescription": "Define the `set` command for the resource when no arguments are required.\n",
"body": {
"input": "${1|input,args|}",
"preTest": "^${2|true,false|}",
"implementsPretest": "^${2|true,false|}",
"return": "${3|state,stateAndDiff|}",
"executable": "${4:executable_name}"
}
@@ -546,7 +546,7 @@
"markdownDescription": "Define the `set` command for the resource when at least one argument is required.\n",
"body": {
"input": "$1",
"preTest": "^$2",
"implementsPretest": "^$2",
"return": "$3",
"executable": "${4:executable_name}",
"args": [
4 changes: 2 additions & 2 deletions schemas/2023/08/resource/manifest.set.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"input": {
"$ref": "/PowerShell/DSC/main/schemas/2023/08/definitions/inputKind.json"
},
"preTest": {
"implementsPretest": {
"title": "Resource Performs Pre-Test",
"description": "Defines whether the DSC Resource performs its own test to ensure idempotency when calling the `set` command. Set this value to `true` if the DSC Resource tests input before modifying system state.",
"type": "boolean",
@@ -36,7 +36,7 @@
"set"
],
"input": "stdin",
"preTest": true,
"implementsPretest": true,
"return": "state"
}
}
26 changes: 13 additions & 13 deletions schemas/src/resource/manifest.set.yaml
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ properties:

[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/set?<DOCS_VERSION_PIN>#input

preTest:
implementsPretest:
title: Resource Performs Pre-Test
description: >-
Defines whether the DSC Resource performs its own test to ensure idempotency when calling the
@@ -89,7 +89,7 @@ properties:
`set` command. Set this value to `true` if the DSC Resource tests input before modifying
system state.

[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/set?<DOCS_VERSION_PIN>#pretest
[01]: <DOCS_BASE_URL>/reference/schemas/resource/manifest/set?<DOCS_VERSION_PIN>#implementspretest
return:
description: >-
Defines whether the command returns a JSON blob of the DSC Resource's state after the set
@@ -122,26 +122,26 @@ examples:
args:
- config
- set
input: stdin
preTest: true
return: state
input: stdin
implementsPretest: true
return: state

defaultSnippets: # VS Code only
- label: ' Define without arguments'
markdownDescription: |
Define the `set` command for the resource when no arguments are required.
body:
input: ${1|input,args|}
preTest: ^${2|true,false|}
return: ${3|state,stateAndDiff|}
executable: ${4:executable_name}
input: ${1|input,args|}
implementsPretest: ^${2|true,false|}
return: ${3|state,stateAndDiff|}
executable: ${4:executable_name}
- label: ' Define with arguments'
markdownDescription: |
Define the `set` command for the resource when at least one argument is required.
body:
input: $1
preTest: ^$2
return: $3
executable: ${4:executable_name}
input: $1
implementsPretest: ^$2
return: $3
executable: ${4:executable_name}
args:
- ${5:--first-argument}
30 changes: 15 additions & 15 deletions schemas/src/resource/manifest.yaml
Original file line number Diff line number Diff line change
@@ -39,11 +39,11 @@ defaultSnippets:
args: ['${6:argument}']
input: ${7:stdin}
set:
executable: ${8:executable name}
args: ['${9:argument}']
input: ${10:stdin}
preTest: ^${11:false}
return: ${12:state}
executable: ${8:executable name}
args: ['${9:argument}']
input: ${10:stdin}
implementsPretest: ^${11:false}
return: ${12:state}
schema:
embedded:
${escape_dollar:$}schema: ${13|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}
@@ -71,11 +71,11 @@ defaultSnippets:
input: ${10:stdin}
return: ${12:state}
set:
executable: ${13:executable name}
args: ['${14:argument}']
input: ${15:stdin}
preTest: ^${16:false}
return: ${17:state}
executable: ${13:executable name}
args: ['${14:argument}']
input: ${15:stdin}
implementsPretest: ^${16:false}
return: ${17:state}
schema:
embedded:
${escape_dollar:$}schema: ${18|https://json-schema.org/draft/2020-12/schema,https://json-schema.org/draft/2019-09/schema,http://json-schema.org/draft-07/schema#|}
@@ -110,11 +110,11 @@ defaultSnippets:
input: ${10:stdin}
return: ${12:state}
set:
executable: ${13:executable name}
args: ['${14:argument}']
input: ${15:stdin}
preTest: ^${16:false}
return: ${17:state}
executable: ${13:executable name}
args: ['${14:argument}']
input: ${15:stdin}
implementsPretest: ^${16:false}
return: ${17:state}
provider:
config: ${18|full,sequence|}
list: