From ef1d0f2d24a70085d41cf7ed633f250f269eb516 Mon Sep 17 00:00:00 2001 From: codegen-bot Date: Fri, 21 Feb 2025 10:06:03 -0800 Subject: [PATCH] fix: remove secrets_ prefix from github token envvar key --- src/codegen/cli/auth/session.py | 2 +- src/codegen/configs/models/secrets.py | 2 +- src/codegen/runner/clients/codebase_client.py | 2 +- tests/integration/extension/test_github.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/codegen/cli/auth/session.py b/src/codegen/cli/auth/session.py index 38efa8a3c..d06454330 100644 --- a/src/codegen/cli/auth/session.py +++ b/src/codegen/cli/auth/session.py @@ -65,7 +65,7 @@ def _validate(self) -> None: if git_token is None: rich.print("\n[bold yellow]Warning:[/bold yellow] GitHub token not found") rich.print("To enable full functionality, please set your GitHub token:") - rich.print(format_command("export SECRETS_GITHUB_TOKEN=")) + rich.print(format_command("export GITHUB_TOKEN=")) rich.print("Or pass in as a parameter:") rich.print(format_command("codegen init --token ")) diff --git a/src/codegen/configs/models/secrets.py b/src/codegen/configs/models/secrets.py index 12612b25f..d0e9e3a77 100644 --- a/src/codegen/configs/models/secrets.py +++ b/src/codegen/configs/models/secrets.py @@ -4,7 +4,7 @@ class SecretsConfig(BaseConfig): """Configuration for various API secrets and tokens. - Loads from environment variables with the SECRETS_ prefix. + Loads from environment variables. Falls back to .env file for missing values. """ diff --git a/src/codegen/runner/clients/codebase_client.py b/src/codegen/runner/clients/codebase_client.py index b00035c87..5f0e56a83 100644 --- a/src/codegen/runner/clients/codebase_client.py +++ b/src/codegen/runner/clients/codebase_client.py @@ -31,7 +31,7 @@ def _get_envs(self) -> dict: "REPOSITORY_PATH": str(self.repo_config.repo_path), } if self.git_access_token is not None: - codebase_envs["SECRETS_GITHUB_TOKEN"] = self.git_access_token + codebase_envs["GITHUB_TOKEN"] = self.git_access_token envs.update(codebase_envs) return envs diff --git a/tests/integration/extension/test_github.py b/tests/integration/extension/test_github.py index 8dc57300e..7f050bba7 100644 --- a/tests/integration/extension/test_github.py +++ b/tests/integration/extension/test_github.py @@ -12,9 +12,9 @@ @pytest.fixture def client() -> LinearClient: """Create a Linear client for testing.""" - token = os.getenv("SECRETS_GITHUB_TOKEN") + token = os.getenv("GITHUB_TOKEN") if not token: - pytest.skip("SECRETS_GITHUB_TOKEN environment variable not set") + pytest.skip("GITHUB_TOKEN environment variable not set") codebase = Codebase.from_repo("codegen-sh/Kevin-s-Adventure-Game") return codebase