Conversation
- Add specific error messages for 403 and 404 HTTP responses - Distinguish between repository not found and access denied scenarios - Provide clear feedback when authentication is required for private repos - Update all GitHub API methods with proper error handling - Wrap repository data fetching in try-catch blocks in API endpoints Fixes issue where private repository access failures showed generic errors instead of informative messages guiding users toward authentication.
- Update GitHubService to accept user-provided tokens - Modify API request models to include github_token field - Update frontend to show token input only when private repo error occurs - Add informative help text with link to GitHub documentation - Update fetch-backend functions to pass GitHub tokens to API - Maintain token security by using password input and not storing tokens This enables users to access their private repositories by providing a GitHub Personal Access Token when needed, with a user-friendly interface that appears contextually when private repo access fails.
1c05fcd to
39faf9e
Compare
There was a problem hiding this comment.
Summary of Changes
Hello @abhishek-anand, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces significant enhancements to how the application interacts with GitHub repositories, particularly private ones. The primary goal is to enable users to access their private repositories by providing a GitHub Personal Access Token, while also greatly improving the clarity and specificity of error messages when repository access fails due to permissions or non-existence. This makes the application more robust and user-friendly for private repository workflows.
Highlights
- Private Repository Access: Implemented support for GitHub Personal Access Tokens (PATs) to allow users to access private repositories, enhancing the application's utility for a wider range of GitHub projects.
- Enhanced Error Handling: Improved error handling for GitHub API calls, providing more specific and user-friendly messages for 403 (Forbidden) and 404 (Not Found) responses, guiding users on how to resolve access issues.
- Backend Integration: Modified API request models (
ApiRequest,SlideRequest) to accept agithub_tokenand updated theget_cached_github_datafunction to dynamically instantiateGitHubServicewith the provided token, ensuring secure and authenticated access. - GitHub Service Refinement: The
GitHubServicenow prioritizes user-provided tokens for authentication and includes more robust error propagation for various GitHub API interactions (e.g., fetching default branch, file tree, README, or file content).
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request enhances the application by adding support for private repositories and improving error handling. The changes are well-structured and the intent is clear. The review focuses on improving API error handling and reducing code duplication to enhance maintainability.
Summary
Test plan
Changes Made
Backend
Frontend