chore - Add pydantic lib to type checking (#9086)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Ray Myers
2025-06-26 13:31:41 -05:00
committed by GitHub
parent 612bc3fa60
commit 94fe052561
27 changed files with 94 additions and 80 deletions

View File

@@ -66,7 +66,9 @@ class GitLabService(BaseGitService, GitService):
Retrieve the GitLab Token to construct the headers
"""
if not self.token:
self.token = await self.get_latest_token()
latest_token = await self.get_latest_token()
if latest_token:
self.token = latest_token
return {
'Authorization': f'Bearer {self.token.get_secret_value()}',
@@ -185,7 +187,7 @@ class GitLabService(BaseGitService, GitService):
return User(
id=str(response.get('id', '')),
login=response.get('username'),
login=response.get('username'), # type: ignore[call-arg]
avatar_url=avatar_url,
name=response.get('name'),
email=response.get('email'),
@@ -258,8 +260,8 @@ class GitLabService(BaseGitService, GitService):
all_repos = all_repos[:MAX_REPOS]
return [
Repository(
id=str(repo.get('id')),
full_name=repo.get('path_with_namespace'),
id=str(repo.get('id')), # type: ignore[arg-type]
full_name=repo.get('path_with_namespace'), # type: ignore[arg-type]
stargazers_count=repo.get('star_count'),
git_provider=ProviderType.GITLAB,
is_public=repo.get('visibility') == 'public',