[backend] Add documentation pipeline execution schedule policy schema
We plan the introduction of a new policy type and schema in #504088 (closed). We will add the feature behind a feature flag. Documenting the schema right away could be misleading until the feature actually works. We should add the documentation as soon as we have a working MVC.
We expect workflow rules in the new feature to work differently from pipeline execution policies. We should also document the differences.
Schema proposal
"pipeline_execution_schedule_policy": {
"type": "array",
"description": "Starts pipelines on a schedule with custom pipeline configuration.",
"additionalItems": false,
"maxItems": 5,
"items": {
"required": [
"name",
"enabled",
"content",
"schedule"
],
"type": "object",
"properties": {
"name": {
"description": "Name for the policy.",
"minLength": 1,
"maxLength": 255,
"type": "string"
},
"description": {
"description": "Specifies the longer description of the policy.",
"type": "string"
},
"content": {
"description": "Specifies the content of custom configuration.",
"type": "object",
"properties": {
"include": {
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"type": "object",
"properties": {
"project": {
"type": "string"
},
"file": {
"type": "string"
},
"ref": {
"type": "string"
}
},
"required": [
"project",
"file"
],
"additionalProperties": false
}
}
},
"required": [
"include"
],
"additionalProperties": false
},
"schedule": {
"description": "Specifies the condition when this policy should be triggered.",
"type": "object",
"properties": {
"cadence": {
"description": "Specifies when this policy should schedule a new pipeline with enforced `actions`. Uses cron expression as a format (ie. `0 22 * * 1-5`). Supported only when `type` is set to `schedule`.",
"type": "string",
"pattern": "(@(yearly|annually|monthly|weekly|daily|midnight|noon|hourly))|(((\\*|(\\-?\\d+\\,?)+)(\\/\\d+)?|last|L|(sun|mon|tue|wed|thu|fri|sat|SUN|MON|TUE|WED|THU|FRI|SAT\\-|\\,)+|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|\\-|\\,)+)\\s?){5,6}"
},
"timezone": {
"type": "string",
"description": "Time zone to apply to the cadence. Value must be an IANA Time Zone Database identifier, for example: `America/New_York`."
}
},
"required": [
"cadence"
],
"additionalProperties": false
},
"policy_scope": {
"$ref": "#/$defs/policy_scope"
},
"metadata": {
"$ref": "#/$defs/metadata"
},
"enabled": {
"description": "Whether to enforce this policy or not.",
"type": "boolean"
}
}
}
}
Edited by Andy Schoenen