2626class GitRepoClient :
2727 """Wrapper around PyGithub's Remote Repository."""
2828
29- repo : RepoConfig
29+ repo_config : RepoConfig
3030 github_type : GithubType = GithubType .GithubEnterprise
3131 gh_client : GithubClientType
3232 read_client : Repository
3333 access_scope : GithubScope
3434 __write_client : Repository | None # Will not be initialized if access scope is read-only
3535
3636 def __init__ (self , repo_config : RepoConfig , github_type : GithubType = GithubType .GithubEnterprise , access_scope : GithubScope = GithubScope .READ ) -> None :
37- self .repo = repo_config
37+ self .repo_config = repo_config
3838 self .github_type = github_type
39- self .gh_client = GithubClientFactory .create_from_repo (self .repo , github_type )
39+ self .gh_client = GithubClientFactory .create_from_repo (self .repo_config , github_type )
4040 self .read_client = self ._create_client (GithubScope .READ )
4141 self .__write_client = self ._create_client (GithubScope .WRITE ) if access_scope == GithubScope .WRITE else None
4242 self .access_scope = access_scope
4343
4444 def _create_client (self , github_scope : GithubScope = GithubScope .READ ) -> Repository :
45- client = self .gh_client .get_repo_by_full_name (self .repo .full_name , github_scope = github_scope )
45+ client = self .gh_client .get_repo_by_full_name (self .repo_config .full_name , github_scope = github_scope )
4646 if not client :
47- msg = f"Repo { self .repo .full_name } not found in { self .github_type .value } !"
47+ msg = f"Repo { self .repo_config .full_name } not found in { self .github_type .value } !"
4848 raise ValueError (msg )
4949 return client
5050
@@ -61,7 +61,7 @@ def _write_client(self) -> Repository:
6161
6262 @property
6363 def id (self ) -> int :
64- return self .repo .id
64+ return self .repo_config .id
6565
6666 @property
6767 def default_branch (self ) -> str :
@@ -160,7 +160,7 @@ def get_pull_by_branch_and_state(
160160 if not base_branch_name :
161161 base_branch_name = self .default_branch
162162
163- head_branch_name = f"{ self .repo .organization_name } :{ head_branch_name } "
163+ head_branch_name = f"{ self .repo_config .organization_name } :{ head_branch_name } "
164164
165165 # retrieve all pulls ordered by created descending
166166 prs = self .read_client .get_pulls (base = base_branch_name , head = head_branch_name , state = state , sort = "created" , direction = "desc" )
0 commit comments