gitbutlerapp/gitbutler · error
Merge status for forge
Error message
Merge status for forge {forge:?} is not implemented yet. What it means
Fetching merge status (mergeability/mergeable_state) for a review is implemented only for GitHub in but-forge; other forges return this error. GitHub's mergeable_state vocabulary is forge-specific, so the library refuses to fabricate a value for forges it cannot map.
Solutions
- Query merge status only for GitHub reviews; leave mergeable_state unset (None) for other forges as the GitHub arm already does for unknown states.
- Catch this error and degrade gracefully to an 'unknown' merge status in the UI.
- Implement a merge-status mapping for the target forge in crates/but-forge/src/review.rs.
Example fix
// before
let status = forge::review_merge_status(forge, review_number).await?;
// after
let mergeable_state = match forge::review_merge_status(forge, review_number) {
Ok(s) => Some(s),
Err(_) => None, // non-GitHub forges: merge status not implemented yet
}; Defensive patterns
Strategy: try-catch
Validate before calling
const supportsMergeStatus = forge === 'github';
Type guard
const isGitHub = (forge: ForgeName): forge is 'github' => forge === 'github';
Try / catch
try { mergeable = await fetchMergeStatus(...) } catch (e) { if (String(e).includes('not implemented yet')) { mergeable = null; /* render unknown */ } else { throw e; } } Prevention
- Treat merge status as optional UI data; default to 'unknown' on failure
- Query merge status only for GitHub reviews
- Do not let missing mergeability block review display for other forges
When it happens
Trigger: Calling the review merge-status function with a repository whose ForgeName is GitLab, Bitbucket, or Azure.
Common situations: The UI loads mergeability for a GitLab merge request, Bitbucket PR, or Azure PR, or a caller queries merge state for a review on a forge whose merge-status mapping has not been implemented yet.
Related errors
- Reactions for forge are not implemented yet.
- Review thread replies for forge
- Review thread resolution for forge
- Azure is unsupported at the minute. Sorry 😞.
- Branch ` ` is not part of the current workspace
AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18).
Data as JSON: /api/errors/180ce139c3e84476.
Report an issue: GitHub.
Appendix: source
Thrown at crates/but-forge/src/review.rs:2313
}
ForgeName::Bitbucket => {
// Bitbucket has no dedicated mergeability endpoint; derive a basic
// status from the PR's state and comment count.
let preferred_account = preferred_forge_user
.as_ref()
.and_then(|user| user.bitbucket());
let pr = but_bitbucket::pr::get(preferred_account, owner, repo, review_number, storage)
.await?;
Ok(ReviewMergeStatus {
is_mergeable: pr.is_open(),
// Bitbucket's state strings ("OPEN"/"MERGED"/…) don't map to the
// forge-agnostic mergeable_state vocabulary the UI understands, so
// leave it unset rather than feed a value it can't interpret.
mergeable_state: None,
comments_count: pr.comment_count,
})
}
_ => Err(anyhow::anyhow!(
"Merge status for forge {forge:?} is not implemented yet."
)),
}
}
/// Get a specific review (e.g. pull request) for a given forge repository
///
/// The resulting review will be cached.
pub fn get_forge_review(
preferred_forge_user: &Option<crate::ForgeUser>,
forge_repo_info: &crate::forge::ForgeRepoInfo,
review_number: usize,
db: &mut but_db::DbHandle,
storage: &but_forge_storage::Controller,
) -> Result<ForgeReview> {
let preferred_forge_user = preferred_forge_user.clone();
let forge_repo_info = forge_repo_info.clone();
let storage = storage.clone();View on GitHub (pinned to 58e5313667)