gitbutlerapp/gitbutler · warning

Review comments for forge

Error message

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

What it means

`but_forge::review::update_review_comment` implements editing a top-level review comment only for GitHub; any other `ForgeName` hits the `_` arm and returns this anyhow error. It marks a forge backend that has not been implemented yet rather than a permissions or network failure (forges enforce their own permissions downstream).

Solutions

  1. Edit review comments only on GitHub repositories.
  2. Pre-check `repo_info.forge` and hide/disable the edit action on non-GitHub forges.
  3. Implement the missing forge arm with the forge's comment-edit API (e.g. GitLab `PUT /merge_requests/.../notes/:id`).

Example fix

// before
let c = but_forge::review::update_review_comment(&user, &repo_info, cid, "new body", &storage).await?;
// after
if repo_info.forge != ForgeName::GitHub {
    anyhow::bail!("editing review comments is only supported on GitHub");
}
let c = but_forge::review::update_review_comment(&user, &repo_info, cid, "new body", &storage).await?;
Defensive patterns

Strategy: validation

Validate before calling

if repo_info.forge != ForgeName::GitHub {
    return Err(anyhow!("editing review comments is only supported on GitHub"));
}

Type guard

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

Prevention

When it happens

Trigger: Calling `update_review_comment` with `forge_repo_info.forge` other than `ForgeName::GitHub` while editing a review comment identified by `comment_id`.

Common situations: Editing a merge-request comment via GitButler on a GitLab remote; a UI that renders an edit affordance for all comments regardless of forge; SDK/CLI callers using the edit-comment endpoint on an unsupported forge.

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/0e812f3f542dc40f. Report an issue: GitHub.

Appendix: source

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

) -> 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 58e5313667)