[db/models] Deduplicate repos by repo_src_id on CLI add#3719
Draft
devs6186 wants to merge 1 commit intochaoss:mainfrom
Draft
[db/models] Deduplicate repos by repo_src_id on CLI add#3719devs6186 wants to merge 1 commit intochaoss:mainfrom
devs6186 wants to merge 1 commit intochaoss:mainfrom
Conversation
Fixes chaoss#3056 - is_valid_github_repo now returns repo_src_id (GitHub numeric ID) alongside repo_type; the numeric ID is stable across renames - add_cli_repo passes repo_src_id through to insert_github_repo and insert_gitlab_repo - insert_github_repo checks for an existing Repo row with the same repo_src_id before inserting; if found, returns its repo_id so the renamed repo is not ingested twice under a different URL Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
Contributor
|
seems like an okay change. not reviewing in detail since IMO this needs a deeper look to see exactly where/how the frontend handles this behavior in case there is a chance for code reuse here. Contributor indicated this PR is abandoned so marking as draft and keeping the stale tag. |
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.
Changeset
Notes
When a GitHub repo moves (e.g. openai/triton -> triton-lang/triton), both the old and new URLs can be added via CLI. Because deduplication was URL-only, two separate rows would be created, causing neither to finish collection. The GitHub numeric repo ID is stable across renames and transfers, so we now capture it from the validation API call and check it before inserting. No schema change is needed — repo_src_id already exists on the table; we just start using it for lookups.
Related issues/PRs
Description
This PR fixes #3056
Notes for Reviewers
This only applies to the CLI add path. The web/frontend path was fixed separately in PR #2929.
Signed commits