{"record":{"id":"4b0c122b958692e3","repo":"unslothai/unsloth","slug":"at-least-one-repo-is-required","errorCode":null,"errorMessage":"At least one repo is required","messagePattern":"At least one repo is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/config.py","lineNumber":63,"sourceCode":"            r = r.strip()\n            if not r:\n                continue\n            if r.count(\"/\") != 1 or not all(r.split(\"/\")):\n                raise ValueError(f\"Each repo must be `owner/name`; got {r!r}\")\n            out.append(r)\n        return out\n\n    @field_validator(\"item_types\")\n    @classmethod\n    def _validate_item_types(cls, v: list[str]) -> list[str]:\n        if not v:\n            raise ValueError(\"item_types must not be empty\")\n        return list(dict.fromkeys(v))\n\n    @model_validator(mode = \"after\")\n    def _ensure_repos(self) -> \"GitHubRepoSeedSource\":\n        if not self.repos:\n            raise ValueError(\"At least one repo is required\")\n        return self\n","sourceCodeStart":45,"sourceCodeEnd":65,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/plugins/data-designer-github-repo-seed/src/data_designer_github_repo_seed/config.py#L45-L65","documentation":"Model validator _ensure_repos on GitHubRepoSeedSource requiring at least one valid repo after field validation. Because the repos field validator skips blank/whitespace entries, a list of empty strings (or a list that trims down to nothing) passes field validation but fails here — the seed source must point at some repository.","triggerScenarios":"Passing repos = [''], repos = ['   '], or repos = [] in the recipe config. Each blank entry is skipped by _validate_repos, leaving self.repos empty, which trips this model-level check.","commonSituations":"YAML config where the repos entry was commented out but the list syntax remains; environment-driven configs where the repo variable is empty; templating that renders a placeholder into an empty string.","solutions":["Provide at least one non-empty 'owner/name' entry in repos.","If the value comes from an env var or template, check it actually renders (e.g. echo \"${REPO_SLUG}\") before running the seed job.","Remove placeholder empty strings from the list."],"exampleFix":"# before\nrepos = [\"\"]\n\n# after\nrepos = [\"owner/name\"]","handlingStrategy":"validation","validationCode":"def has_real_repos(repos: list[str] | None) -> bool:\n    return bool([r for r in (repos or []) if r.strip()])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember blank entries are silently skipped by field validation — the model-level check is what catches all-blank lists.","Render then inspect generated configs (e.g. yq '.repos') before submitting scrape jobs."],"tags":["pydantic","github","config","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}