5
5
from codegen .git .schemas .repo_config import RepoConfig
6
6
from codegen .runner .clients .server_client import LocalServerClient
7
7
from codegen .runner .models .apis import SANDBOX_SERVER_PORT
8
+ from codegen .shared .configs .session_configs import config
8
9
9
10
logger = logging .getLogger (__name__ )
10
11
@@ -22,15 +23,23 @@ def __init__(self, repo_config: RepoConfig, git_access_token: str | None, host:
22
23
self .git_access_token = git_access_token
23
24
super ().__init__ (server_path = RUNNER_SERVER_PATH , host = host , port = port )
24
25
25
- def _get_envs (self ):
26
+ def _get_envs (self ) -> dict :
26
27
envs = super ()._get_envs ()
27
- envs .update (
28
- {
29
- "CODEGEN_REPOSITORY__REPO_PATH" : self .repo_config .repo_path ,
30
- "CODEGEN_REPOSITORY__REPO_NAME" : self .repo_config .name ,
31
- "CODEGEN_REPOSITORY__FULL_NAME" : self .repo_config .full_name ,
32
- "CODEGEN_REPOSITORY__LANGUAGE" : self .repo_config .language .value ,
33
- "CODEGEN_SECRETS__GITHUB_TOKEN" : self .git_access_token ,
34
- }
35
- )
28
+ codebase_envs = {
29
+ "CODEGEN_REPOSITORY__REPO_PATH" : self .repo_config .repo_path ,
30
+ "CODEGEN_REPOSITORY__REPO_NAME" : self .repo_config .name ,
31
+ "CODEGEN_REPOSITORY__FULL_NAME" : self .repo_config .full_name ,
32
+ "CODEGEN_REPOSITORY__LANGUAGE" : self .repo_config .language .value ,
33
+ }
34
+ if self .git_access_token is not None :
35
+ codebase_envs ["CODEGEN_SECRETS__GITHUB_TOKEN" ] = self .git_access_token
36
+
37
+ envs .update (codebase_envs )
36
38
return envs
39
+
40
+
41
+ if __name__ == "__main__" :
42
+ test_config = RepoConfig .from_repo_path ("/Users/caroljung/git/codegen/codegen-agi" )
43
+ test_config .full_name = "codegen-sh/codegen-agi"
44
+ client = CodebaseClient (test_config , config .secrets .github_token )
45
+ print (client .healthcheck ())
0 commit comments