File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ class SandboxRunner:
28
28
codebase : CodebaseType
29
29
executor : SandboxExecutor
30
30
31
- def __init__ (self , repo_config : RepoConfig ) -> None :
31
+ def __init__ (self , repo_config : RepoConfig , op : RepoOperator | None = None ) -> None :
32
32
self .repo = repo_config
33
- self .op = RepoOperator (repo_config = self .repo , setup_option = SetupOption .PULL_OR_CLONE , bot_commit = True )
33
+ self .op = op or RepoOperator (repo_config = self .repo , setup_option = SetupOption .PULL_OR_CLONE , bot_commit = True )
34
34
self .commit = self .op .git_cli .head .commit
35
35
36
36
async def warmup (self ) -> None :
Original file line number Diff line number Diff line change 4
4
from fastapi import FastAPI
5
5
6
6
from codegen .git .configs .constants import CODEGEN_BOT_EMAIL , CODEGEN_BOT_NAME
7
+ from codegen .git .repo_operator .repo_operator import RepoOperator
8
+ from codegen .git .schemas .enums import SetupOption
7
9
from codegen .git .schemas .repo_config import RepoConfig
8
10
from codegen .runner .enums .warmup_state import WarmupState
9
11
from codegen .runner .models .apis import (
@@ -38,8 +40,9 @@ async def lifespan(server: FastAPI):
38
40
server_info = ServerInfo (repo_name = repo_config .full_name or repo_config .name )
39
41
40
42
# Set the bot email and username
43
+ op = RepoOperator (repo_config = repo_config , setup_option = SetupOption .SKIP , bot_commit = True )
44
+ runner = SandboxRunner (repo_config = repo_config , op = op )
41
45
logger .info (f"Configuring git user config to { CODEGEN_BOT_EMAIL } and { CODEGEN_BOT_NAME } " )
42
- runner = SandboxRunner (repo_config = repo_config )
43
46
runner .op .git_cli .git .config ("user.email" , CODEGEN_BOT_EMAIL )
44
47
runner .op .git_cli .git .config ("user.name" , CODEGEN_BOT_NAME )
45
48
You can’t perform that action at this time.
0 commit comments