Skip to content

Commit

Permalink
schema: Support more checkout data in v4.5
Browse files Browse the repository at this point in the history
Add support for three more checkout fields: `git_commit_tags`,
`git_commit_message`, and `git_repository_branch_tip`.

The `git_commit_tags` is an array of strings representing annotated tags
pointing directly at the commit being checked out, as seen in the
source repository. I.e. the output of `git tag --points-at <commit>`.
Set to an empty array, if the commit has no tags.

The `git_commit_message` is intended to hold the complete message of the
commit being checked out, *both* subject and body. I.e. the output of
`git show -s --format=%B`. We're putting the subject and the body
together, as it's quite easy to extract the subject in SQL, while
full-text search is easier and more efficient to do over a single
column.

Finally, the `git_repository_branch_tip` is a boolean flag, which should
be set to `true`, when the commit being checked out is at the tip of the
branch at the moment of the checkout (as specified in `start_time`).
Essentially, if you're always testing only the tip of the branch, you
can set this to `true` unconditionally. This flag would let us extract
the checkouts which represented the branch state over time, and produce
a rough history of branch changes, which we can then use for
(regression) analysis and graphs, in lieu of actual commit graph
walking.
  • Loading branch information
spbnick committed Aug 29, 2024
1 parent 836bbe5 commit 21ddf85
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions kcidb_io/schema/v04_05.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,46 @@ class Version(PreviousVersion):
"the checked out base source code, as would be "
"output by \"git describe\", at the checkout time."
},
"git_commit_tags": {
"type": "array",
"description":
"The list of (annotated) tags, found in the "
"checked-out repository, pointing directly "
"at the commit being checked out. I.e. as "
"output by \"git tag --points-at <commit>\".",
"items": {
"type": "string",
"description":
"A git tag pointing at the checked-out commit"
},
},
"git_commit_message": {
"type": "string",
"description":
"The complete message of the commit being "
"checked-out, both the subject and the body. "
"I.e. as output by \"git show -s --format=%B\".",
},
"git_repository_branch": {
"type": "string",
"description":
"The Git repository branch from which the commit "
"with the base source code was checked out."
},
"git_repository_branch_tip": {
"type": "boolean",
"description":
"True if at the moment of checkout (specified in "
"\"start_time\") the checked out commit was at "
"the tip of the specified branch in the "
"specified repository. False if it was further "
"back in history.\n"
"\n"
"This information is used to reconstruct the "
"approximate history of the branch changes for "
"display and analyzis, in lieu of actual commit "
"graph walking."
},
"patchset_files": {
"description":
"List of patch files representing the patchset "
Expand Down

0 comments on commit 21ddf85

Please sign in to comment.