gitbutlerapp/gitbutler · error · anyhow::Error

Review comments for forge {forge:?} are not implemented yet.

Error message

Review comments for forge {forge:?} are not implemented yet.

What it means

Editing a top-level conversation comment goes through `update_review_comment()`. Only GitHub is implemented (via `but_github::pr::update_comment`, which returns the updated comment); GitLab, Bitbucket and Azure hit the wildcard arm and fail before any request is sent.

Source

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

) -> Result<ForgeReviewComment> {
    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 comment = but_github::pr::update_comment(
                preferred_account,
                owner,
                repo,
                comment_id,
                body,
                storage,
            )
            .await?;
            Ok(comment.into())
        }
        _ => Err(anyhow::anyhow!(
            "Review comments for forge {forge:?} are not implemented yet."
        )),
    }
}

/// Delete a top-level conversation comment.
pub async fn delete_review_comment(
    preferred_forge_user: &Option<crate::ForgeUser>,
    forge_repo_info: &crate::forge::ForgeRepoInfo,
    comment_id: i64,
    storage: &but_forge_storage::Controller,
) -> Result<()> {
    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());

View on GitHub (pinned to caf1f223d3)

Solutions

  1. Edit the comment through the forge's web UI or native API.
  2. Show edit as disabled for non-GitHub forges.
  3. Implement a comment-update backend in `but_gitlab`/`but_bitbucket` and extend the match at crates/but-forge/src/review.rs:1322-1330.

Example fix

// before
update_review_comment(&user, &info, comment_id, &new_body, &storage).await?;

// after
if !matches!(info.forge, ForgeName::GitHub) {
    return Ok(Default::default()); // comment editing is GitHub-only; hide the control
}
update_review_comment(&user, &info, comment_id, &new_body, &storage).await?;
Defensive patterns

Strategy: validation

Validate before calling

use but_forge::forge::ForgeName;

if !matches!(info.forge, ForgeName::GitHub) {
    // render comment as read-only; editing is GitHub-only
}

Type guard

fn comment_edit_supported(forge: &but_forge::forge::ForgeName) -> bool {
    matches!(forge, ForgeName::GitHub)
}

Try / catch

match update_review_comment(&user, &info, comment_id, body, &storage).await {
    Ok(comment) => comment,
    Err(e) if e.to_string().contains("not implemented yet") => { /* keep old body */ return Ok(Default::default()); }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: The 'edit' action on a conversation comment for a review hosted on GitLab, Bitbucket or Azure — any `update_review_comment` call with a `comment_id` where `forge` is not GitHub.

Common situations: Comment edit buttons rendered for all forges; SDK consumers assuming comment CRUD parity across forges.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@caf1f223d3 (2026-08-20). Data as JSON: /api/errors/0e812f3f542dc40f. Report an issue: GitHub.