-
Notifications
You must be signed in to change notification settings - Fork 0
Add PR/MR comment posting support for GitHub, GitLab, Gitea, and Gogs with official SDK integration #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… Gitea support Co-authored-by: mach6 <[email protected]>
… comment posting Co-authored-by: mach6 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a gitea go module you can use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I've refactored the Gitea implementation to use the official Gitea Go SDK (code.gitea.io/sdk/gitea v0.21.0) instead of manual HTTP calls. This provides better type safety, error handling, and maintainability. The SDK reduces the code from ~170 lines to ~115 lines while offering more robust API integration. All tests continue to pass and the public interface remains unchanged. Commit: 3dd5afb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the GitHub go module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented! I've refactored the GitHub implementation to use the official github.com/google/go-github/v67 SDK instead of manual HTTP calls. This provides better type safety, error handling, and maintainability while reducing the code complexity from ~180 lines to ~90 lines. All tests continue to pass. Commit: 247253b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a Gitlab go module that can be used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I've implemented GitLab support using the official gitlab.com/gitlab-org/api/client-go SDK (which is the new official location after the deprecated github.com/xanzy/go-gitlab module was migrated). This provides better type safety, proper error handling, and reduces code complexity from ~180 lines to ~85 lines while offering more robust API integration. All tests continue to pass. Commit: 247253b
mach6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see feedback
…TTP calls Co-authored-by: mach6 <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: mach6 <[email protected]>
Co-authored-by: mach6 <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Cool. Lets add support for gogs too! |
Co-authored-by: mach6 <[email protected]>
Added Gogs support! The implementation uses the official
Updated documentation, help text, and sample config to include Gogs alongside GitHub, GitLab, and Gitea. All tests pass and the implementation follows the same patterns as other platforms. Commit: b57bd66 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR implements the ability to post coverage results as comments to GitHub pull requests, GitLab merge requests, Gitea pull requests, and Gogs pull requests, addressing the need for better CI/CD integration as a pre-merge gate.
Features Added
Multi-Platform Support with Official SDKs
github.com/google/go-github/v67SDK with token authenticationgitlab.com/gitlab-org/api/client-goSDK with private token authenticationcode.gitea.io/sdk/gitea v0.21.0SDK with token authenticationgithub.com/gogits/go-gogs-clientSDK with token authenticationRich Markdown Comments
Comments include:
Configuration Options
New CLI flags:
YAML configuration support:
Example Usage
Implementation Details
Architecture with Official SDKs
Posterinterfacegithub.com/google/go-github/v67(~90 lines, was ~180 with manual HTTP)gitlab.com/gitlab-org/api/client-go(~85 lines, was ~180 with manual HTTP)code.gitea.io/sdk/gitea v0.21.0(~115 lines, was ~170 with manual HTTP)github.com/gogits/go-gogs-client(~110 lines) - community SDK maintained by Gogs teamBenefits of SDK Integration
Authentication Requirements
Each platform requires an API token:
reposcopeapiscopeBackward Compatibility
Error Handling
The implementation now consistently uses official or well-maintained tooling across all four major Git hosting platforms, providing a robust foundation for CI/CD integration with enterprise-grade reliability.
Fixes #36.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.