Skip to content

Conversation

@guibou
Copy link
Owner

@guibou guibou commented Dec 13, 2025

Close #100

Copy link

Copilot AI left a 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 CodebergKey type 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(..),
Copy link

Copilot AI Dec 13, 2025

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.

Suggested change
CodebergKey(..),
CodebergKey (..),

Copilot uses AI. Check for mistakes.
githubKey :: Maybe GithubKey,
-- | The gitlab oAuth token
gitlabKeys :: Map GitlabHost GitlabKey,
-- | The codeberg host token
Copy link

Copilot AI Dec 13, 2025

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.

Suggested change
-- | The codeberg host token
-- | The codeberg oAuth token

Copilot uses AI. Check for mistakes.
import Utils.Gitlab (showGitlabException)

data GitServer = Github | Gitlab GitlabHost
data GitServer = Github | Gitlab GitlabHost | Codeberg
Copy link

Copilot AI Dec 13, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for forgejo (e.g. codeberg)

2 participants