feat(backend): sync git commit metadata into commits tables (#2079) - #2118
Open
felipebergamin wants to merge 5 commits into
Open
felipebergamin wants to merge 5 commits into
felipebergamin wants to merge 5 commits into
Conversation
* Add `Commits` model: unique `git_commit_hash`, nullable author/committer/subject/message/`fetched_from_url` * Add `CommitParents` model: FKs to `commits.id`, `ord` with 0 = first parent, unique `(commit_id, ord)` * Add migration `0021_commits_and_commit_parents` (`commits`, `commit_parents` tables and indexes) * Join from `checkouts.git_commit_hash` without new checkout columns Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Dump commits and commit_parents in full so git ancestry survives restore. Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Add a SHA-only helper for commit author/parents so later sync can reuse parsing without duplicating git format handling. Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
…nelci#2079) Fetch allowlisted trees into GIT_MIRROR_DIR and ingest the tip delta into commits / commit_parents (not checkout hashes). Probe filter support, keep kernel.org packs, split mirror vs ingest crons, and exclude stored tips with ^sha on rev-list stdin. Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
felipebergamin
force-pushed
the
feat/2079/sync-commit-metadata
branch
from
September 18, 2026 19:04
2185f8e to
93ed169
Compare
felipebergamin
marked this pull request as ready for review
September 21, 2026 19:28
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Fill
commits/commit_parentsfrom git objects, not KCIDB. A persistent bare mirror atGIT_MIRROR_DIRfetches allowlisted trees; a second cron ingests the tip delta from that mirror (ancestor closure, notDISTINCT checkouts.git_commit_hash). Does not writecheckouts.git_commit_message.Closes #2109. Part of #2079. Schema #2089 and parse helper #2090 are still on this branch if they have not merged yet.
How to review
Read in this order:
docs/sync-commits.md— decisions (filter probe, kernel.org full packs, no googlesource remap, pack rollback vs keep-on-FAILED).backend/kernelCI_app/helpers/gitCommit.py— parse + one-shot SHA fetch ([#2079] Fetch commit metadata via SHA-only partial clone on tmpfs #2090).backend/kernelCI_app/helpers/commitSync.py— mirror fetch + ingest.sync_commit_mirror.py/sync_commit_ingest.py— two crons (0 4fetch,0 10ingest).commitSync_test.py,gitCommit_test.py.Skip unless you care about ops: compose
git-mirrorvolume,.env*.example,measure_git_mirror.py.Behavior that changed since the first PR description
sync_commits+ flags:sync_commit_mirrorandsync_commit_ingest.fetch=filter(git.kernel.org) still fetch;--filter=tree:0only when advertised. No URL remap.postBuffer; keep completed packs on transportFAILEDand retry once; kill the git process group on timeout.rev-list --remoteswith^shaon stdin.--not --stdindoes not exclude tips (that bug re-listed ~1.9M commits every run).--fill-gapsstays on ingest (one-shot SHA, no ancestry).Risk / rollout
GIT_MIRROR_DIRat the same time.git-mirrorvolume if an old unfiltered pack slipped in during early runs.0021is additive; no checkout column rewrite.Test plan
poetry run pytest kernelCI_app/tests/unitTests/helpers/commitSync_test.py kernelCI_app/tests/unitTests/helpers/gitCommit_test.pymanage.py sync_commit_mirror --dry-runthenmanage.py sync_commit_ingest --dry-run0 new commits(known_tips> 0)ord=0