{"record":{"id":"1e806f401e6d0394","repo":"windmill-labs/windmill","slug":"expected-url-field","errorCode":null,"errorMessage":"Expected `url` field","messagePattern":"Expected `url` field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"backend/parsers/windmill-parser-yaml/src/lib.rs","lineNumber":677,"sourceCode":"                vars_location,\n                ansible_cfg,\n                install_requirements,\n            });\n        }\n    }\n    return None;\n}\n\nfn parse_git_repo(r: &Yaml) -> anyhow::Result<GitRepo> {\n    let Yaml::Hash(repo) = r else {\n        return Err(anyhow!(\"Should be a Map\"));\n    };\n\n    let url = repo\n        .get(&Yaml::String(\"url\".to_string()))\n        .and_then(|v| v.as_str())\n        .map(|s| s.to_string())\n        .ok_or(anyhow!(\"Expected `url` field\"))?;\n\n    let target_path = repo\n        .get(&Yaml::String(\"target\".to_string()))\n        .and_then(|v| v.as_str())\n        .map(|s| s.to_string())\n        .ok_or(anyhow!(\n            \"Expected `target` field (target directory for cloning the repo)\"\n        ))?;\n\n    let branch = repo\n        .get(&Yaml::String(\"branch\".to_string()))\n        .and_then(|v| v.as_str())\n        .map(|s| s.to_string());\n\n    let commit = repo\n        .get(&Yaml::String(\"commit\".to_string()))\n        .and_then(|v| v.as_str())\n        .map(|s| s.to_string());","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/parsers/windmill-parser-yaml/src/lib.rs#L659-L695","documentation":"parse_git_repo throws this when a repo map in `git_repos` has no string `url` key. The url is mandatory because it identifies the repository to clone; the parser uses `.ok_or` after looking up the key and calling `as_str()`, so both a missing key and a non-string url value produce this error.","triggerScenarios":"A git_repos entry map lacks the `url` key entirely, or its value is a non-string YAML type (integer, boolean, nested map, null) so `as_str()` returns None.","commonSituations":"Typos (`uri:`, `repo:`, `repository:`); forgetting the key when only writing `target`/`branch`; quoting mistakes leaving the value as another type; the URL value accidentally unindented to a sibling key.","solutions":["Add a `url` key with the git clone URL string to each repo entry","Ensure the url value is a plain/quoted string, not a number or nested structure","Fix key-name typos so the key is exactly `url`","Verify indentation places `url` under the correct repo list item"],"exampleFix":"# before\ngit_repos:\n  - target: repo\n\n# after\ngit_repos:\n  - url: https://github.com/org/repo.git\n    target: repo","handlingStrategy":"validation","validationCode":"fn require_url(repo: &serde_yaml::Mapping) -> Result<&str, String> {\n    repo.get(serde_yaml::Value::String(\"url\".into()))\n        .and_then(|v| v.as_str())\n        .ok_or_else(|| \"repo entry requires a string `url` field\".to_string())\n}","typeGuard":"fn has_string_field(v: &Yaml, key: &str) -> bool {\n    matches!(v, Yaml::Hash(m) if matches!(m.get(&Yaml::String(key.into())), Some(Yaml::String(_))))\n}","tryCatchPattern":null,"preventionTips":["Check the key is exactly `url`, not uri/repo/repository","Ensure the value is a string, not a number or nested structure","Keep `url` indented under the correct repo list item"],"tags":["yaml","ansible","git","parser"],"backgroundTag":"missing-required-argument","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}