Fix GitHub repository creation and clone logic in scan storage#853
Open
huseynovvusal wants to merge 1 commit intoaboutcode-org:mainfrom
Open
Fix GitHub repository creation and clone logic in scan storage#853huseynovvusal wants to merge 1 commit intoaboutcode-org:mainfrom
huseynovvusal wants to merge 1 commit intoaboutcode-org:mainfrom
Conversation
…s and refine repository name retrieval in `get_github_repos`. Signed-off-by: Vusal Huseynov <vslh333222111@gmail.com>
2ca6de3 to
def1240
Compare
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.
Description
This PR fixes two critical failure cases in the get_or_init_repo() bootstrap flow during scan storage, which previously broke when handling existing remote repositories or correctly creating new ones.
The Issues
org/repo-name), which caused the simplerepo_name not in get_github_repos()membership check to silently fail and incorrectly attempt to recreate existing repositories.Repo.clone_from()to fail with aNoneURL.repo_urlwas never defined, resulting in an undefined variable crash during cloning./user/reposAPI endpoint, causing organizational repositories to be incorrectly requested under the authenticated user instead of their respective namespace.The Fixes
"name"to ensure the existence check successfully evaluates.f"https://github.com/{namespace}/{repo_name}.git") to ensure the clone command never crashes.clone_urlupon creation.organizationargument to seamlessly support both user and organization/orgs/{org}/reposcreation pathways based on the provided namespace.Testing
clearcodeand model test suites pass locally against the PostgreSQL testing database.Closes #847