{"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":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/but-forge/src/review.rs","lineNumber":1147,"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":1129,"sourceCodeEnd":1165,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but-forge/src/review.rs#L1129-L1165","documentation":"`add_review_labels()` applies labels to a review through a per-forge dispatch and returns the resulting label set. Only GitHub is implemented (via `but_github::pr::add_labels`); GitLab, Bitbucket and Azure hit the wildcard arm and this error is returned without contacting the forge.","triggerScenarios":"Calling `add_review_labels` with a review on a GitLab/Bitbucket/Azure `ForgeRepoInfo` — e.g. the 'apply labels' action on a non-GitHub pull request or merge request. Note that listing labels is equally GitHub-only, so the mismatch surfaces at mutation time.","commonSituations":"Label pickers that let users commit label changes on any forge; automation reusing a GitHub-tested flow against GitLab MRs; SDK consumers discovering the forge-agnostic API and hitting single-forge coverage.","solutions":["Apply labels through the forge's native API or web UI for non-GitHub reviews.","Disable the 'add labels' action unless `forge == ForgeName::GitHub`.","Implement a `but_gitlab::`/`but_bitbucket::` add-labels backend and extend the match at crates/but-forge/src/review.rs:1139-1147."],"exampleFix":"// before\nadd_review_labels(&user, &info, number, &labels, &storage).await?;\n\n// after\nif !matches!(info.forge, ForgeName::GitHub) {\n    return Ok(Vec::new()); // adding labels is unsupported here; skip the action\n}\nadd_review_labels(&user, &info, number, &labels, &storage).await?;","handlingStrategy":"validation","validationCode":"use but_forge::forge::ForgeName;\n\nif !matches!(info.forge, ForgeName::GitHub) {\n    // disable the 'apply labels' action; do not call add_review_labels\n}","typeGuard":"fn review_labels_writable(forge: &but_forge::forge::ForgeName) -> bool {\n    matches!(forge, ForgeName::GitHub)\n}","tryCatchPattern":"match add_review_labels(&user, &info, number, &labels, &storage).await {\n    Ok(labels) => labels,\n    Err(e) if e.to_string().contains(\"not implemented yet\") => Vec::new(),\n    Err(e) => return Err(e),\n}","preventionTips":["Gate label mutations on the forge value, not on whether another label call happened to succeed — all label arms are GitHub-only.","Show 'unsupported on this forge' in the UI rather than surfacing the raw anyhow error.","Cover per-forge label coverage in tests so newly added backends stay in sync."],"tags":["rust","but-forge","labels","pull-request","github","not-implemented"],"backgroundTag":"not-implemented-for-platform","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}