gitbutlerapp/gitbutler · warning

Reviewer candidates for forge

Error message

Reviewer candidates for forge {forge:?} are not implemented yet.

What it means

`but_forge::review::list_reviewer_candidates` implements reviewer-candidate listing only for GitHub. The `ForgeName` extracted from `ForgeRepoInfo` is matched, and any non-GitHub forge (e.g. GitLab or other variants) falls into the `_` wildcard arm, which returns this anyhow error. It signals an intentional, not-yet-implemented forge backend rather than a runtime fault.

Solutions

  1. Use a GitHub-hosted repository (or a GitHub mirror) for review-request workflows, since only GitHub is implemented.
  2. Check `ForgeRepoInfo.forge` before calling and show a 'not supported on this forge' message in the caller instead of surfacing the error.
  3. If you need another forge, contribute the missing match arm calling the corresponding forge SDK's reviewer-candidates API.

Example fix

// before (caller)
let users = but_forge::review::list_reviewer_candidates(&user, &repo_info, &storage).await?;
// after
if repo_info.forge != ForgeName::GitHub {
    return Err(anyhow!("reviewer listing is only supported on GitHub"));
}
let users = but_forge::review::list_reviewer_candidates(&user, &repo_info, &storage).await?;
Defensive patterns

Strategy: validation

Validate before calling

if repo_info.forge != ForgeName::GitHub {
    // surface a friendly unsupported-forge message instead of calling
    return Err(anyhow!("listing reviewer candidates is only supported on GitHub"));
}

Type guard

fn is_github(info: &ForgeRepoInfo) -> bool {
    matches!(info.forge, ForgeName::GitHub)
}

Prevention

When it happens

Trigger: Calling `list_reviewer_candidates` (directly or via the review/reviewer UI/API surface) with a `ForgeRepoInfo` whose `forge` field is anything other than `ForgeName::GitHub` — e.g. the repository remote points at a GitLab or other supported forge.

Common situations: Using GitButler against a GitLab or Azure DevOps remote and opening the reviewer-request UI; a repo whose detected forge changed after a remote URL edit; SDK/CLI callers invoking the reviewer-candidates endpoint on a forge that only has GitHub plumbing.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/65c72147ab9f6bf7. Report an issue: GitHub.

Appendix: source

Thrown at crates/but-forge/src/review.rs:1398

/// List users who can be requested to review on the repository.
pub async fn list_reviewer_candidates(
    preferred_forge_user: &Option<crate::ForgeUser>,
    forge_repo_info: &crate::forge::ForgeRepoInfo,
    storage: &but_forge_storage::Controller,
) -> Result<Vec<ForgeReviewUser>> {
    let crate::forge::ForgeRepoInfo {
        forge, owner, repo, ..
    } = forge_repo_info;
    match forge {
        ForgeName::GitHub => {
            let preferred_account = preferred_forge_user.as_ref().and_then(|user| user.github());
            let users =
                but_github::pr::list_reviewer_candidates(preferred_account, owner, repo, storage)
                    .await?;
            Ok(users.into_iter().map(Into::into).collect())
        }
        _ => Err(anyhow::anyhow!(
            "Reviewer candidates for forge {forge:?} are not implemented yet."
        )),
    }
}

/// Request reviews from the given users on a review.
pub async fn request_review(
    preferred_forge_user: &Option<crate::ForgeUser>,
    forge_repo_info: &crate::forge::ForgeRepoInfo,
    review_number: usize,
    logins: &[String],
    storage: &but_forge_storage::Controller,
) -> Result<()> {
    let crate::forge::ForgeRepoInfo {
        forge, owner, repo, ..
    } = forge_repo_info;
    match forge {
        ForgeName::GitHub => {

View on GitHub (pinned to 58e5313667)