Context
checkouts stores CI submissions, not git objects. For each checkout we currently keep:
git_commit_hash / git_commit_name / git_commit_tags
git_commit_message (often empty; submitters rarely send it)
git_repository_url / git_repository_branch
KCIDB has no author, committer, or parent fields, so we cannot get this from ingestion. We also have no parent chain, which is why #1958 / #2054 had to approximate “next checkout” with start_time.
The same git_commit_hash can appear on many checkouts (origins, labs). Author / parents are properties of the git object, not of a checkout row. Storing them only on checkouts would duplicate data and go stale independently per origin.
Goal
Persist git metadata for commits we already see in checkouts, filled from the real repositories (not from KCIDB submissions).
Store at least
- author name, email, date
- committer name, email, date
- parent hashes (ordered; first parent = mainline parent on merges)
- subject (first line of the message)
- backfill
git_commit_message when we have it from git and the checkout row is null
Nice to have later: tree hash, merge flag (array_length(parents) > 1).
Proposed shape
New commits table keyed by git_commit_hash (the object is globally unique). Keep a fetched_from_url of the repo we used. Join from checkouts.git_commit_hash.
Do not add these columns onto checkouts.
Filling it
Background command / cron, incremental:
- Distinct hashes in
checkouts that are missing from commits
- Resolve a fetch URL from an existing checkout (prefer a known-good tree URL; same mapping
treeproof already uses)
git cat-file / git log -1 --format against a local mirror (fetch, do not clone from scratch every run)
- Upsert; skip / log hashes we cannot resolve (bad URL, object not on that remote)
Must tolerate missing objects, private remotes, and the malformed git_repository_url cases from #1952 / #1953 without crashing the job.
Why this is useful
- Real first-parent history instead of ordering checkouts by
start_time
- Author on tree / commit / issue views
- Search / filter by author
- Honest merge vs first-parent walks
Out of scope
- Changing the KCIDB submission schema or waiting for origins to send this
- UI (follow-up once the table is populated)
- Rewriting treeproof / tree-name mapping (#1953)
Related
- #1958 next checkout after last seen
- #1509 reject checkouts without
commit_hash
Context
checkoutsstores CI submissions, not git objects. For each checkout we currently keep:git_commit_hash/git_commit_name/git_commit_tagsgit_commit_message(often empty; submitters rarely send it)git_repository_url/git_repository_branchKCIDB has no author, committer, or parent fields, so we cannot get this from ingestion. We also have no parent chain, which is why #1958 / #2054 had to approximate “next checkout” with
start_time.The same
git_commit_hashcan appear on many checkouts (origins, labs). Author / parents are properties of the git object, not of a checkout row. Storing them only oncheckoutswould duplicate data and go stale independently per origin.Goal
Persist git metadata for commits we already see in
checkouts, filled from the real repositories (not from KCIDB submissions).Store at least
git_commit_messagewhen we have it from git and the checkout row is nullNice to have later: tree hash, merge flag (
array_length(parents) > 1).Proposed shape
New
commitstable keyed bygit_commit_hash(the object is globally unique). Keep afetched_from_urlof the repo we used. Join fromcheckouts.git_commit_hash.Do not add these columns onto
checkouts.Filling it
Background command / cron, incremental:
checkoutsthat are missing fromcommitstreeproofalready uses)git cat-file/git log -1 --formatagainst a local mirror (fetch, do not clone from scratch every run)Must tolerate missing objects, private remotes, and the malformed
git_repository_urlcases from #1952 / #1953 without crashing the job.Why this is useful
start_timeOut of scope
Related
commit_hash