{"record":{"id":"c9445bdff52de11a","repo":"gitbutlerapp/gitbutler","slug":"review-labels-for-forge-forge-are-not-implemen","errorCode":null,"errorMessage":"Review labels for forge {forge:?} are not implemented yet.","messagePattern":"Review labels for forge (.+?) are not implemented yet\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but-forge/src/review.rs","lineNumber":1345,"sourceCode":") -> Result<Vec<ForgeReviewLabel>> {\n    let crate::forge::ForgeRepoInfo {\n        forge, owner, repo, ..\n    } = forge_repo_info;\n    match forge {\n        ForgeName::GitHub => {\n            let preferred_account = preferred_forge_user.as_ref().and_then(|user| user.github());\n            let labels = but_github::pr::add_labels(\n                preferred_account,\n                owner,\n                repo,\n                review_number,\n                labels,\n                storage,\n            )\n            .await?;\n            Ok(labels.into_iter().map(Into::into).collect())\n        }\n        _ => Err(anyhow::anyhow!(\n            \"Review labels for forge {forge:?} are not implemented yet.\"\n        )),\n    }\n}\n\n/// Remove one label from a review.\npub async fn remove_review_label(\n    preferred_forge_user: &Option<crate::ForgeUser>,\n    forge_repo_info: &crate::forge::ForgeRepoInfo,\n    review_number: usize,\n    label: &str,\n    storage: &but_forge_storage::Controller,\n) -> Result<()> {\n    let crate::forge::ForgeRepoInfo {\n        forge, owner, repo, ..\n    } = forge_repo_info;\n    match forge {\n        ForgeName::GitHub => {","sourceCodeStart":1327,"sourceCodeEnd":1363,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-forge/src/review.rs#L1327-L1363","documentation":"The add-labels-to-review function implements only GitHub; any other `ForgeName` reaches the wildcard `_` arm which returns this anyhow error. It is a deliberate 'not implemented yet' guard for that forge, not a network or auth problem.","triggerScenarios":"Calling the add-review-labels function with `forge` other than `ForgeName::GitHub` — e.g. attempting to add a label to a GitLab merge request or Bitbucket pull request through this API.","commonSituations":"Users of GitLab/Bitbucket projects try to tag a review with labels in the UI; automation scripts call the label API without checking the forge type; a project's forge is misdetected so a GitHub repo takes the unimplemented path.","solutions":["Implement the `_` arm for the missing forge by delegating to that forge's add-label API, mirroring the GitHub branch.","In the caller, check `forge == ForgeName::GitHub` before offering/invoking label addition and disable the feature for other forges.","If the repo is really on GitHub, fix whatever caused the wrong ForgeName to reach this function."],"exampleFix":"// before\nadd_review_labels(forge, review_number, labels, storage).await?;\n\n// after\nensure!(forge == ForgeName::GitHub, \"Adding review labels is only supported on GitHub\");\nadd_review_labels(forge, review_number, labels, storage).await?;","handlingStrategy":"validation","validationCode":"// Rust: gate the mutation on forge support\nfn supports_review_labels(forge: ForgeName) -> bool {\n    matches!(forge, ForgeName::GitHub)\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = add_review_labels(forge, review_number, labels, storage).await {\n    if e.to_string().contains(\"not implemented\") {\n        // show 'labels not supported on this forge' instead of a raw error\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["Disable label-add actions for non-GitHub projects in the UI","Prefer explicit per-forge match arms over wildcard `_` to catch missing implementations at compile time","Expose a per-forge capability flag so callers can check support before mutating"],"tags":["unsupported-forge","labels","feature-not-implemented","rust"],"backgroundTag":"unsupported-operation","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}