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

Fixes #24655: Reformat the rudderc technique Json schema to match the one published in the schemastore repository #5570

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
280 changes: 119 additions & 161 deletions policies/rudderc/src/technique.schema.json
Original file line number Diff line number Diff line change
@@ -1,108 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://json.schemastore.org/rudder-techniques.json",
"title": "Rudder Technique",
"description": "A Rudder technique",
"type": "object",
"required": [
"id",
"name",
"version",
"items"
],
"additionalProperties": false,
"properties": {
"format": {
"title": "technique format",
"type": "number"
},
"id": {
"type": "string",
"title": "id",
"description": "Technique, must match the '^[a-zA-Z0-9_]+$' pattern",
"markdownDescription": "```Mandatory```\n\nTechnique id, must respect the ```^[a-zA-Z0-9_]+$``` pattern.\n\nUsed implicitly in technique parameters and resource folder variable definitions:\n\n* ```${<technique_id>.<parameter_name>}```\n* ```${<technique_id>.resources_dir}```",
"pattern": "^[a-zA-Z0-9_]+$",
"default": "my_technique",
"examples": [
"my_new_technique"
]
},
"name": {
"title": "name",
"description": "Human readable technique name",
"markdownDescription": "```Mandatory```\n\nHuman readable technique name",
"type": "string",
"default": "My new technique",
"examples": [
"My new technique"
]
},
"description": {
"title": "description",
"description": "Single line description of what the technique does",
"markdownDescription": "```Optional```\n\nHuman readable technique name",
"type": "string"
},
"documentation": {
"type": "string",
"title": "documentation",
"description": "Technique documentation in Markdown format",
"markdownDescription": "```Optional```\n\nTechnique documentation in Markdown format",
"format": "markdown"
},
"tags": {
"description": "Optional key-value metadata",
"markdownDescription": "```Optional```\n\nOptional key-value metadata",
"$ref": "#/$defs/tags",
"examples": [
{
"cve": "\"CVE-2023-3456\""
}
]
},
"params": {
"type": "array",
"title": "params",
"description": "List of the technique parameters",
"markdownDescription": "```Optional```\n\nList of technique parameters. See [the dedicated documentation](https://docs.rudder.io/techniques/8.0/syntax.html#parameters)",
"items": {
"$ref": "#/$defs/techniqueParameter"
}
},
"category": {
"title": "category",
"description": "Rudder category to put the technique in",
"markdownDescription": "```Optional```\n\nRudder category to put the technique in.\n\nIf empty, default to `ncf_techniques`, used by default by the technique editor.",
"type": "string",
"examples": [
"ncf_techniques",
"fileConfiguration",
"fileDistribution",
"jobScheduling"
]
},
"version": {
"type": "string",
"title": "version",
"description": "Technique version in the 'X.Y' format",
"markdownDescription": "```Mandatory```\n\nTechnique version in the 'X.Y' format",
"pattern": "^[0-9]+\\.[0-9]+$",
"default": "1.0",
"examples": [
"1.0"
]
},
"items": {
"type": "array",
"minItems": 1,
"title": "items",
"description": "List of block or method calls, can not be empty",
"markdownDescription": "```Mandatory```\n\nList of block or method calls, can not be empty",
"items": {
"$ref": "#/$defs/item"
}
}
},
"$defs": {
"uuid": {
"type": "string",
Expand All @@ -126,16 +24,14 @@
}
}
],
"required": [
"name"
],
"required": ["name"],
"additionalProperties": false,
"properties": {
"id": {
"$ref": "#/$defs/uuid",
"title": "technique parameter id",
"description": "UUID identifying the parameter",
"markdownDescription": "```Optional```\n\nUUID identifying the parameter",
"$ref": "#/$defs/uuid"
"markdownDescription": "```Optional```\n\nUUID identifying the parameter"
},
"description": {
"title": "technique parameter description",
Expand Down Expand Up @@ -236,9 +132,7 @@
"regex": {
"type": "object",
"title": "technique parameter regex constraint",
"required": [
"value"
],
"required": ["value"],
"properties": {
"value": {
"type": "string",
Expand All @@ -256,9 +150,7 @@
"title": "technique parameter select constraint",
"items": {
"type": "object",
"required": [
"value"
],
"required": ["value"],
"properties": {
"name": {
"type": "string"
Expand All @@ -278,21 +170,14 @@
},
"policyMode": {
"type": "string",
"enum": [
"audit",
"enforce",
"default"
]
"enum": ["audit", "enforce", "none"]
},
"methodReportingMode": {
"type": "object",
"title": "method reporting mode",
"properties": {
"mode": {
"enum": [
"disabled",
"enabled"
]
"enum": ["disabled", "enabled"]
}
}
},
Expand Down Expand Up @@ -321,9 +206,7 @@
]
}
},
"required": [
"mode"
],
"required": ["mode"],
"additionalProperties": false
},
{
Expand All @@ -336,10 +219,7 @@
"const": "focus"
}
},
"required": [
"mode",
"id"
],
"required": ["mode", "id"],
"additionalProperties": false
}
]
Expand Down Expand Up @@ -379,16 +259,16 @@
"type": "object"
},
"id": {
"title": "method call id",
"$ref": "#/$defs/uuid"
"$ref": "#/$defs/uuid",
"title": "method call id"
},
"tags": {
"title": "method call tags",
"$ref": "#/$defs/tags"
"$ref": "#/$defs/tags",
"title": "method call tags"
},
"policy_mode": {
"title": "method call policy mode override",
"$ref": "#/$defs/policyMode"
"policy_mode_override": {
"$ref": "#/$defs/policyMode",
"title": "method call policy mode override"
},
"condition": {
"title": "condition",
Expand All @@ -401,19 +281,13 @@
"type": "boolean"
}
],
"examples": [
"debian|rhel",
"SuSE.!sles_10"
]
"examples": ["debian|rhel", "SuSE.!sles_10"]
},
"reporting": {
"$ref": "#/$defs/methodReportingMode"
}
},
"required": [
"method",
"params"
]
"required": ["method", "params"]
},
"blockCall": {
"type": "object",
Expand Down Expand Up @@ -443,21 +317,19 @@
"title": "name",
"description": "Block call name",
"type": "string",
"examples": [
"My block title"
]
"examples": ["My block title"]
},
"id": {
"title": "block call id",
"$ref": "#/$defs/uuid"
"$ref": "#/$defs/uuid",
"title": "block call id"
},
"tags": {
"title": "block call tags",
"$ref": "#/$defs/tags"
"$ref": "#/$defs/tags",
"title": "block call tags"
},
"policy_mode": {
"title": "block call policy mode",
"$ref": "#/$defs/policyMode"
"policy_mode_override": {
"$ref": "#/$defs/policyMode",
"title": "block call policy mode"
},
"condition": {
"title": "block call condition",
Expand All @@ -469,18 +341,13 @@
"type": "boolean"
}
],
"examples": [
"debian|rhel",
"SuSE.!sles_10"
]
"examples": ["debian|rhel", "SuSE.!sles_10"]
},
"reporting": {
"$ref": "#/$defs/blockReportingMode"
}
},
"required": [
"items"
]
"required": ["items"]
},
"item": {
"type": "object",
Expand All @@ -494,5 +361,96 @@
}
]
}
},
"title": "Rudder Technique",
"description": "A Rudder technique",
"type": "object",
"required": ["id", "name", "version", "items"],
"additionalProperties": false,
"properties": {
"format": {
"title": "technique format",
"type": "number"
},
"id": {
"type": "string",
"title": "id",
"description": "Technique, must match the '^[a-zA-Z0-9_]+$' pattern",
"markdownDescription": "```Mandatory```\n\nTechnique id, must respect the ```^[a-zA-Z0-9_]+$``` pattern.\n\nUsed implicitly in technique parameters and resource folder variable definitions:\n\n* ```${<technique_id>.<parameter_name>}```\n* ```${<technique_id>.resources_dir}```",
"pattern": "^[a-zA-Z0-9_]+$",
"default": "my_technique",
"examples": ["my_new_technique"]
},
"name": {
"title": "name",
"description": "Human readable technique name",
"markdownDescription": "```Mandatory```\n\nHuman readable technique name",
"type": "string",
"default": "My new technique",
"examples": ["My new technique"]
},
"description": {
"title": "description",
"description": "Single line description of what the technique does",
"markdownDescription": "```Optional```\n\nHuman readable technique name",
"type": "string"
},
"documentation": {
"type": "string",
"title": "documentation",
"description": "Technique documentation in Markdown format",
"markdownDescription": "```Optional```\n\nTechnique documentation in Markdown format",
"format": "markdown"
},
"tags": {
"$ref": "#/$defs/tags",
"description": "Optional key-value metadata",
"markdownDescription": "```Optional```\n\nOptional key-value metadata",
"examples": [
{
"cve": "\"CVE-2023-3456\""
}
]
},
"params": {
"type": "array",
"title": "params",
"description": "List of the technique parameters",
"markdownDescription": "```Optional```\n\nList of technique parameters. See [the dedicated documentation](https://docs.rudder.io/techniques/8.0/syntax.html#parameters)",
"items": {
"$ref": "#/$defs/techniqueParameter"
}
},
"category": {
"title": "category",
"description": "Rudder category to put the technique in",
"markdownDescription": "```Optional```\n\nRudder category to put the technique in.\n\nIf empty, default to `ncf_techniques`, used by default by the technique editor.",
"type": "string",
"examples": [
"ncf_techniques",
"fileConfiguration",
"fileDistribution",
"jobScheduling"
]
},
"version": {
"type": "string",
"title": "version",
"description": "Technique version in the 'X.Y' format",
"markdownDescription": "```Mandatory```\n\nTechnique version in the 'X.Y' format",
"pattern": "^[0-9]+\\.[0-9]+$",
"default": "1.0",
"examples": ["1.0"]
},
"items": {
"type": "array",
"minItems": 1,
"title": "items",
"description": "List of block or method calls, can not be empty",
"markdownDescription": "```Mandatory```\n\nList of block or method calls, can not be empty",
"items": {
"$ref": "#/$defs/item"
}
}
}
}