{"record":{"id":"90ce86eda70ccc50","repo":"zed-industries/zed","slug":"build-ids-may-only-contain-lowercase-letters-numb","errorCode":null,"errorMessage":"build ids may only contain lowercase letters, numbers, '.', '_', and '-'","messagePattern":"build ids may only contain lowercase letters, numbers, '\\.', '_', and '-'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"crates/eval_cli/zed_eval/builds.py","lineNumber":11,"sourceCode":"from __future__ import annotations\n\nimport argparse\nfrom typing import Any\n\nfrom . import source\n\n\ndef validate_build_id(build_id: str | None) -> None:\n    if build_id and source.sanitize_namespace(build_id) != build_id:\n        raise ValueError(\n            \"build ids may only contain lowercase letters, numbers, '.', '_', and '-'\"\n        )\n\n\ndef prepare_build_request(\n    *,\n    base_sha: str | None,\n    patch_path: str | None,\n    build_id: str | None,\n    allow_untracked: bool,\n    require_clean: bool,\n    repo_url: str | None,\n    clean_source: bool = False,\n    source_label: str | None = None,\n    pre_resolved_base_sha: str | None = None,\n) -> dict[str, Any]:\n    validate_build_id(build_id)\n    source_info, patch = source.prepare_build_source(","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/eval_cli/zed_eval/builds.py#L1-L29","documentation":"validate_build_id() rejects any build id that doesn't survive source.sanitize_namespace() unchanged: only lowercase letters, digits, '.', '_' and '-' are allowed. The restriction exists because build ids feed into namespace labels (e.g. Modal namespaces) with a limited charset; anything that sanitizes differently (uppercase, spaces, slashes) would silently split a run's identity from its label.","triggerScenarios":"Passing a build id containing uppercase letters, spaces, or other punctuation (\"Zed Build/2024\"); ids auto-derived from branch names with '/' or uppercase; timestamp ids using 'T' and ':'.","commonSituations":"Deriving build ids from git branch names (feature/Login-Fix); pasting human-readable labels; CI run identifiers with ISO-8601 punctuation.","solutions":["Lowercase the id and map disallowed characters to '-' or '_' before passing it","Slugify derived ids: `echo \"$branch\" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9._-' '-'`","If the id looks valid, check for invisible leading/trailing whitespace"],"exampleFix":"# before\nvalidate_build_id(\"Feature/Login-Fix\")   # ValueError\n\n# after\nvalidate_build_id(\"feature-login-fix\")","handlingStrategy":"validation","validationCode":"import re\nBUILD_ID_RE = re.compile(r\"^[a-z0-9._-]+$\")\nif build_id and not BUILD_ID_RE.fullmatch(build_id):\n    raise SystemExit(\"build id must match [a-z0-9._-]+\")","typeGuard":"import re\n\ndef is_valid_build_id(build_id):\n    return re.fullmatch(r\"[a-z0-9._-]+\", build_id) is not None","tryCatchPattern":"try:\n    validate_build_id(build_id)\nexcept ValueError:\n    import re\n    build_id = re.sub(r\"[^a-z0-9._-]\", \"-\", build_id.lower())\n    validate_build_id(build_id)","preventionTips":["Slugify branch names before using them as build ids","Keep a shared helper that lowercases and replaces disallowed chars","Assert validity in tests for id-generating code"],"tags":["python","validation","naming","modal"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}