{"record":{"id":"51051f27188ddb33","repo":"can1357/oh-my-pi","slug":"no-github-access-configured-set-github-token-or","errorCode":null,"errorMessage":"no GitHub access configured: set GITHUB_TOKEN, or set ROBOMP_GH_PROXY_URL + ROBOMP_GH_PROXY_HMAC_KEY to use gh-proxy.","messagePattern":"no GitHub access configured: set GITHUB_TOKEN, or set ROBOMP_GH_PROXY_URL \\+ ROBOMP_GH_PROXY_HMAC_KEY to use gh-proxy\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/robomp/src/config.py","lineNumber":251,"sourceCode":"          the isolation goal).\n        - Proxy URL set but no HMAC key (or vice versa) → reject (gh-proxy\n          would either be unauthenticated or unreachable).\n        - Neither set → also reject; SOMETHING needs to talk to GitHub.\n        \"\"\"\n        has_token = self.github_token is not None\n        has_url = bool(self.gh_proxy_url)\n        has_key = self.gh_proxy_hmac_key is not None\n        if has_token and has_url:\n            raise ValueError(\n                \"GITHUB_TOKEN and ROBOMP_GH_PROXY_URL are mutually exclusive — \"\n                \"set ONE to choose between direct-PAT and gh-proxy modes.\"\n            )\n        if has_url != has_key:\n            raise ValueError(\n                \"ROBOMP_GH_PROXY_URL and ROBOMP_GH_PROXY_HMAC_KEY must both be set together (or both empty).\"\n            )\n        if not has_token and not has_url:\n            raise ValueError(\n                \"no GitHub access configured: set GITHUB_TOKEN, or set \"\n                \"ROBOMP_GH_PROXY_URL + ROBOMP_GH_PROXY_HMAC_KEY to use gh-proxy.\"\n            )\n        return self\n\n    @field_validator(\"repo_allowlist_raw\", mode=\"before\")\n    @classmethod\n    def _coerce_allowlist(cls, v: object) -> str:\n        if v is None:\n            return \"\"\n        if isinstance(v, str):\n            return v\n        if isinstance(v, (list, tuple)):\n            return \",\".join(str(item) for item in v)\n        return str(v)\n\n    @property\n    def repo_allowlist(self) -> frozenset[str]:","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/python/robomp/src/config.py#L233-L269","documentation":"As the final check in _validate_proxy_or_pat(), if neither a direct PAT (GITHUB_TOKEN) nor the gh-proxy pair (ROBOMP_GH_PROXY_URL + ROBOMP_GH_PROXY_HMAC_KEY) is configured, Settings validation fails: there would be no way to authenticate any GitHub request.","triggerScenarios":"Constructing Settings with github_token None, gh_proxy_url empty, and gh_proxy_hmac_key None — e.g. running the CLI in a fresh environment with no robomp env vars at all.","commonSituations":"First-time setup without the quickstart .env; .env file not loaded (wrong working directory, dotenv not enabled); CI job missing secrets; variables defined under different names than documented.","solutions":["Set GITHUB_TOKEN for direct-PAT mode, or both ROBOMP_GH_PROXY_URL and ROBOMP_GH_PROXY_HMAC_KEY for proxy mode.","Confirm the .env file exists and is actually loaded (correct path / dotenv loading).","In containerized deployments, verify secrets are injected into the orchestrator container.","Double-check variable names against the documentation (exact spelling)."],"exampleFix":"// before (empty env)\n# no GitHub-related variables\n// after (proxy mode)\nROBOMP_GH_PROXY_URL=http://gh-proxy:8080\nROBOMP_GH_PROXY_HMAC_KEY=<key>","handlingStrategy":"validation","validationCode":"import os\nif not os.environ.get(\"GITHUB_TOKEN\") and not (os.environ.get(\"ROBOMP_GH_PROXY_URL\") and os.environ.get(\"ROBOMP_GH_PROXY_HMAC_KEY\")):\n    raise SystemExit(\"no GitHub access configured: set GITHUB_TOKEN, or the gh-proxy URL+HMAC pair\")","typeGuard":"def github_access_configured(env: dict) -> bool:\n    return bool(env.get(\"GITHUB_TOKEN\")) or (bool(env.get(\"ROBOMP_GH_PROXY_URL\")) and bool(env.get(\"ROBOMP_GH_PROXY_HMAC_KEY\")))","tryCatchPattern":"try:\n    cfg = Settings(_env_file=\".env\")\nexcept ValidationError as exc:\n    sys.exit(f\"configuration error: {exc}\")","preventionTips":["Copy the quickstart .env on first setup before running the CLI.","Verify the .env is actually loaded (correct path, dotenv enabled, correct working directory).","In CI, mark GitHub-related secrets as required for the job.","Add a startup preflight that fails fast with a clear message when access is unconfigured."],"tags":["python","configuration","env-var","github","missing-env-var"],"backgroundTag":"missing-env-var","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}