{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://iarpg.com/release-promotion-gates.schema.json",
  "title": "IARPG Release Promotion Gate Record",
  "type": "object",
  "required": [
    "release",
    "candidate_version",
    "stable_target",
    "evaluated_utc",
    "evaluating_tool",
    "overall_status",
    "summary",
    "gates"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "release": {
      "const": "IARPG-OPS-2"
    },
    "candidate_version": {
      "const": "2.0.4-wip"
    },
    "stable_target": {
      "const": "2.1.0"
    },
    "evaluated_utc": {
      "type": "string",
      "pattern": "Z$"
    },
    "evaluating_tool": {
      "type": "string"
    },
    "overall_status": {
      "enum": [
        "pass",
        "fail",
        "not-ready"
      ]
    },
    "summary": {
      "type": "object",
      "required": [
        "pass",
        "fail",
        "not_tested",
        "stable_ready"
      ],
      "properties": {
        "pass": {
          "type": "integer",
          "minimum": 0
        },
        "fail": {
          "type": "integer",
          "minimum": 0
        },
        "not_tested": {
          "type": "integer",
          "minimum": 0
        },
        "stable_ready": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "gates": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": [
          "gate_id",
          "title",
          "description",
          "status",
          "evidence",
          "last_evaluated_utc",
          "evaluating_tool",
          "blocking_reason",
          "required_next_action",
          "reason"
        ],
        "properties": {
          "gate_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pass",
              "fail",
              "not-tested"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_evaluated_utc": {
            "type": "string",
            "pattern": "Z$"
          },
          "evaluating_tool": {
            "type": "string"
          },
          "blocking_reason": {
            "type": "string"
          },
          "required_next_action": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
