@@ -60,7 +60,7 @@ class Repo(BaseModel):
60
60
def from_json (cls , json_str : str ) -> "Repo" :
61
61
return cls .model_validate (json .loads (json_str ))
62
62
63
- def to_op (self , name : str , token : str | None ) -> LocalRepoOperator :
63
+ def to_op (self , name : str , token : str | None ) -> LocalRepoOperator | tuple [ None , str | None ] :
64
64
base_path = BASE_TMP_DIR / ("extra_repos" if self .extra_repo else "oss_repos" ) / name
65
65
base_path .mkdir (exist_ok = True , parents = True )
66
66
url = self .url
@@ -71,11 +71,12 @@ def to_op(self, name: str, token: str | None) -> LocalRepoOperator:
71
71
# if REPO_ID_TO_URL is not set, we probably don't need auth. this is assuming that for
72
72
# OSS repos, we don't need to pull any private repos.
73
73
if not REPO_ID_TO_URL :
74
- return
74
+ return ( None , "Could not create repo operator - skipping test" )
75
75
76
76
if not which ("gh" ):
77
- raise RuntimeError ( "GitHub CLI (gh) is not installed. Please install it first." )
77
+ return ( None , "GitHub CLI (gh) is not installed. Please install it first. Skipping test ." )
78
78
if '[credential "https://github.codegen.app"]' not in (Path .home () / ".gitconfig" ).read_text ():
79
+ print ("Setting up auth using the github cli" )
79
80
os .system ("gh auth login -h github.codegen.app" )
80
81
os .system ("gh auth setup-git -h github.codegen.app" )
81
82
return LocalRepoOperator .create_from_commit (str (base_path ), self .default_branch , self .commit , url )
0 commit comments