mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 16:19:05 +08:00
chore: fix typos in comments, docstrings, and log messages (#14577)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Add a table for tracking output from maintainance scripts. These are basically migrations that are not sql centric.
|
||||
"""Add a table for tracking output from maintenance scripts. These are basically migrations that are not sql centric.
|
||||
Revision ID: 018
|
||||
Revises: 017
|
||||
Create Date: 2025-03-26 19:45:00.000
|
||||
|
||||
@@ -29,7 +29,7 @@ async def authenticate_github_user_id(auth_user_id: str) -> GitHubUser | None:
|
||||
|
||||
return None
|
||||
except: # noqa: E722
|
||||
logger.warning("GitHub user doens't have valid token")
|
||||
logger.warning("GitHub user doesn't have valid token")
|
||||
return None
|
||||
|
||||
|
||||
@@ -46,5 +46,5 @@ async def authenticate_github_user_token(access_token: str):
|
||||
|
||||
return None
|
||||
except: # noqa: E722
|
||||
logger.warning("GitHub user doens't have valid token")
|
||||
logger.warning("GitHub user doesn't have valid token")
|
||||
return None
|
||||
|
||||
@@ -198,7 +198,7 @@ class GitlabWebhookStore:
|
||||
|
||||
async def get_webhook_secret(self, webhook_uuid: str, user_id: str) -> str | None:
|
||||
"""
|
||||
Get's webhook secret given the webhook uuid and admin keycloak user id
|
||||
Gets webhook secret given the webhook uuid and admin keycloak user id
|
||||
"""
|
||||
async with a_session_maker() as session:
|
||||
query = (
|
||||
|
||||
@@ -644,7 +644,7 @@ class LiteLlmManager:
|
||||
json=json_data,
|
||||
)
|
||||
|
||||
# Team failed to create in litellm - this is an unforseen error state...
|
||||
# Team failed to create in litellm - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
if (
|
||||
response.status_code == 400
|
||||
@@ -707,7 +707,7 @@ class LiteLlmManager:
|
||||
json=json_data,
|
||||
)
|
||||
|
||||
# Team failed to update in litellm - this is an unforseen error state...
|
||||
# Team failed to update in litellm - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
logger.error(
|
||||
'error_updating_litellm_team',
|
||||
@@ -802,7 +802,7 @@ class LiteLlmManager:
|
||||
},
|
||||
)
|
||||
|
||||
# User failed to create in litellm - this is an unforseen error state...
|
||||
# User failed to create in litellm - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
if (
|
||||
response.status_code in (400, 409)
|
||||
@@ -1088,7 +1088,7 @@ class LiteLlmManager:
|
||||
json=json_data,
|
||||
)
|
||||
|
||||
# Failed to add user to team - this is an unforseen error state...
|
||||
# Failed to add user to team - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
if (
|
||||
response.status_code == 400
|
||||
@@ -1183,7 +1183,7 @@ class LiteLlmManager:
|
||||
json=json_data,
|
||||
)
|
||||
|
||||
# Failed to update user in team - this is an unforseen error state...
|
||||
# Failed to update user in team - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
logger.error(
|
||||
'error_updating_litellm_user_in_team',
|
||||
@@ -1264,7 +1264,7 @@ class LiteLlmManager:
|
||||
f'{LITE_LLM_API_URL}/key/generate',
|
||||
json=json_data,
|
||||
)
|
||||
# Failed to generate user key for team - this is an unforseen error state...
|
||||
# Failed to generate user key for team - this is an unforeseen error state...
|
||||
if not response.is_success:
|
||||
logger.error(
|
||||
'error_generate_user_team_key',
|
||||
|
||||
@@ -119,7 +119,7 @@ class VerifyWebhookStatus:
|
||||
Rows with valid conditions with contain (webhook_exists=False, status=WebhookStatus.VERIFIED)
|
||||
|
||||
Conditions we check for
|
||||
1. Resoure exists
|
||||
1. Resource exists
|
||||
- user could have deleted resource
|
||||
2. User has admin access to resource
|
||||
- user's permissions to install webhook could have changed
|
||||
|
||||
@@ -27,7 +27,7 @@ export function BrandButton({
|
||||
name={name}
|
||||
data-testid={testId}
|
||||
disabled={isDisabled}
|
||||
// The type is alreadt passed as a prop to the button component
|
||||
// The type is already passed as a prop to the button component
|
||||
// eslint-disable-next-line react/button-has-type
|
||||
type={type}
|
||||
onClick={onClick}
|
||||
|
||||
@@ -62,7 +62,7 @@ class ProviderToken(BaseModel):
|
||||
return token_value
|
||||
elif isinstance(token_value, dict):
|
||||
token_str = token_value.get('token', '')
|
||||
# Override with emtpy string if it was set to None
|
||||
# Override with empty string if it was set to None
|
||||
# Cannot pass None to SecretStr
|
||||
if token_str is None:
|
||||
token_str = '' # type: ignore[unreachable]
|
||||
|
||||
@@ -175,7 +175,7 @@ class AuthenticationError(ValueError):
|
||||
|
||||
|
||||
class UnknownException(ValueError):
|
||||
"""Raised when there is an issue with GitHub communcation."""
|
||||
"""Raised when there is an issue with GitHub communication."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class DbSessionInjector(BaseModel, Injector[AsyncSession]):
|
||||
|
||||
@model_validator(mode='after')
|
||||
def fill_empty_fields(self):
|
||||
"""Override any defaults with values from legacy enviroment variables"""
|
||||
"""Override any defaults with values from legacy environment variables"""
|
||||
if self.host is None:
|
||||
self.host = os.getenv('DB_HOST')
|
||||
if self.port is None:
|
||||
|
||||
Reference in New Issue
Block a user