Skip to content

Fix issue 133#135

Merged
dcloud347 merged 3 commits intomainfrom
fix-issue-133
Sep 13, 2025
Merged

Fix issue 133#135
dcloud347 merged 3 commits intomainfrom
fix-issue-133

Conversation

@dcloud347
Copy link
Contributor

This pull request improves the handling of public and private GitHub repositories when uploading them to the system. The main enhancement is allowing public repositories to be cloned without requiring a GitHub token, while ensuring that private repositories still require authentication. The code has been updated to check repository visibility before enforcing token requirements, and error messages have been clarified.

Repository authentication and visibility handling:

  • Updated the get_github_token function in repository.py to allow None as a valid return value for public repositories, removing the requirement for a token if the repository is public.
  • Added a check using the new is_repository_public utility before cloning: if the repository is private and no token is provided, an error is raised. This ensures tokens are only required for private repositories. [1] [2]
  • Added the is_repository_public async function to github_utils.py, which checks repository visibility by making an unauthenticated request to the GitHub API.

API and model improvements:

  • Updated the UploadRepositoryRequest model to clarify that the github_token is only required for private repositories and is optional for public repositories.

Internal codebase adjustments:

  • Modified function signatures and docstrings in repository_service.py and git_repository.py to accept an optional GitHub token (str | None), and to only inject the token into the clone URL if one is provided. [1] [2] [3]

@dcloud347 dcloud347 merged commit ea74aab into main Sep 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant