Skip to content

Commit

Permalink
schema: Add (issue presence) transitions to v4.4
Browse files Browse the repository at this point in the history
Add support for describing issue presence transitions.

The transitions point out the range of revisions along the change
history, where an issue has appeared or disappeared from the code. Note
that although there are no explicit revision objects in the I/O schema
they exist as aggregated objects in the ORM and the dashboards.

Transitions are generally expected to be substantiated by issue incidents
(which can be inferred from the revision and the issue linked from the
transition). However, that's not really necessary, as long as the
submitter makes it clear what happened in the transition and/or issue
description (or perhaps in the linked report), and makes sure it really
did.

Transitions can be "updated" - new versions of them submitted, when e.g.
they're located more precisely (the revision range was narrowed), or
for example they need to point to another issue.
  • Loading branch information
spbnick committed May 21, 2024
1 parent f19434b commit f56770c
Showing 1 changed file with 130 additions and 1 deletion.
131 changes: 130 additions & 1 deletion kcidb_io/schema/v04_04.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from kcidb_io.schema.v04_03 import Version as PreviousVersion

# It's OK, pylint: disable=too-many-lines


# Of course, we need that, pylint: disable=too-many-ancestors
class Version(PreviousVersion):
Expand Down Expand Up @@ -83,6 +85,30 @@ class Version(PreviousVersion):
"e7828bc22e12d301b42"
],
},
# An ID of a revision
"revision_id": {
"description": "A (composite) revision ID",
"type": "object",
"properties": {
"git_commit_hash": {
"description":
"The full commit hash of the revision's base "
"source code",
"$ref": "#/$defs/git_commit_hash"
},
"patchset_hash": {
"description":
"The hash of the patchset applied on top of the "
"revision's commit, or empty string if none.",
"$ref": "#/$defs/patchset_hash",
},
},
"additionalProperties": False,
"required": [
"git_commit_hash",
"patchset_hash",
],
},
# A named remote resource
"resource": {
"title": "resource",
Expand Down Expand Up @@ -920,6 +946,103 @@ class Version(PreviousVersion):
"issue_version",
],
},
# A transition
"transition": {
"title": "transition",
"description":
"A transition of issue presence along revision history.",
"type": "object",
"properties": {
"_timestamp": {
"type": "string",
"format": "date-time",
"description":
"The last time the transition was updated in the "
"database.",
"examples": [
"2020-08-14T23:08:06.967000+00:00",
],
},
"id": {
"type": "string",
"description":
"Transition ID\n"
"\n"
"Must start with a non-empty string identifying "
"the CI system which submitted the transition, "
"followed by a colon ':' character. The rest of "
"the string is generated by the origin CI "
"system, and must identify the transition "
"uniquely among all transitions, coming from "
"that CI system.\n",
"pattern": f"^{PreviousVersion.origin_id_pattern}$",
},
"origin": {
"type": "string",
"description":
"The name of the CI system which submitted "
"the transition",
"pattern": f"^{PreviousVersion.origin_pattern}$",
},
"issue_id": {
"type": "string",
"description":
"The ID of the appearing/disappearing issue.",
"pattern": f"^{PreviousVersion.origin_id_pattern}$",
},
"issue_version": {
"type": "integer",
"description":
"The modification version number of the "
"appearing/disappearing issue.",
"minimum": 0,
},
"version": {
"type": "integer",
"description":
"The modification version number of the "
"transition.",
"minimum": 0,
},
"appearance": {
"type": "boolean",
"description":
"True if the transition describes an issue "
"appearance (a regression), false if it "
"describes an issue disappearance (a recovery)."
},
"revision_before": {
"description":
"ID of the last-known revision before the "
"transition",
"$ref": "#/$defs/revision_id",
},
"revision_after": {
"description":
"ID of the first-known revision after the "
"transition",
"$ref": "#/$defs/revision_id",
},
"comment": {
"type": "string",
"description":
"A human-readable comment regarding the "
"transition.",
},
"misc": {
"type": "object",
"description":
"Miscellaneous extra data about the transition.",
},
},
"additionalProperties": False,
"required": [
"id",
"origin",
"issue_id",
"issue_version",
],
},
},

"properties": {
Expand Down Expand Up @@ -982,6 +1105,11 @@ class Version(PreviousVersion):
"type": "array",
"items": {"$ref": "#/$defs/incident"},
},
"transitions": {
"description": "List of transitions",
"type": "array",
"items": {"$ref": "#/$defs/transition"},
},
},
"additionalProperties": False,
"required": [
Expand All @@ -995,6 +1123,7 @@ class Version(PreviousVersion):
"checkouts": ["builds"],
"builds": ["tests", "incidents"],
"tests": ["incidents"],
"issues": ["incidents"],
"issues": ["incidents", "transitions"],
"incidents": [],
"transitions": [],
}

0 comments on commit f56770c

Please sign in to comment.