-
Notifications
You must be signed in to change notification settings - Fork 4
feat: support for codeberg host #104
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
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.
Pull request overview
This PR adds support for Codeberg as a third Git hosting provider alongside GitHub and GitLab. The implementation follows the existing patterns for GitHub and GitLab integration, enabling the issue tracker checker to work with Codeberg repositories.
- Introduces
CodebergKeytype for authentication - Adds Codeberg domain detection and API URL construction
- Implements command-line option for Codeberg API key
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Krank/Types.hs | Adds CodebergKey newtype and integrates it into KrankConfig |
| src/Krank/Checkers/IssueTracker.hs | Extends GitServer enum with Codeberg, implements domain mapping, API URL construction, authentication headers, and error handling |
| app/Main.hs | Adds command-line parser for --issuetracker-codebergkey option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| module Krank.Types | ||
| ( GithubKey (..), | ||
| CodebergKey(..), |
Copilot
AI
Dec 13, 2025
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.
Missing space after CodebergKey in the export list. For consistency with the other exports in the module (like GithubKey (..), GitlabKey (..)), there should be a space before the opening parenthesis.
| CodebergKey(..), | |
| CodebergKey (..), |
| githubKey :: Maybe GithubKey, | ||
| -- | The gitlab oAuth token | ||
| gitlabKeys :: Map GitlabHost GitlabKey, | ||
| -- | The codeberg host token |
Copilot
AI
Dec 13, 2025
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.
The comment "The codeberg host token" is inconsistent with the other token comments. The GitHub comment says "oAuth token" (line 63) and GitLab says "oAuth token" (line 65). For consistency, this should be "The codeberg oAuth token" to match the pattern.
| -- | The codeberg host token | |
| -- | The codeberg oAuth token |
| import Utils.Gitlab (showGitlabException) | ||
|
|
||
| data GitServer = Github | Gitlab GitlabHost | ||
| data GitServer = Github | Gitlab GitlabHost | Codeberg |
Copilot
AI
Dec 13, 2025
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.
The new Codeberg variant lacks test coverage. The test suite at tests/Test/Krank/Checkers/IssueTrackerSpec.hs contains comprehensive tests for GitHub and GitLab URL parsing (using giturlTests), but no tests are added for Codeberg. Consider adding test cases for Codeberg by calling giturlTests Codeberg in the spec to ensure the implementation works correctly.
Close #100