{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/build-info/latest.json",
  "title": "build-info",
  "description": "build-info",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/jfrog/build-info-go/main/buildinfo-schema.json",
    "sourceSha256": "90f84b1b34964c9a2d1d245c4dc08e44304849241065e64ea60ecd5dcef9575b",
    "fileMatch": [
      "*buildinfo*.json",
      "*build-info*.json",
      "*.buildinfo"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "properties": {
      "type": "object",
      "description": "Environment variables and properties collected from the CI server",
      "patternProperties": {
        "^.+$": {
          "type": "string"
        }
      }
    },
    "version": {
      "description": "Build info schema version",
      "type": "string"
    },
    "name": {
      "description": "Build name",
      "type": "string"
    },
    "number": {
      "description": "Build number",
      "type": "string"
    },
    "type": {
      "description": "Build type",
      "type": "string"
    },
    "buildAgent": {
      "description": "Build tool information",
      "type": "object",
      "properties": {
        "name": {
          "description": "Build tool type",
          "type": "string"
        },
        "version": {
          "description": "Build tool version",
          "type": "string"
        }
      }
    },
    "agent": {
      "description": "CI server information",
      "type": "object",
      "properties": {
        "name": {
          "description": "CI server type",
          "type": "string"
        },
        "version": {
          "description": "CI server version",
          "type": "string"
        }
      }
    },
    "started": {
      "description": "Build start time",
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}(Z|[+-]\\d{4})$"
    },
    "durationMillis": {
      "description": "Build duration in milliseconds",
      "type": "integer"
    },
    "principal": {
      "description": "",
      "type": "string"
    },
    "url": {
      "description": "CI server URL",
      "type": "string"
    },
    "vcs": {
      "description": "List of VCS used for the build",
      "type": "array",
      "items": {
        "url": {
          "description": "VCS URL",
          "type": "string"
        },
        "branch": {
          "description": "Branch",
          "type": "string"
        },
        "revision": {
          "description": "Last commit hash",
          "type": "string"
        },
        "message": {
          "description": "Last commit message",
          "type": "string"
        }
      }
    }
  },
  "modules": {
    "description": "Build-info modules",
    "type": "array",
    "items": {
      "type": "object",
      "properties": {
        "properties": {
          "description": "Module properties",
          "type": "object",
          "patternProperties": {
            "^.+$": {
              "type": "string"
            }
          }
        },
        "id": {
          "description": "Module ID",
          "type": "string"
        },
        "type": {
          "description": "Module type",
          "type": "string"
        },
        "artifacts": {
          "description": "List of module artifacts",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "sha256": {
                "type": "string"
              },
              "sha1": {
                "type": "string"
              },
              "md5": {
                "type": "string"
              }
            }
          }
        },
        "dependencies": {
          "description": "List of module dependencies",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "sha256": {
                "type": "string"
              },
              "sha1": {
                "type": "string"
              },
              "md5": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "requestedBy": {
                "description": "List of ancestor dependencies, which caused this dependency to be imported into the build",
                "type": "array",
                "items": {
                  "description": "List of ancestor dependencies, which caused this dependency to be imported into the build. The first item in the list is the direct ancestor",
                  "type": "array",
                  "items": {
                    "description": "Dependency ID",
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "issues": {
    "description": "List of issues related to the build",
    "type": "object",
    "properties": {
      "tracker": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "version"
        ],
        "additionalProperties": false
      },
      "aggregateBuildIssues": {
        "description": "Whether issues have appeared in previous builds",
        "type": "boolean"
      },
      "aggregationBuildStatus": {
        "type": "string"
      },
      "affectedIssues": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string"
            },
            "url": {
              "type": "string"
            },
            "summary": {
              "type": "string"
            },
            "aggregated": {
              "description": "Whether this specific issue already appeared in previous builds",
              "type": "boolean"
            }
          }
        }
      }
    }
  }
}
