Conversation
There was a problem hiding this comment.
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(..), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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