@@ -60,7 +60,7 @@ class Repo(BaseModel):
6060 def from_json (cls , json_str : str ) -> "Repo" :
6161 return cls .model_validate (json .loads (json_str ))
6262
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 ] :
6464 base_path = BASE_TMP_DIR / ("extra_repos" if self .extra_repo else "oss_repos" ) / name
6565 base_path .mkdir (exist_ok = True , parents = True )
6666 url = self .url
@@ -71,11 +71,12 @@ def to_op(self, name: str, token: str | None) -> LocalRepoOperator:
7171 # if REPO_ID_TO_URL is not set, we probably don't need auth. this is assuming that for
7272 # OSS repos, we don't need to pull any private repos.
7373 if not REPO_ID_TO_URL :
74- return
74+ return ( None , "Could not create repo operator - skipping test" )
7575
7676 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 ." )
7878 if '[credential "https://github.codegen.app"]' not in (Path .home () / ".gitconfig" ).read_text ():
79+ print ("Setting up auth using the github cli" )
7980 os .system ("gh auth login -h github.codegen.app" )
8081 os .system ("gh auth setup-git -h github.codegen.app" )
8182 return LocalRepoOperator .create_from_commit (str (base_path ), self .default_branch , self .commit , url )
0 commit comments