poc(issues): first-parent next checkout (#2092) - #2134
Draft
felipebergamin wants to merge 4 commits into
Draft
felipebergamin wants to merge 4 commits into
felipebergamin wants to merge 4 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>
…ci#2089) Keep commits rows narrow: unique git name/email in commit_identity, subject plus UTF-8 body in commit_message as bytea. update_db dumps and restores the new tables and still accepts a flat legacy commits CSV.
Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
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.
Summary
commit_parents(ord = 0) backward from later checkouts on the same tree, instead of CIstart_time.start_timeLATERAL query when the last-seen hash is missing fromcommits, the first-parent chain is incomplete, or no later checkout reachesH.commits/commit_parentsschema). Performance: ~54 ms for 100 candidates over a 1M-edge indexed graph; ~212 ms for 1,000 candidates.Test plan
poetry run pytest -n 0 kernelCI_app/tests/unitTests/queries/issues_queries_test.py -k next_checkoutpoetry run pytest -n 0 --use-local-db kernelCI_app/tests/integrationTests/issue_next_checkout_test.pystart_timeneighbourHare disambiguated by later checkouts on the same treecommitsrow falls back tostart_time