{"record":{"id":"40b926b38df7d49b","repo":"zed-industries/zed","slug":"failed-to-build-commit-permalink","errorCode":null,"errorMessage":"failed to build commit permalink","messagePattern":"failed to build commit permalink","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/git_hosting_providers/src/providers/azure.rs","lineNumber":128,"sourceCode":"    fn parse_remote_url(&self, url: &str) -> Option<ParsedGitRemote> {\n        let url = RemoteUrl::from_str(url).ok()?;\n\n        self.parse_dev_azure_com_url(&url)\n            .or_else(|| self.parse_visualstudio_com_url(&url))\n    }\n\n    fn build_commit_permalink(\n        &self,\n        remote: &ParsedGitRemote,\n        params: BuildCommitPermalinkParams,\n    ) -> Url {\n        let BuildCommitPermalinkParams { sha } = params;\n        let ParsedGitRemote { owner, repo } = remote;\n\n        let mut url = self\n            .base_url()\n            .join(&format!(\"{owner}/_git/{repo}/commit/{sha}\"))\n            .expect(\"failed to build commit permalink\");\n        url.set_query(None);\n        url\n    }\n\n    fn build_permalink(&self, remote: ParsedGitRemote, params: BuildPermalinkParams) -> Url {\n        let ParsedGitRemote { owner, repo } = remote;\n        let BuildPermalinkParams {\n            sha,\n            path,\n            selection,\n        } = params;\n\n        let mut permalink = self\n            .base_url()\n            .join(&format!(\"{owner}/_git/{repo}\"))\n            .expect(\"failed to build permalink\");\n\n        let mut query = format!(\"path=/{path}&version=GC{sha}\");","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/git_hosting_providers/src/providers/azure.rs#L110-L146","documentation":"A URL-construction guard in the Azure DevOps provider: build_commit_permalink joins '{owner}/_git/{repo}/commit/{sha}' onto the configured base_url and expects Url::join to succeed. join fails when the base URL cannot be a base (e.g. a malformed or non-hierarchical base) or the joined segments make the result invalid — so the inputs at fault are the provider's base_url plus owner/repo/sha strings containing characters that break URL parsing (spaces, control chars, '/').","triggerScenarios":"Thrown at crates/git_hosting_providers/src/providers/azure.rs:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return Option<Url> (or Result) from build_commit_permalink and let callers skip permalinks that cannot be built","Percent-encode owner/repo/sha segments with urlencoding before joining","Validate the base_url is a valid hierarchical URL when the provider is constructed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}