-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
296 additions
and
1 deletion.
There are no files selected for viewing
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
Empty file.
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"$defs": { | ||
"release": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"changes": { | ||
"additionalProperties": false, | ||
"properties": { | ||
"bugfixes": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"deprecated_features": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"minor_changes": { | ||
"items": { | ||
"type": "string" | ||
}, | ||
"type": "array" | ||
}, | ||
"release_summary": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"codename": { | ||
"type": "string" | ||
}, | ||
"modules": { | ||
"items": { | ||
"properties": { | ||
"description": { | ||
"markdownDescription": "Value of `short_description from plugin `DOCUMENTATION`.", | ||
"title": "Description", | ||
"type": "string" | ||
}, | ||
"name": { | ||
"markdownDescription": " It must not be the FQCN, but the name inside the collection.", | ||
"pattern": "[a-zA-Z0-9_]+", | ||
"title": "Short module name", | ||
"type": "string" | ||
}, | ||
"namespace": { | ||
"markdownDescription": "Must be `null` for plugin and objects. For modules it must be either empty string. The namespace is used to group new modules by their namespace inside the collection.", | ||
"title": "Namespace", | ||
"type": ["string", "null"] | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"type": "array" | ||
}, | ||
"release_date": { | ||
"format": "date", | ||
"markdownDescription": "Use ISO-8601 date format, like 2020-12-31", | ||
"pattern": "\\d\\d\\d\\d-\\d\\d-\\d\\d", | ||
"title": "Date of the release.", | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
}, | ||
"semver": { | ||
"pattern": "\\d+.\\d+.\\d+.*", | ||
"title": "Version string following SemVer specification.", | ||
"type": "string" | ||
} | ||
}, | ||
"$id": "https://raw.githubusercontent.com/ansible-lint/main/src/ansiblelint/schemas/changelog.json", | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"additionalProperties": false, | ||
"description": "Antsibull Changelog Schema", | ||
"examples": ["changelog.yml"], | ||
"markdownDescription": "See [Changelog YAML Format](https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelog.yaml-format.md)", | ||
"properties": { | ||
"ancestor": { | ||
"$ref": "#/$defs/semver" | ||
}, | ||
"releases": { | ||
"patternProperties": { | ||
"\\d+.\\d+.\\d+.*": { | ||
"$ref": "#/$defs/release", | ||
"type": "object" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
}, | ||
"title": "Antsibull Changelog Schema", | ||
"type": "object" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/schemas/negative_test/changelogs/invalid-date/changelog.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
releases: | ||
1.0.0: | ||
release_date: 01-01-2020 # invalid date format, must be ISO-8601 ! |
40 changes: 40 additions & 0 deletions
40
test/schemas/negative_test/changelogs/invalid-date/changelog.yml.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# ajv errors | ||
|
||
```json | ||
[ | ||
{ | ||
"instancePath": "/releases/1.0.0/release_date", | ||
"keyword": "pattern", | ||
"message": "must match pattern \"\\d\\d\\d\\d-\\d\\d-\\d\\d\"", | ||
"params": { | ||
"pattern": "\\d\\d\\d\\d-\\d\\d-\\d\\d" | ||
}, | ||
"schemaPath": "#/$defs/release/properties/release_date/pattern" | ||
} | ||
] | ||
``` | ||
|
||
# check-jsonschema | ||
|
||
stdout: | ||
|
||
```json | ||
{ | ||
"status": "fail", | ||
"errors": [ | ||
{ | ||
"filename": "negative_test/changelogs/invalid-date/changelog.yml", | ||
"path": "$.releases.1.0.0.release_date", | ||
"message": "'01-01-2020' is not a 'date'", | ||
"has_sub_errors": false | ||
}, | ||
{ | ||
"filename": "negative_test/changelogs/invalid-date/changelog.yml", | ||
"path": "$.releases.1.0.0.release_date", | ||
"message": "'01-01-2020' does not match '\\\\d\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d'", | ||
"has_sub_errors": false | ||
} | ||
], | ||
"parse_errors": [] | ||
} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- this is invalid | ||
- as changelog must be object (mapping) | ||
- not an array (sequence) |
34 changes: 34 additions & 0 deletions
34
test/schemas/negative_test/changelogs/list/changelog.yml.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ajv errors | ||
|
||
```json | ||
[ | ||
{ | ||
"instancePath": "", | ||
"keyword": "type", | ||
"message": "must be object", | ||
"params": { | ||
"type": "object" | ||
}, | ||
"schemaPath": "#/type" | ||
} | ||
] | ||
``` | ||
|
||
# check-jsonschema | ||
|
||
stdout: | ||
|
||
```json | ||
{ | ||
"status": "fail", | ||
"errors": [ | ||
{ | ||
"filename": "negative_test/changelogs/list/changelog.yml", | ||
"path": "$", | ||
"message": "['this is invalid', 'as changelog must be object (mapping)', 'not an array (sequence)'] is not of type 'object'", | ||
"has_sub_errors": false | ||
} | ||
], | ||
"parse_errors": [] | ||
} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
releases: foo # <-- not a semver |
34 changes: 34 additions & 0 deletions
34
test/schemas/negative_test/changelogs/no-semver/changelog.yml.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ajv errors | ||
|
||
```json | ||
[ | ||
{ | ||
"instancePath": "/releases", | ||
"keyword": "type", | ||
"message": "must be object", | ||
"params": { | ||
"type": "object" | ||
}, | ||
"schemaPath": "#/properties/releases/type" | ||
} | ||
] | ||
``` | ||
|
||
# check-jsonschema | ||
|
||
stdout: | ||
|
||
```json | ||
{ | ||
"status": "fail", | ||
"errors": [ | ||
{ | ||
"filename": "negative_test/changelogs/no-semver/changelog.yml", | ||
"path": "$.releases", | ||
"message": "'foo' is not of type 'object'", | ||
"has_sub_errors": false | ||
} | ||
], | ||
"parse_errors": [] | ||
} | ||
``` |
1 change: 1 addition & 0 deletions
1
test/schemas/negative_test/changelogs/unknown-keys/changelog.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
release: {} # <- unknown key, correct would be releases |
34 changes: 34 additions & 0 deletions
34
test/schemas/negative_test/changelogs/unknown-keys/changelog.yml.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ajv errors | ||
|
||
```json | ||
[ | ||
{ | ||
"instancePath": "", | ||
"keyword": "additionalProperties", | ||
"message": "must NOT have additional properties", | ||
"params": { | ||
"additionalProperty": "release" | ||
}, | ||
"schemaPath": "#/additionalProperties" | ||
} | ||
] | ||
``` | ||
|
||
# check-jsonschema | ||
|
||
stdout: | ||
|
||
```json | ||
{ | ||
"status": "fail", | ||
"errors": [ | ||
{ | ||
"filename": "negative_test/changelogs/unknown-keys/changelog.yml", | ||
"path": "$", | ||
"message": "Additional properties are not allowed ('release' was unexpected)", | ||
"has_sub_errors": false | ||
} | ||
], | ||
"parse_errors": [] | ||
} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ancestor: 0.5.4 | ||
releases: | ||
1.0.0-alpha: | ||
release_date: "2020-01-01" | ||
codename: "The first public one" | ||
changes: | ||
release_summary: A bit o markdown text | ||
bugfixes: | ||
- Fixed bug `#1 <https://example.com>` | ||
deprecated_features: | ||
- Free form text mentioning a deprecation | ||
minor_changes: | ||
- Free form text mentioning a minor change | ||
modules: | ||
- description: foo | ||
name: short_module_name | ||
namespace: foo |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# Example of minimal changelog.yml that is considered valid | ||
releases: {} |
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