mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 14:58:39 +08:00
refactor: move openhands.integrations to openhands.app_server.integrations (#14195)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
co-authored by
openhands
parent
c824b2dda5
commit
5b500d640a
@@ -27,7 +27,7 @@ Before pushing any changes, you MUST ensure that any lint errors or simple test
|
||||
|
||||
* If you've made changes to the backend, you should run `pre-commit run --config ./dev_config/python/.pre-commit-config.yaml` (this will run on staged files).
|
||||
* If you've made changes to the frontend, you should run `cd frontend && npm run lint:fix && npm run build ; cd ..`
|
||||
* If you've made changes to the VSCode extension, you should run `cd openhands/integrations/vscode && npm run lint:fix && npm run compile ; cd ../../..`
|
||||
* If you've made changes to the VSCode extension, you should run `cd openhands/app_server/integrations/vscode && npm run lint:fix && npm run compile ; cd ../../..`
|
||||
|
||||
The pre-commit hooks MUST pass successfully before pushing any changes to the repository. This is a mandatory requirement to maintain code quality and consistency.
|
||||
|
||||
@@ -150,7 +150,7 @@ Frontend:
|
||||
|
||||
|
||||
VSCode Extension:
|
||||
- Located in the `openhands/integrations/vscode` directory
|
||||
- Located in the `openhands/app_server/integrations/vscode` directory
|
||||
- Setup: Run `npm install` in the extension directory
|
||||
- Linting:
|
||||
- Run linting with fixes: `npm run lint:fix`
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from pydantic import SecretStr
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.app_server.integrations.bitbucket.bitbucket_service import (
|
||||
BitBucketService,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.bitbucket.bitbucket_service import BitBucketService
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
class SaaSBitBucketService(BitBucketService):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
from pydantic import SecretStr
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.bitbucket_data_center.bitbucket_dc_service import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service import (
|
||||
BitbucketDCService,
|
||||
)
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
|
||||
|
||||
class SaaSBitbucketDCService(BitbucketDCService):
|
||||
|
||||
@@ -21,10 +21,10 @@ from storage.openhands_pr_store import OpenhandsPRStore
|
||||
|
||||
from openhands.app_server.conversation_paths import get_conversation_dir
|
||||
from openhands.app_server.file_store import get_file_store
|
||||
from openhands.app_server.integrations.github.github_service import GithubServiceImpl
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.config import load_openhands_config
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.github_service import GithubServiceImpl
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
config = load_openhands_config()
|
||||
file_store = get_file_store(config.file_store, config.file_store_path)
|
||||
|
||||
@@ -31,10 +31,10 @@ from server.auth.auth_error import ExpiredError
|
||||
from server.auth.constants import GITHUB_APP_CLIENT_ID, GITHUB_APP_PRIVATE_KEY
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderToken, ProviderType
|
||||
from openhands.app_server.integrations.service_types import AuthenticationError
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderToken, ProviderType
|
||||
from openhands.integrations.service_types import AuthenticationError
|
||||
from openhands.server.types import (
|
||||
LLMAuthenticationError,
|
||||
MissingSettingsError,
|
||||
|
||||
@@ -4,9 +4,9 @@ from integrations.store_repo_utils import store_repositories_in_db
|
||||
from pydantic import SecretStr
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.app_server.integrations.github.github_service import GitHubService
|
||||
from openhands.app_server.integrations.service_types import ProviderType, Repository
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.github_service import GitHubService
|
||||
from openhands.integrations.service_types import ProviderType, Repository
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.config import get_app_conversation_service
|
||||
from openhands.app_server.integrations.github.github_service import GithubServiceImpl
|
||||
from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.app_server.integrations.service_types import Comment
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.github_service import GithubServiceImpl
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.integrations.service_types import Comment
|
||||
from openhands.sdk import TextContent
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
from openhands.utils.async_utils import call_sync_from_async
|
||||
|
||||
@@ -25,10 +25,10 @@ from jinja2 import Environment, FileSystemLoader
|
||||
from pydantic import SecretStr
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.app_server.integrations.provider import ProviderToken, ProviderType
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.integrations.provider import ProviderToken, ProviderType
|
||||
from openhands.server.types import (
|
||||
LLMAuthenticationError,
|
||||
MissingSettingsError,
|
||||
|
||||
@@ -7,14 +7,14 @@ from server.auth.token_manager import TokenManager
|
||||
from storage.gitlab_webhook import GitlabWebhook, WebhookStatus
|
||||
from storage.gitlab_webhook_store import GitlabWebhookStore
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.gitlab.gitlab_service import GitLabService
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.gitlab.gitlab_service import GitLabService
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
ProviderType,
|
||||
RateLimitError,
|
||||
Repository,
|
||||
RequestMethod,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.config import get_app_conversation_service
|
||||
from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.app_server.integrations.service_types import Comment
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.integrations.service_types import Comment
|
||||
from openhands.sdk import TextContent
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
@@ -38,10 +38,10 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.config import get_app_conversation_service
|
||||
from openhands.app_server.integrations.provider import ProviderHandler, ProviderType
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler, ProviderType
|
||||
from openhands.sdk import TextContent
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
@@ -29,9 +29,9 @@ from storage.jira_dc_integration_store import JiraDcIntegrationStore
|
||||
from storage.jira_dc_user import JiraDcUser
|
||||
from storage.jira_dc_workspace import JiraDcWorkspace
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.service_types import Repository
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.integrations.service_types import Repository
|
||||
from openhands.server.shared import server_config
|
||||
from openhands.server.types import (
|
||||
LLMAuthenticationError,
|
||||
|
||||
@@ -30,10 +30,10 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.config import get_app_conversation_service
|
||||
from openhands.app_server.integrations.provider import ProviderHandler, ProviderType
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler, ProviderType
|
||||
from openhands.sdk import TextContent
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
from uuid import UUID
|
||||
|
||||
from openhands.app_server.integrations.provider import (
|
||||
PROVIDER_TOKEN_TYPE,
|
||||
ProviderHandler,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import ProviderType, UserGitInfo
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.app_server.user.user_models import UserInfo
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderHandler
|
||||
from openhands.integrations.service_types import ProviderType, UserGitInfo
|
||||
from openhands.sdk.secret import SecretSource, StaticSecret
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ from sqlalchemy import select
|
||||
from storage.database import a_session_maker
|
||||
from storage.slack_user import SlackUser
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
AuthenticationError,
|
||||
ProviderTimeoutError,
|
||||
Repository,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.server.shared import config, server_config, sio
|
||||
from openhands.server.types import (
|
||||
LLMAuthenticationError,
|
||||
|
||||
@@ -30,11 +30,11 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
SendMessageRequest,
|
||||
)
|
||||
from openhands.app_server.config import get_app_conversation_service
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.sandbox.sandbox_models import SandboxStatus
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.specifiy_user_context import USER_CONTEXT_ATTR
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.sdk import TextContent
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
from openhands.utils.async_utils import GENERAL_TIMEOUT
|
||||
|
||||
@@ -3,9 +3,9 @@ from storage.stored_repository import StoredRepository
|
||||
from storage.user_repo_map import UserRepositoryMap
|
||||
from storage.user_repo_map_store import UserRepositoryMapStore
|
||||
|
||||
from openhands.app_server.integrations.service_types import Repository
|
||||
from openhands.core.config.openhands_config import OpenHandsConfig
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.service_types import Repository
|
||||
|
||||
|
||||
async def store_repositories_in_db(repos: list[Repository], user_id: str) -> None:
|
||||
|
||||
@@ -9,7 +9,7 @@ from pydantic import BaseModel
|
||||
if TYPE_CHECKING:
|
||||
from integrations.models import Message
|
||||
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
|
||||
from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import re
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
from server.constants import WEB_HOST
|
||||
|
||||
from openhands.integrations.service_types import Repository
|
||||
from openhands.app_server.integrations.service_types import Repository
|
||||
|
||||
# ---- DO NOT REMOVE ----
|
||||
# WARNING: Langfuse depends on the WEB_HOST environment variable being set to track events.
|
||||
@@ -65,7 +65,7 @@ def get_user_not_found_message(username: str | None = None) -> str:
|
||||
|
||||
OPENHANDS_RESOLVER_TEMPLATES_DIR = (
|
||||
os.getenv('OPENHANDS_RESOLVER_TEMPLATES_DIR')
|
||||
or 'openhands/integrations/templates/resolver/'
|
||||
or 'openhands/app_server/integrations/templates/resolver/'
|
||||
)
|
||||
_jinja_env = Environment(loader=FileSystemLoader(OPENHANDS_RESOLVER_TEMPLATES_DIR))
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from openhands.integrations.gitlab.constants import GITLAB_HOST
|
||||
from openhands.app_server.integrations.gitlab.constants import GITLAB_HOST
|
||||
|
||||
GITHUB_APP_CLIENT_ID = os.getenv('GITHUB_APP_CLIENT_ID', '').strip()
|
||||
GITHUB_APP_CLIENT_SECRET = os.getenv('GITHUB_APP_CLIENT_SECRET', '').strip()
|
||||
|
||||
@@ -2,8 +2,8 @@ from integrations.github.github_service import SaaSGitHubService
|
||||
from pydantic import SecretStr
|
||||
from server.auth.auth_utils import user_verifier
|
||||
|
||||
from openhands.app_server.integrations.github.github_types import GitHubUser
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.github_types import GitHubUser
|
||||
|
||||
|
||||
def is_user_allowed(user_login: str):
|
||||
|
||||
@@ -3,8 +3,8 @@ import asyncio
|
||||
from pydantic import SecretStr
|
||||
from sqlalchemy import select
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def schedule_gitlab_repo_sync(
|
||||
|
||||
# Lazy import to avoid circular dependency:
|
||||
# middleware -> gitlab_sync -> integrations.gitlab.gitlab_service
|
||||
# -> openhands.integrations.gitlab.gitlab_service -> get_impl
|
||||
# -> openhands.app_server.integrations.gitlab.gitlab_service -> get_impl
|
||||
# -> integrations.gitlab.gitlab_service (circular)
|
||||
from integrations.gitlab.gitlab_service import SaaSGitLabService
|
||||
|
||||
|
||||
@@ -35,14 +35,14 @@ from storage.user_authorization_store import UserAuthorizationStore
|
||||
from storage.user_store import UserStore
|
||||
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed
|
||||
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.app_server.settings.settings_models import Settings
|
||||
from openhands.app_server.settings.settings_store import SettingsStore
|
||||
from openhands.integrations.provider import (
|
||||
from openhands.app_server.integrations.provider import (
|
||||
PROVIDER_TOKEN_TYPE,
|
||||
ProviderToken,
|
||||
ProviderType,
|
||||
)
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.app_server.settings.settings_models import Settings
|
||||
from openhands.app_server.settings.settings_store import SettingsStore
|
||||
from openhands.server.user_auth.user_auth import AuthType, UserAuth
|
||||
|
||||
token_manager = TokenManager()
|
||||
|
||||
@@ -51,7 +51,7 @@ from storage.github_app_installation import GithubAppInstallation
|
||||
from storage.offline_token_store import OfflineTokenStore
|
||||
from tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt
|
||||
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.server.types import SessionExpiredError
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ from server.auth.constants import (
|
||||
)
|
||||
from server.constants import DEPLOYMENT_MODE
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.config.utils import load_openhands_config
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.server.config.server_config import ServerConfig
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.app_server.user.user_models import UserInfo
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
class SaasUserInfo(UserInfo):
|
||||
|
||||
@@ -46,9 +46,9 @@ from storage.database import a_session_maker
|
||||
from storage.user import User
|
||||
from storage.user_store import UserStore
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.service_types import ProviderType, TokenResponse
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.integrations.service_types import ProviderType, TokenResponse
|
||||
from openhands.server.services.conversation_service import create_provider_tokens_object
|
||||
from openhands.server.shared import config
|
||||
from openhands.server.user_auth import get_access_token
|
||||
|
||||
@@ -15,8 +15,8 @@ from server.auth.constants import (
|
||||
from server.auth.token_manager import TokenManager
|
||||
from server.services.automation_event_service import AutomationEventService
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderType
|
||||
|
||||
# Environment variable to disable GitHub webhooks
|
||||
GITHUB_WEBHOOKS_ENABLED = os.environ.get('GITHUB_WEBHOOKS_ENABLED', '1') in (
|
||||
|
||||
@@ -19,8 +19,8 @@ from server.auth.token_manager import TokenManager
|
||||
from storage.gitlab_webhook import GitlabWebhook
|
||||
from storage.gitlab_webhook_store import GitlabWebhookStore
|
||||
|
||||
from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.server.shared import sio
|
||||
from openhands.server.user_auth import get_user_id
|
||||
|
||||
|
||||
@@ -39,7 +39,10 @@ from storage.slack_team_store import SlackTeamStore
|
||||
from storage.slack_user import SlackUser
|
||||
from storage.user_store import UserStore
|
||||
|
||||
from openhands.integrations.service_types import ProviderTimeoutError, ProviderType
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
ProviderTimeoutError,
|
||||
ProviderType,
|
||||
)
|
||||
from openhands.server.shared import config, sio
|
||||
|
||||
signature_verifier = SignatureVerifier(signing_secret=SLACK_SIGNING_SECRET)
|
||||
|
||||
@@ -17,12 +17,12 @@ from openhands.app_server.config import (
|
||||
depends_user_context,
|
||||
resolve_provider_llm_base_url,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.app_server.sandbox.session_auth import validate_session_key_ownership
|
||||
from openhands.app_server.user.auth_user_context import AuthUserContext
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.app_server.utils.dependencies import get_dependencies
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ from server.auth.constants import (
|
||||
)
|
||||
from server.auth.token_manager import TokenManager
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.server.shared import sio
|
||||
|
||||
# Cache TTL constants
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
# Simplified imports to avoid dependency chain issues
|
||||
# from openhands.integrations.service_types import ProviderType
|
||||
# from openhands.app_server.integrations.service_types import ProviderType
|
||||
# from openhands.sdk.llm import MetricsSnapshot
|
||||
# from openhands.app_server.app_conversation.app_conversation_models import ConversationTrigger
|
||||
# For now, use Any to avoid import issues
|
||||
|
||||
@@ -30,8 +30,8 @@ from openhands.agent_server.utils import utc_now
|
||||
from openhands.app_server.app_conversation.sql_app_conversation_info_service import (
|
||||
StoredConversationMetadata,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -10,8 +10,8 @@ from sqlalchemy.exc import OperationalError
|
||||
from storage.auth_tokens import AuthTokens
|
||||
from storage.database import a_session_maker
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
# Time buffer (in seconds) before actual expiration to consider token expired
|
||||
# This ensures tokens are refreshed before they actually expire. The
|
||||
|
||||
@@ -6,8 +6,8 @@ from sqlalchemy import and_, desc, select
|
||||
from storage.database import a_session_maker
|
||||
from storage.openhands_pr import OpenhandsPR
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
class OpenhandsPRStore:
|
||||
|
||||
@@ -13,8 +13,8 @@ from sqlalchemy import and_, delete, select, update
|
||||
from storage.database import a_session_maker
|
||||
from storage.proactive_convos import ProactiveConversation
|
||||
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -15,8 +15,8 @@ from storage.database import a_session_maker
|
||||
from storage.gitlab_webhook import GitlabWebhook, WebhookStatus
|
||||
from storage.gitlab_webhook_store import GitlabWebhookStore
|
||||
|
||||
from openhands.app_server.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.gitlab.gitlab_service import GitLabServiceImpl
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from integrations.gitlab.gitlab_service import SaaSGitLabService
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ class TestSaaSBitbucketDCServiceInit:
|
||||
def test_refresh_flag_is_true(self):
|
||||
# self.refresh = True is required so the base class BitbucketDCService
|
||||
# retries the request with a refreshed token on 401 responses.
|
||||
# See openhands/integrations/bitbucket_data_center/service/base.py,
|
||||
# See openhands/app_server/integrations/bitbucket_data_center/service/base.py,
|
||||
# which checks `if self.refresh` before attempting the retry.
|
||||
service = SaaSBitbucketDCService()
|
||||
assert service.refresh is True
|
||||
|
||||
+4
-1
@@ -24,7 +24,10 @@ def jinja_env() -> Environment:
|
||||
repo_root = Path(__file__).resolve().parents[5]
|
||||
return Environment(
|
||||
loader=FileSystemLoader(
|
||||
str(repo_root / 'openhands/integrations/templates/resolver/github')
|
||||
str(
|
||||
repo_root
|
||||
/ 'openhands/app_server/integrations/templates/resolver/github'
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ from storage.jira_conversation import JiraConversation
|
||||
from storage.jira_user import JiraUser
|
||||
from storage.jira_workspace import JiraWorkspace
|
||||
|
||||
from openhands.integrations.service_types import ProviderType, Repository
|
||||
from openhands.app_server.integrations.service_types import ProviderType, Repository
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from storage.jira_dc_conversation import JiraDcConversation
|
||||
from storage.jira_dc_user import JiraDcUser
|
||||
from storage.jira_dc_workspace import JiraDcWorkspace
|
||||
|
||||
from openhands.integrations.service_types import ProviderType, Repository
|
||||
from openhands.app_server.integrations.service_types import ProviderType, Repository
|
||||
from openhands.server.user_auth.user_auth import UserAuth
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ from integrations.jira_dc.jira_dc_view import (
|
||||
)
|
||||
from integrations.models import Message, SourceType
|
||||
|
||||
from openhands.integrations.service_types import ProviderType, Repository
|
||||
from openhands.app_server.integrations.service_types import ProviderType, Repository
|
||||
from openhands.server.types import (
|
||||
LLMAuthenticationError,
|
||||
MissingSettingsError,
|
||||
|
||||
@@ -10,11 +10,11 @@ import pytest
|
||||
from pydantic import SecretStr
|
||||
|
||||
from enterprise.integrations.resolver_context import ResolverUserContext
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
|
||||
# Import the real classes we want to test
|
||||
from openhands.integrations.provider import CustomSecret, ProviderToken
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.provider import CustomSecret, ProviderToken
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
|
||||
# Import the SDK types we need for testing
|
||||
from openhands.sdk.secret import SecretSource, StaticSecret
|
||||
@@ -344,7 +344,7 @@ async def test_get_provider_handler_creates_handler_with_correct_params(
|
||||
handler = await resolver_context._get_provider_handler()
|
||||
|
||||
# Assert
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
|
||||
assert isinstance(handler, ProviderHandler)
|
||||
assert handler.provider_tokens == provider_tokens
|
||||
|
||||
@@ -15,7 +15,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
|
||||
# Default patches for constants
|
||||
CONSTANT_PATCHES = {
|
||||
|
||||
@@ -15,7 +15,7 @@ from storage.auth_token_store import (
|
||||
from storage.auth_tokens import AuthTokens
|
||||
from storage.base import Base
|
||||
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -24,8 +24,8 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
AppConversationInfo,
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
# Test UUIDs
|
||||
USER1_ID = UUID('a1111111-1111-1111-1111-111111111111')
|
||||
|
||||
@@ -19,7 +19,7 @@ from server.routes.auth import (
|
||||
set_response_cookie,
|
||||
)
|
||||
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
def create_mock_user_authorizer(success: bool = True, error_detail: str | None = None):
|
||||
|
||||
@@ -8,9 +8,9 @@ from pydantic import SecretStr
|
||||
from storage.saas_secrets_store import SaasSecretsStore
|
||||
from storage.stored_custom_secrets import StoredCustomSecrets
|
||||
|
||||
from openhands.app_server.integrations.provider import CustomSecret
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.core.config.openhands_config import OpenHandsConfig
|
||||
from openhands.integrations.provider import CustomSecret
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -22,8 +22,8 @@ from server.auth.saas_user_auth import (
|
||||
from storage.api_key_store import ApiKeyValidationResult
|
||||
from storage.user_authorization import UserAuthorizationType
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderToken, ProviderType
|
||||
from openhands.app_server.secrets.secrets_models import Secrets
|
||||
from openhands.integrations.provider import ProviderToken, ProviderType
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -21,9 +21,9 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
from openhands.app_server.app_conversation.sql_app_conversation_info_service import (
|
||||
SQLAppConversationInfoService,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.app_server.user.specifiy_user_context import SpecifyUserContext
|
||||
from openhands.app_server.utils.sql_utils import Base
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from integrations.slack.slack_manager import (
|
||||
from integrations.slack.slack_view import SlackNewConversationView
|
||||
from storage.slack_user import SlackUser
|
||||
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
ProviderTimeoutError,
|
||||
ProviderType,
|
||||
Repository,
|
||||
|
||||
@@ -3,7 +3,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
import pytest
|
||||
from server.auth.token_manager import TokenManager, create_encryption_utility
|
||||
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -12,9 +12,9 @@ import pytest
|
||||
from fastapi import HTTPException, status
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderToken
|
||||
from openhands.app_server.integrations.service_types import ProviderType
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.integrations.provider import ProviderToken
|
||||
from openhands.integrations.service_types import ProviderType
|
||||
|
||||
|
||||
def _make_user_context(provider_tokens, user_id: str = 'user-1') -> UserContext:
|
||||
@@ -97,7 +97,7 @@ async def test_returns_organizations_for_supported_provider(
|
||||
)
|
||||
|
||||
with patch(
|
||||
'openhands.integrations.provider.ProviderHandler.get_service'
|
||||
'openhands.app_server.integrations.provider.ProviderHandler.get_service'
|
||||
) as mock_get_service:
|
||||
mock_service = mock_get_service.return_value
|
||||
setattr(mock_service, service_method, AsyncMock(return_value=service_return))
|
||||
|
||||
@@ -15,11 +15,11 @@ from openhands.agent_server.utils import OpenHandsUUID, utc_now
|
||||
from openhands.app_server.event_callback.event_callback_models import (
|
||||
EventCallbackProcessor,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import ProviderType, SuggestedTask
|
||||
from openhands.app_server.sandbox.sandbox_models import SandboxStatus
|
||||
|
||||
# Import from new location and re-export for backward compatibility
|
||||
from openhands.app_server.settings.settings_models import SandboxGroupingStrategy
|
||||
from openhands.integrations.service_types import ProviderType, SuggestedTask
|
||||
from openhands.sdk.conversation import ConversationExecutionStatus
|
||||
from openhands.sdk.llm import MetricsSnapshot
|
||||
from openhands.sdk.plugin import PluginSource
|
||||
|
||||
@@ -70,6 +70,8 @@ from openhands.app_server.event_callback.event_callback_service import (
|
||||
from openhands.app_server.event_callback.set_title_callback_processor import (
|
||||
SetTitleCallbackProcessor,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.app_server.integrations.service_types import SuggestedTask
|
||||
from openhands.app_server.pending_messages.pending_message_service import (
|
||||
PendingMessageService,
|
||||
)
|
||||
@@ -92,8 +94,6 @@ from openhands.app_server.utils.llm_metadata import (
|
||||
get_llm_metadata,
|
||||
should_set_litellm_extra_body,
|
||||
)
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE, ProviderType
|
||||
from openhands.integrations.service_types import SuggestedTask
|
||||
from openhands.sdk import Agent, AgentContext, LocalWorkspace
|
||||
from openhands.sdk.agent.acp_agent import ACPAgent
|
||||
from openhands.sdk.hooks import HookConfig
|
||||
|
||||
@@ -15,10 +15,10 @@ import logging
|
||||
import httpx
|
||||
from pydantic import BaseModel
|
||||
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.app_server.integrations.service_types import AuthenticationError
|
||||
from openhands.app_server.sandbox.sandbox_models import SandboxInfo
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.integrations.service_types import AuthenticationError
|
||||
from openhands.sdk.context.skills import KeywordTrigger, Skill, TaskTrigger
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -48,13 +48,13 @@ from openhands.app_server.app_conversation.app_conversation_models import (
|
||||
AppConversationSortOrder,
|
||||
ConversationTrigger,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.app_server.utils.sql_utils import (
|
||||
Base,
|
||||
create_json_type_decorator,
|
||||
)
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.sdk import ConversationStats
|
||||
from openhands.sdk.event import ConversationStateUpdateEvent
|
||||
from openhands.sdk.llm import MetricsSnapshot, TokenUsage
|
||||
|
||||
@@ -34,6 +34,7 @@ from openhands.app_server.event_callback.event_callback_models import EventCallb
|
||||
from openhands.app_server.event_callback.set_title_callback_processor import (
|
||||
SetTitleCallbackProcessor,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderType
|
||||
from openhands.app_server.sandbox.sandbox_models import SandboxInfo
|
||||
from openhands.app_server.services.injector import InjectorState
|
||||
from openhands.app_server.services.jwt_service import JwtService
|
||||
@@ -43,7 +44,6 @@ from openhands.app_server.user.specifiy_user_context import (
|
||||
USER_CONTEXT_ATTR,
|
||||
SpecifyUserContext,
|
||||
)
|
||||
from openhands.integrations.provider import ProviderType
|
||||
from openhands.sdk import ConversationExecutionStatus, Event
|
||||
from openhands.sdk.event import ConversationStateUpdateEvent
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
@@ -4,7 +4,7 @@ from enum import StrEnum
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
Repository,
|
||||
SuggestedTask,
|
||||
|
||||
@@ -18,6 +18,13 @@ from openhands.app_server.git.git_models import (
|
||||
SortOrder,
|
||||
SuggestedTaskPage,
|
||||
)
|
||||
from openhands.app_server.integrations.provider import ProviderHandler
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
ProviderType,
|
||||
Repository,
|
||||
SuggestedTask,
|
||||
)
|
||||
from openhands.app_server.user.user_context import UserContext
|
||||
from openhands.app_server.utils.dependencies import get_dependencies
|
||||
from openhands.app_server.utils.paging_utils import (
|
||||
@@ -25,16 +32,9 @@ from openhands.app_server.utils.paging_utils import (
|
||||
encode_page_id,
|
||||
paginate_results,
|
||||
)
|
||||
from openhands.integrations.provider import ProviderHandler
|
||||
from openhands.integrations.service_types import (
|
||||
Branch,
|
||||
ProviderType,
|
||||
Repository,
|
||||
SuggestedTask,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from openhands.integrations.provider import PROVIDER_TOKEN_TYPE
|
||||
from openhands.app_server.integrations.provider import PROVIDER_TOKEN_TYPE
|
||||
|
||||
# We use the get_dependencies method here to signal to the OpenAPI docs that this endpoint
|
||||
# is protected. The actual protection is provided by SetAuthCookieMiddleware
|
||||
|
||||
+13
-9
@@ -4,22 +4,26 @@ from typing import Any
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.azure_devops.service.branches import (
|
||||
from openhands.app_server.integrations.azure_devops.service.branches import (
|
||||
AzureDevOpsBranchesMixin,
|
||||
)
|
||||
from openhands.integrations.azure_devops.service.features import (
|
||||
from openhands.app_server.integrations.azure_devops.service.features import (
|
||||
AzureDevOpsFeaturesMixin,
|
||||
)
|
||||
from openhands.integrations.azure_devops.service.prs import AzureDevOpsPRsMixin
|
||||
from openhands.integrations.azure_devops.service.repos import AzureDevOpsReposMixin
|
||||
from openhands.integrations.azure_devops.service.resolver import (
|
||||
from openhands.app_server.integrations.azure_devops.service.prs import (
|
||||
AzureDevOpsPRsMixin,
|
||||
)
|
||||
from openhands.app_server.integrations.azure_devops.service.repos import (
|
||||
AzureDevOpsReposMixin,
|
||||
)
|
||||
from openhands.app_server.integrations.azure_devops.service.resolver import (
|
||||
AzureDevOpsResolverMixin,
|
||||
)
|
||||
from openhands.integrations.azure_devops.service.work_items import (
|
||||
from openhands.app_server.integrations.azure_devops.service.work_items import (
|
||||
AzureDevOpsWorkItemsMixin,
|
||||
)
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
GitService,
|
||||
ProviderType,
|
||||
@@ -242,7 +246,7 @@ class AzureDevOpsService(
|
||||
# Dynamic class loading to support custom implementations (e.g., SaaS)
|
||||
azure_devops_service_cls = os.environ.get(
|
||||
'OPENHANDS_AZURE_DEVOPS_SERVICE_CLS',
|
||||
'openhands.integrations.azure_devops.azure_devops_service.AzureDevOpsService',
|
||||
'openhands.app_server.integrations.azure_devops.azure_devops_service.AzureDevOpsService',
|
||||
)
|
||||
|
||||
# Lazy loading to avoid circular imports
|
||||
+2
-2
@@ -4,8 +4,8 @@ from urllib.parse import quote
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
RequestMethod,
|
||||
)
|
||||
+7
-2
@@ -1,7 +1,12 @@
|
||||
"""Branch operations for Azure DevOps integration."""
|
||||
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import Branch, PaginatedBranchesResponse
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
PaginatedBranchesResponse,
|
||||
)
|
||||
|
||||
|
||||
class AzureDevOpsBranchesMixin(AzureDevOpsMixinBase):
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
"""Feature operations for Azure DevOps integration (microagents, suggested tasks, user)."""
|
||||
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
ProviderType,
|
||||
RequestMethod,
|
||||
SuggestedTask,
|
||||
+4
-2
@@ -2,9 +2,11 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import Comment, RequestMethod
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import Comment, RequestMethod
|
||||
|
||||
|
||||
class AzureDevOpsPRsMixin(AzureDevOpsMixinBase):
|
||||
+4
-2
@@ -1,7 +1,9 @@
|
||||
"""Repository operations for Azure DevOps integration."""
|
||||
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import ProviderType, Repository
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import ProviderType, Repository
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
+4
-2
@@ -1,8 +1,10 @@
|
||||
from datetime import datetime
|
||||
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import Comment
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import Comment
|
||||
|
||||
|
||||
class AzureDevOpsResolverMixin(AzureDevOpsMixinBase):
|
||||
+4
-2
@@ -2,9 +2,11 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from openhands.app_server.integrations.azure_devops.service.base import (
|
||||
AzureDevOpsMixinBase,
|
||||
)
|
||||
from openhands.app_server.integrations.service_types import Comment, RequestMethod
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.azure_devops.service.base import AzureDevOpsMixinBase
|
||||
from openhands.integrations.service_types import Comment, RequestMethod
|
||||
|
||||
|
||||
class AzureDevOpsWorkItemsMixin(AzureDevOpsMixinBase):
|
||||
+3
-3
@@ -2,12 +2,12 @@ import os
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.bitbucket.service import (
|
||||
from openhands.app_server.integrations.bitbucket.service import (
|
||||
BitBucketBranchesMixin,
|
||||
BitBucketPRsMixin,
|
||||
BitBucketReposMixin,
|
||||
)
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
GitService,
|
||||
InstallationsService,
|
||||
ProviderType,
|
||||
@@ -60,7 +60,7 @@ class BitBucketService(
|
||||
|
||||
bitbucket_service_cls = os.environ.get(
|
||||
'OPENHANDS_BITBUCKET_SERVICE_CLS',
|
||||
'openhands.integrations.bitbucket.bitbucket_service.BitBucketService',
|
||||
'openhands.app_server.integrations.bitbucket.bitbucket_service.BitBucketService',
|
||||
)
|
||||
|
||||
# Lazy loading to avoid circular imports
|
||||
+3
-3
@@ -4,9 +4,8 @@ from typing import Any
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
OwnerType,
|
||||
ProviderType,
|
||||
@@ -14,6 +13,7 @@ from openhands.integrations.service_types import (
|
||||
RequestMethod,
|
||||
User,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
|
||||
+5
-2
@@ -1,5 +1,8 @@
|
||||
from openhands.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.integrations.service_types import Branch, PaginatedBranchesResponse
|
||||
from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
PaginatedBranchesResponse,
|
||||
)
|
||||
|
||||
|
||||
class BitBucketBranchesMixin(BitBucketMixinBase):
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.app_server.integrations.service_types import RequestMethod
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.integrations.service_types import RequestMethod
|
||||
|
||||
|
||||
class BitBucketPRsMixin(BitBucketMixinBase):
|
||||
+2
-2
@@ -2,8 +2,8 @@ import re
|
||||
from typing import Any
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from openhands.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.integrations.service_types import Repository, SuggestedTask
|
||||
from openhands.app_server.integrations.bitbucket.service.base import BitBucketMixinBase
|
||||
from openhands.app_server.integrations.service_types import Repository, SuggestedTask
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
+3
-3
@@ -2,13 +2,13 @@ import os
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.bitbucket_data_center.service import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.service import (
|
||||
BitbucketDCBranchesMixin,
|
||||
BitbucketDCPRsMixin,
|
||||
BitbucketDCReposMixin,
|
||||
BitbucketDCResolverMixin,
|
||||
)
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
GitService,
|
||||
InstallationsService,
|
||||
ProviderType,
|
||||
@@ -72,7 +72,7 @@ class BitbucketDCService(
|
||||
|
||||
bitbucket_dc_service_cls = os.environ.get(
|
||||
'OPENHANDS_BITBUCKET_DATA_CENTER_SERVICE_CLS',
|
||||
'openhands.integrations.bitbucket_data_center.bitbucket_dc_service.BitbucketDCService',
|
||||
'openhands.app_server.integrations.bitbucket_data_center.bitbucket_dc_service.BitbucketDCService',
|
||||
)
|
||||
|
||||
# Lazy loading to avoid circular imports
|
||||
+3
-3
@@ -4,9 +4,8 @@ from typing import Any
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
AuthenticationError,
|
||||
BaseGitService,
|
||||
OwnerType,
|
||||
@@ -15,6 +14,7 @@ from openhands.integrations.service_types import (
|
||||
RequestMethod,
|
||||
User,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
|
||||
+5
-2
@@ -1,9 +1,12 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from openhands.integrations.bitbucket_data_center.service.base import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.service.base import (
|
||||
BitbucketDCMixinBase,
|
||||
)
|
||||
from openhands.integrations.service_types import Branch, PaginatedBranchesResponse
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
PaginatedBranchesResponse,
|
||||
)
|
||||
|
||||
|
||||
class BitbucketDCBranchesMixin(BitbucketDCMixinBase):
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
from typing import Any
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.bitbucket_data_center.service.base import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.service.base import (
|
||||
BitbucketDCMixinBase,
|
||||
)
|
||||
from openhands.integrations.service_types import RequestMethod
|
||||
from openhands.app_server.integrations.service_types import RequestMethod
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
|
||||
|
||||
class BitbucketDCPRsMixin(BitbucketDCMixinBase):
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
from typing import Any
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from openhands.integrations.bitbucket_data_center.service.base import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.service.base import (
|
||||
BitbucketDCMixinBase,
|
||||
)
|
||||
from openhands.integrations.service_types import Repository, SuggestedTask
|
||||
from openhands.app_server.integrations.service_types import Repository, SuggestedTask
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from openhands.integrations.bitbucket_data_center.service.base import (
|
||||
from openhands.app_server.integrations.bitbucket_data_center.service.base import (
|
||||
BitbucketDCMixinBase,
|
||||
)
|
||||
from openhands.integrations.service_types import Comment
|
||||
from openhands.app_server.integrations.service_types import Comment
|
||||
|
||||
|
||||
class BitbucketDCResolverMixin(BitbucketDCMixinBase):
|
||||
+3
-3
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.forgejo.service import (
|
||||
from openhands.app_server.integrations.forgejo.service import (
|
||||
ForgejoBranchesMixin,
|
||||
ForgejoFeaturesMixin,
|
||||
ForgejoMixinBase,
|
||||
@@ -12,7 +12,7 @@ from openhands.integrations.forgejo.service import (
|
||||
ForgejoReposMixin,
|
||||
ForgejoResolverMixin,
|
||||
)
|
||||
from openhands.integrations.service_types import GitService
|
||||
from openhands.app_server.integrations.service_types import GitService
|
||||
from openhands.utils.import_utils import get_impl
|
||||
|
||||
|
||||
@@ -51,6 +51,6 @@ class ForgejoService(
|
||||
|
||||
forgejo_service_cls = os.environ.get(
|
||||
'OPENHANDS_FORGEJO_SERVICE_CLS',
|
||||
'openhands.integrations.forgejo.forgejo_service.ForgejoService',
|
||||
'openhands.app_server.integrations.forgejo.forgejo_service.ForgejoService',
|
||||
)
|
||||
ForgejoServiceImpl = get_impl(ForgejoService, forgejo_service_cls)
|
||||
+3
-3
@@ -7,9 +7,8 @@ from urllib.parse import urlparse
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
OwnerType,
|
||||
ProviderType,
|
||||
@@ -18,6 +17,7 @@ from openhands.integrations.service_types import (
|
||||
UnknownException,
|
||||
User,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
|
||||
+5
-2
@@ -1,7 +1,10 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from openhands.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.integrations.service_types import Branch, PaginatedBranchesResponse
|
||||
from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
PaginatedBranchesResponse,
|
||||
)
|
||||
|
||||
|
||||
class ForgejoBranchesMixin(ForgejoMixinBase):
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from openhands.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.integrations.service_types import SuggestedTask
|
||||
from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.app_server.integrations.service_types import SuggestedTask
|
||||
|
||||
|
||||
class ForgejoFeaturesMixin(ForgejoMixinBase):
|
||||
+5
-2
@@ -2,9 +2,12 @@ from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
RequestMethod,
|
||||
UnknownException,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.integrations.service_types import RequestMethod, UnknownException
|
||||
|
||||
|
||||
class ForgejoPRsMixin(ForgejoMixinBase):
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from openhands.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.integrations.service_types import Repository
|
||||
from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.app_server.integrations.service_types import Repository
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from openhands.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.integrations.service_types import Comment
|
||||
from openhands.app_server.integrations.forgejo.service.base import ForgejoMixinBase
|
||||
from openhands.app_server.integrations.service_types import Comment
|
||||
|
||||
|
||||
class ForgejoResolverMixin(ForgejoMixinBase):
|
||||
+3
-3
@@ -2,14 +2,14 @@ import os
|
||||
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.integrations.github.service import (
|
||||
from openhands.app_server.integrations.github.service import (
|
||||
GitHubBranchesMixin,
|
||||
GitHubFeaturesMixin,
|
||||
GitHubPRsMixin,
|
||||
GitHubReposMixin,
|
||||
GitHubResolverMixin,
|
||||
)
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
GitService,
|
||||
InstallationsService,
|
||||
@@ -73,7 +73,7 @@ class GitHubService(
|
||||
|
||||
github_service_cls = os.environ.get(
|
||||
'OPENHANDS_GITHUB_SERVICE_CLS',
|
||||
'openhands.integrations.github.github_service.GitHubService',
|
||||
'openhands.app_server.integrations.github.github_service.GitHubService',
|
||||
)
|
||||
|
||||
# Lazy loading to avoid circular imports
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
# openhands/integrations/github/service/__init__.py
|
||||
# openhands/app_server/integrations/github/service/__init__.py
|
||||
|
||||
from .base import GitHubMixinBase
|
||||
from .branches_prs import GitHubBranchesMixin
|
||||
+3
-3
@@ -4,14 +4,14 @@ from typing import Any, cast
|
||||
import httpx
|
||||
from pydantic import SecretStr
|
||||
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.protocols.http_client import HTTPClient
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
BaseGitService,
|
||||
RequestMethod,
|
||||
UnknownException,
|
||||
User,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.utils.http_session import httpx_verify_option
|
||||
|
||||
|
||||
+7
-4
@@ -1,9 +1,12 @@
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.queries import (
|
||||
from openhands.app_server.integrations.github.queries import (
|
||||
search_branches_graphql_query,
|
||||
)
|
||||
from openhands.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.integrations.service_types import Branch, PaginatedBranchesResponse
|
||||
from openhands.app_server.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
Branch,
|
||||
PaginatedBranchesResponse,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
|
||||
|
||||
class GitHubBranchesMixin(GitHubMixinBase):
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.queries import (
|
||||
from openhands.app_server.integrations.github.queries import (
|
||||
suggested_task_issue_graphql_query,
|
||||
suggested_task_pr_graphql_query,
|
||||
)
|
||||
from openhands.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.integrations.service_types import (
|
||||
from openhands.app_server.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
ProviderType,
|
||||
SuggestedTask,
|
||||
TaskType,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
|
||||
|
||||
class GitHubFeaturesMixin(GitHubMixinBase):
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
from openhands.app_server.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.app_server.integrations.service_types import RequestMethod
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.integrations.service_types import RequestMethod
|
||||
|
||||
|
||||
class GitHubPRsMixin(GitHubMixinBase):
|
||||
+6
-2
@@ -1,8 +1,12 @@
|
||||
from datetime import datetime
|
||||
|
||||
from openhands.app_server.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.app_server.integrations.service_types import (
|
||||
OwnerType,
|
||||
ProviderType,
|
||||
Repository,
|
||||
)
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.integrations.github.service.base import GitHubMixinBase
|
||||
from openhands.integrations.service_types import OwnerType, ProviderType, Repository
|
||||
from openhands.server.types import AppMode
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user