Skip to content

Commit b2488de

Browse files
committed
fix test fail
1 parent ced5e7b commit b2488de

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

openhands/integrations/github/github_service.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def __init__(
5959
elif '/api/v3' in base_url:
6060
# Already in the correct format for REST API
6161
self.BASE_URL = base_url
62-
self.GRAPHQL_URL = base_url.replace('/api/v3', '/api/graphql')
62+
# For GitHub Enterprise, GraphQL endpoint should be at /api/graphql
63+
# But we need to maintain the full path structure
64+
self.GRAPHQL_URL = f'{base_url}/graphql'
6365
else:
6466
# Assume this is a GitHub Enterprise Server hostname
6567
# Append /api/v3 for REST API

openhands/integrations/gitlab/gitlab_service.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from typing import Any
3-
from urllib.parse import quote_plus
43

54
import httpx
65
from pydantic import SecretStr
@@ -18,7 +17,7 @@
1817

1918

2019
class GitLabService(GitService):
21-
BASE_URL = 'https://gitlab.com/api/v4'
20+
DEFAULT_BASE_URL = 'https://gitlab.com/api/v4'
2221
token: SecretStr = SecretStr('')
2322
refresh = False
2423

@@ -29,10 +28,16 @@ def __init__(
2928
external_auth_token: SecretStr | None = None,
3029
token: SecretStr | None = None,
3130
external_token_manager: bool = False,
31+
base_url: str | None = None,
3232
):
3333
self.user_id = user_id
3434
self.external_token_manager = external_token_manager
3535

36+
# Set BASE_URL from parameter or use default
37+
self.BASE_URL = (
38+
base_url.strip() if base_url and base_url.strip() else self.DEFAULT_BASE_URL
39+
)
40+
3641
if token:
3742
self.token = token
3843

0 commit comments

Comments
 (0)