Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit 34f2a38

Browse files
authored
Update schema to forbid use of some with_ filters (#302)
- remove with_filetree - remove with_flattened - remove with_cartesian
1 parent 95446f5 commit 34f2a38

33 files changed

+625
-160
lines changed

f/ansible-playbook.json

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,39 @@
647647
},
648648
"task": {
649649
"additionalProperties": true,
650-
"not": {
651-
"required": [
652-
"block"
653-
]
654-
},
650+
"allOf": [
651+
{
652+
"not": {
653+
"required": [
654+
"block"
655+
]
656+
}
657+
},
658+
{
659+
"not": {
660+
"required": [
661+
"with_filetree"
662+
]
663+
},
664+
"title": "with_filetree was moved to with_community.general.filetree in 2.10"
665+
},
666+
{
667+
"not": {
668+
"required": [
669+
"with_flattened"
670+
]
671+
},
672+
"title": "with_flattened was moved to with_community.general.flattened in 2.10"
673+
},
674+
{
675+
"not": {
676+
"required": [
677+
"with_cartesian"
678+
]
679+
},
680+
"title": "with_cartesian was moved to with_community.general.cartesian in 2.10"
681+
}
682+
],
655683
"properties": {
656684
"action": {
657685
"title": "Action",
@@ -843,9 +871,6 @@
843871
"with_first_found": {
844872
"title": "With First Found"
845873
},
846-
"with_flattened": {
847-
"title": "With Flattened"
848-
},
849874
"with_indexed_items": {
850875
"title": "With Indexed Items"
851876
},

f/ansible-tasks.json

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,39 @@
241241
},
242242
"task": {
243243
"additionalProperties": true,
244-
"not": {
245-
"required": [
246-
"block"
247-
]
248-
},
244+
"allOf": [
245+
{
246+
"not": {
247+
"required": [
248+
"block"
249+
]
250+
}
251+
},
252+
{
253+
"not": {
254+
"required": [
255+
"with_filetree"
256+
]
257+
},
258+
"title": "with_filetree was moved to with_community.general.filetree in 2.10"
259+
},
260+
{
261+
"not": {
262+
"required": [
263+
"with_flattened"
264+
]
265+
},
266+
"title": "with_flattened was moved to with_community.general.flattened in 2.10"
267+
},
268+
{
269+
"not": {
270+
"required": [
271+
"with_cartesian"
272+
]
273+
},
274+
"title": "with_cartesian was moved to with_community.general.cartesian in 2.10"
275+
}
276+
],
249277
"properties": {
250278
"action": {
251279
"title": "Action",
@@ -437,9 +465,6 @@
437465
"with_first_found": {
438466
"title": "With First Found"
439467
},
440-
"with_flattened": {
441-
"title": "With Flattened"
442-
},
443468
"with_indexed_items": {
444469
"title": "With Indexed Items"
445470
},

f/ansible.json

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,31 @@
643643
},
644644
"task": {
645645
"additionalProperties": true,
646-
"not": {
647-
"required": ["block"]
648-
},
646+
"allOf": [
647+
{
648+
"not": {
649+
"required": ["block"]
650+
}
651+
},
652+
{
653+
"not": {
654+
"required": ["with_filetree"]
655+
},
656+
"title": "with_filetree was moved to with_community.general.filetree in 2.10"
657+
},
658+
{
659+
"not": {
660+
"required": ["with_flattened"]
661+
},
662+
"title": "with_flattened was moved to with_community.general.flattened in 2.10"
663+
},
664+
{
665+
"not": {
666+
"required": ["with_cartesian"]
667+
},
668+
"title": "with_cartesian was moved to with_community.general.cartesian in 2.10"
669+
}
670+
],
649671
"properties": {
650672
"action": {
651673
"title": "Action",
@@ -831,9 +853,6 @@
831853
"with_first_found": {
832854
"title": "With First Found"
833855
},
834-
"with_flattened": {
835-
"title": "With Flattened"
836-
},
837856
"with_indexed_items": {
838857
"title": "With Indexed Items"
839858
},

negative_test/playbooks/environment.yml.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"params": {
1010
"missingProperty": "ansible.builtin.import_playbook"
1111
},
12-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/0/required"
12+
"schemaPath": "#/oneOf/0/required"
1313
},
1414
{
1515
"instancePath": "/0",
@@ -18,7 +18,7 @@
1818
"params": {
1919
"missingProperty": "import_playbook"
2020
},
21-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/1/required"
21+
"schemaPath": "#/oneOf/1/required"
2222
},
2323
{
2424
"instancePath": "/0",
@@ -27,7 +27,7 @@
2727
"params": {
2828
"passingSchemas": null
2929
},
30-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf"
30+
"schemaPath": "#/oneOf"
3131
},
3232
{
3333
"instancePath": "/0",
@@ -36,7 +36,7 @@
3636
"params": {
3737
"additionalProperty": "hosts"
3838
},
39-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
39+
"schemaPath": "#/additionalProperties"
4040
},
4141
{
4242
"instancePath": "/0",
@@ -45,7 +45,7 @@
4545
"params": {
4646
"additionalProperty": "environment"
4747
},
48-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
48+
"schemaPath": "#/additionalProperties"
4949
},
5050
{
5151
"instancePath": "/0/environment",
@@ -99,7 +99,7 @@ stdout:
9999
"has_sub_errors": true,
100100
"best_match": {
101101
"path": "$[0]",
102-
"message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'vars'"
102+
"message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'"
103103
}
104104
}
105105
]

negative_test/playbooks/failed_when.yml.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"params": {
1010
"missingProperty": "ansible.builtin.import_playbook"
1111
},
12-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/0/required"
12+
"schemaPath": "#/oneOf/0/required"
1313
},
1414
{
1515
"instancePath": "/0",
@@ -18,7 +18,7 @@
1818
"params": {
1919
"missingProperty": "import_playbook"
2020
},
21-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/1/required"
21+
"schemaPath": "#/oneOf/1/required"
2222
},
2323
{
2424
"instancePath": "/0",
@@ -27,7 +27,7 @@
2727
"params": {
2828
"passingSchemas": null
2929
},
30-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf"
30+
"schemaPath": "#/oneOf"
3131
},
3232
{
3333
"instancePath": "/0",
@@ -36,7 +36,7 @@
3636
"params": {
3737
"additionalProperty": "hosts"
3838
},
39-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
39+
"schemaPath": "#/additionalProperties"
4040
},
4141
{
4242
"instancePath": "/0",
@@ -45,7 +45,7 @@
4545
"params": {
4646
"additionalProperty": "tasks"
4747
},
48-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
48+
"schemaPath": "#/additionalProperties"
4949
},
5050
{
5151
"instancePath": "/0/tasks/0/failed_when",
@@ -126,7 +126,7 @@ stdout:
126126
"has_sub_errors": true,
127127
"best_match": {
128128
"path": "$[0]",
129-
"message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'vars'"
129+
"message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'"
130130
}
131131
}
132132
]

negative_test/playbooks/ignore_errors.yml.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"params": {
1010
"missingProperty": "ansible.builtin.import_playbook"
1111
},
12-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/0/required"
12+
"schemaPath": "#/oneOf/0/required"
1313
},
1414
{
1515
"instancePath": "/0",
@@ -18,7 +18,7 @@
1818
"params": {
1919
"missingProperty": "import_playbook"
2020
},
21-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/1/required"
21+
"schemaPath": "#/oneOf/1/required"
2222
},
2323
{
2424
"instancePath": "/0",
@@ -27,7 +27,7 @@
2727
"params": {
2828
"passingSchemas": null
2929
},
30-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf"
30+
"schemaPath": "#/oneOf"
3131
},
3232
{
3333
"instancePath": "/0",
@@ -36,7 +36,7 @@
3636
"params": {
3737
"additionalProperty": "hosts"
3838
},
39-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
39+
"schemaPath": "#/additionalProperties"
4040
},
4141
{
4242
"instancePath": "/0",
@@ -45,7 +45,7 @@
4545
"params": {
4646
"additionalProperty": "tasks"
4747
},
48-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/additionalProperties"
48+
"schemaPath": "#/additionalProperties"
4949
},
5050
{
5151
"instancePath": "/0/tasks/0/ignore_errors",
@@ -144,7 +144,7 @@ stdout:
144144
"has_sub_errors": true,
145145
"best_match": {
146146
"path": "$[0]",
147-
"message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'vars'"
147+
"message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'"
148148
}
149149
}
150150
]

negative_test/playbooks/import_playbook.yml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"params": {
1010
"type": "string"
1111
},
12-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/patternProperties/%5E(ansible%5C.builtin%5C.)%3Fimport_playbook%24/type"
12+
"schemaPath": "#/patternProperties/%5E(ansible%5C.builtin%5C.)%3Fimport_playbook%24/type"
1313
},
1414
{
1515
"instancePath": "/0",

negative_test/playbooks/import_playbook_exclusive.yml.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"keyword": "not",
88
"message": "must NOT be valid",
99
"params": {},
10-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/0/not"
10+
"schemaPath": "#/oneOf/0/not"
1111
},
1212
{
1313
"instancePath": "/0",
1414
"keyword": "not",
1515
"message": "must NOT be valid",
1616
"params": {},
17-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf/1/not"
17+
"schemaPath": "#/oneOf/1/not"
1818
},
1919
{
2020
"instancePath": "/0",
@@ -23,7 +23,7 @@
2323
"params": {
2424
"passingSchemas": null
2525
},
26-
"schemaPath": "#/$defs/ansible.builtin.import_playbook/oneOf"
26+
"schemaPath": "#/oneOf"
2727
},
2828
{
2929
"instancePath": "/0",

0 commit comments

Comments
 (0)