gitbutlerapp/gitbutler · warning

Fetching repo info for forge

Error message

Fetching repo info for forge {:?} is not implemented yet.

What it means

get_repo_info in crates/but-forge/src/repo.rs implements repository info fetching for GitHub, GitLab, and Bitbucket. When the forge is Azure (or any other unimplemented variant), it returns this error.

Solutions

  1. Use a repository hosted on a supported forge (GitHub, GitLab, Bitbucket)
  2. Add a ForgeName::Azure arm that delegates to a new but_azure repo-info fetcher if Azure support is needed
  3. Check forge detection of the remote URL if Azure was not expected
Defensive patterns

Strategy: validation

Validate before calling

if forge_repo_info.forge == ForgeName::Azure {
    return Err("Repo info fetching is not supported for Azure DevOps repositories");
}

Try / catch

match get_repo_info(...) {
    Ok(info) => info,
    Err(e) if e.to_string().contains("not implemented") => return Err(user_facing_unsupported_forge_error()),
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling get_repo_info with a ForgeRepoInfo whose forge is ForgeName::Azure; the public API call is made against a repository hosted on an unsupported forge.

Common situations: Project remote is on Azure DevOps; user configured a remote URL for an unsupported host; forge detection produced Azure from the remote URL.

Related errors


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/bed5190e41b9a429. Report an issue: GitHub.

Appendix: source

Thrown at crates/but-forge/src/repo.rs:37

            let gh = but_github::GitHubClient::from_storage(storage, preferred_account)?;
            gh.get_repo(owner, repo).await.map(RepoInfo::from)
        }
        ForgeName::GitLab => {
            let preferred_account = preferred_forge_user.as_ref().and_then(|user| user.gitlab());
            let project_id = but_gitlab::GitLabProjectId::new(owner, repo);
            but_gitlab::fetch_project(preferred_account, project_id, storage)
                .await
                .map(RepoInfo::from)
        }
        ForgeName::Bitbucket => {
            let preferred_account = preferred_forge_user
                .as_ref()
                .and_then(|user| user.bitbucket());
            but_bitbucket::fetch_repo(preferred_account, owner, repo, storage)
                .await
                .map(RepoInfo::from)
        }
        ForgeName::Azure => Err(anyhow::anyhow!(
            "Fetching repo info for forge {:?} is not implemented yet.",
            forge_repo_info.forge
        )),
    }
}

#[derive(Debug, Clone, Serialize)]
#[cfg_attr(feature = "export-schema", derive(schemars::JsonSchema))]
#[serde(rename_all = "camelCase")]
pub struct RepoInfo {
    pub permissions: Option<RepoPermissions>,
    pub fork: bool,
    /// Whether the repo is visible only to people granted access.
    /// `None` when the forge does not report it — Azure, or a GitLab token
    /// without the scope to read project metadata.
    pub private: Option<bool>,
    /// Whether the repo deletes the source branch after a PR is merged
    /// (GitHub's per-repo "Automatically delete head branches" setting).

View on GitHub (pinned to 58e5313667)