{"record":{"id":"5891f97714666cda","repo":"astrid-runtime/astrid","slug":"invalid-github-url-format-expected-github-com-org","errorCode":null,"errorMessage":"Invalid GitHub URL format. Expected github.com/org/repo or @org/repo","messagePattern":"Invalid GitHub URL format\\. Expected github\\.com/org/repo or @org/repo","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install.rs","lineNumber":318,"sourceCode":"\n/// Install from a GitHub source, returning the concrete ref that was\n/// actually resolved and fetched (`Some` on the release-asset path). The\n/// clone-and-build fallback returns `None` — there is no single release\n/// tag it resolved (it builds from whatever `--depth 1` HEAD it cloned).\nasync fn install_from_github(\n    url: &str,\n    name_hint: Option<&str>,\n    version: Option<&str>,\n    tag: Option<&str>,\n    context: InstallContext<'_>,\n) -> anyhow::Result<(Vec<InstalledCapsuleOutcome>, Option<String>)> {\n    // Authenticated when a token is present so release resolution isn't\n    // throttled at the anonymous 60/hr limit mid-distro (see\n    // `github_api_client`).\n    let client = github_api_client()?;\n\n    let (org, repo) = extract_github_org_repo(url).ok_or_else(|| {\n        anyhow::anyhow!(\"Invalid GitHub URL format. Expected github.com/org/repo or @org/repo\")\n    })?;\n\n    // Whether the caller pinned a concrete release. A pin is a hard\n    // contract: if it cannot be honored we fail loudly rather than build\n    // HEAD, which would install something other than what was pinned and\n    // break the reproducibility the pin exists to guarantee.\n    let pinned = version.is_some() || tag.is_some();\n\n    // Priority 1: download packed `.capsule` archive(s) from the release\n    // resolved by version/tag (or latest when unpinned). Each archive\n    // contains everything an install needs (WASM, manifest, bundled WIT\n    // definitions). The ref resolved here is the *actually resolved* tag —\n    // the single source of truth threaded into the lock; we never silently\n    // fall back to `releases/latest` when a version/tag is pinned.\n    match resolve_github_ref(&client, org, repo, version, tag).await {\n        Ok(resolved_ref) => {\n            // Fetch the resolved release's assets. Build the URL via\n            // `release_tag_url` so a tag containing `/` is percent-encoded as","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install.rs#L300-L336","documentation":"Raised in install_from_github when extract_github_org_repo cannot derive an (org, repo) pair from the provided URL. The installer accepts github.com/org/repo style URLs or @org/repo shorthand; anything else fails before any network request.","triggerScenarios":"Passing a bare repo name ('myrepo'), a full https:// prefix the extractor doesn't handle, a git SSH URL (git@github.com:org/repo), or a URL with extra path segments the parser rejects.","commonSituations":"Copy-pasting the clone URL (https://github.com/org/repo.git or SSH form) instead of the supported formats, or passing just the repo slug from memory.","solutions":["Use the @org/repo shorthand form","Or use github.com/org/repo without scheme or .git suffix","Strip https://, git@, trailing .git, and extra path segments from the URL"],"exampleFix":"// before\n--from git@github.com:org/repo.git\n// after\n--from @org/repo","handlingStrategy":"validation","validationCode":"fn is_installable_github_ref(s: &str) -> bool {\n    s.starts_with(\"@\") && s[1..].split('/').count() == 2\n        || s.starts_with(\"github.com/\") && s[\"github.com/\".len()..].split('/').count() == 2\n}","typeGuard":"fn parse_org_repo(s: &str) -> Option<(String, String)> {\n    let rest = s.strip_prefix(\"@\").or_else(|| s.strip_prefix(\"github.com/\"))?;\n    let mut it = rest.split('/');\n    Some((it.next()?.to_string(), it.next()?.to_string()))\n}","tryCatchPattern":"match install_from_github(url).await { Err(e) if e.to_string().contains(\"Invalid GitHub URL format\") => { eprintln!(\"use @org/repo or github.com/org/repo\"); std::process::exit(2) }, other => other }","preventionTips":["Normalize inputs to @org/repo before invoking install","Strip schemes, git@ prefixes, .git suffixes, and extra path segments","Validate the org/repo shape in shell wrappers that build the CLI invocation"],"tags":["cli","url","github"],"backgroundTag":"invalid-url-format","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}