feat: add AtomGit/GitCode support for PR and Issue reviews#11
feat: add AtomGit/GitCode support for PR and Issue reviews#11wuxiaoqiang12 wants to merge 1 commit intoAsyncFuncAI:mainfrom
Conversation
Summary of ChangesHello, 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 significantly enhances the AsyncReview tool by integrating support for AtomGit and GitCode, two prominent code hosting platforms. The changes enable the tool to perform agentic code reviews on PRs and Issues from these new platforms, mirroring the existing GitHub functionality. This broadens the utility of AsyncReview, allowing users to leverage its advanced review capabilities across a wider range of development environments, particularly those utilizing GitHub-compatible APIs with private-token authentication. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe 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 by creating a comment using either
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 Limitations & Feedback Gemini Code Assist 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for AtomGit and GitCode platforms, which is a valuable addition. The changes involve new fetcher modules, updates to the CLI, and documentation. However, there are some critical inconsistencies in API authentication methods and documentation, as well as duplicated logic and potentially misleading information that need to be addressed to ensure correct and reliable functionality.
| ): | ||
| """Run a review on a GitHub URL.""" | ||
| """Run a review on a GitHub or AtomGit URL.""" | ||
| platform = "atomgit" if ("atomgit.com" in url or "gitcode.com" in url) else "github" |
There was a problem hiding this comment.
The logic for detecting the platform (atomgit.com or gitcode.com in the URL) is duplicated here and in cli/virtual_runner.py. It would be more maintainable to centralize this logic into a shared utility function to avoid inconsistencies and simplify future updates.
| platform = "atomgit" if ("atomgit.com" in url or "gitcode.com" in url) else "github" | |
| platform = _detect_platform_from_url(url) |
| def _detect_platform(self, url: str) -> str: | ||
| """Detect platform from URL (github, atomgit, or gitcode).""" | ||
| if "atomgit.com" in url or "gitcode.com" in url: | ||
| return "atomgit" | ||
| return "github" |
There was a problem hiding this comment.
The _detect_platform method duplicates the URL parsing logic already present in cli/main.py. This should be refactored into a single utility function to ensure consistency and ease of maintenance. Duplicated logic can lead to bugs if one instance is updated and the other is not.
| def _detect_platform(self, url: str) -> str: | |
| """Detect platform from URL (github, atomgit, or gitcode).""" | |
| if "atomgit.com" in url or "gitcode.com" in url: | |
| return "atomgit" | |
| return "github" | |
| # Consider moving this to a shared utility function | |
| def _detect_platform(self, url: str) -> str: | |
| """Detect platform from URL (github, atomgit, or gitcode).""" | |
| if "atomgit.com" in url or "gitcode.com" in url: | |
| return "atomgit" | |
| return "github" |
10f363d to
2109cdf
Compare
- Add AtomGit/GitCode URL parsing and API integration - Support private-token authentication for AtomGit API - Add atomgit_fetcher.py for URL parsing and data fetching - Add cr/atomgit.py for AtomGit API wrapper - Update CLI to detect and route AtomGit URLs - Add skills/atomgit/SKILL.md for agent skill definition - Update .env.example with AtomGit configuration - Update README.md with AtomGit usage examples Supports both atomgit.com and gitcode.com domains.
2109cdf to
14cf0ac
Compare
Summary
Add support for reviewing Pull Requests and Issues from AtomGit and GitCode platforms, in addition to the existing GitHub support.
Both platforms use a GitHub-compatible API with
private-tokenauthentication.Changes
New Files
cli/atomgit_fetcher.pycr/atomgit.pyskills/atomgit/SKILL.mdModified Files
cli/main.pycli/virtual_runner.pycr/config.pyATOMGIT_TOKEN,ATOMGIT_API_BASE,GITCODE_API_BASE.env.exampleREADME.mdUsage
Configuration
Supported URL Formats
Platform PR URL
AtomGit https://atomgit.com/owner/repo/pulls/123
GitCode https://gitcode.com/owner/repo/pull/123
Testing
Tested with real PRs from gitcode.com/openeuler/IB_Robot:
Notes