From 89fa8c6dbfff334e700fec31a4fefb73307d8037 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 21 Aug 2024 18:42:49 +0300 Subject: [PATCH] schema: Support more checkout data in v4.5 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 `. 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. --- kcidb_io/schema/v04_05.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/kcidb_io/schema/v04_05.py b/kcidb_io/schema/v04_05.py index a1b5342..b68c05e 100644 --- a/kcidb_io/schema/v04_05.py +++ b/kcidb_io/schema/v04_05.py @@ -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 \".", + "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 "