Skip to content

Commit 9c14615

Browse files
authored
Use requests instead of advocate for jira data sync (baserow#4986)
1 parent 92d23bd commit 9c14615

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "refactor",
3+
"message": "Removed the use of `advocate` for the Jira data sync so that a connection can be made to the local network.",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "database",
7+
"bullet_points": [],
8+
"created_at": "2026-03-16"
9+
}

enterprise/backend/src/baserow_enterprise/data_sync/jira_issues_data_sync.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
from datetime import datetime
33
from typing import Any, Dict, List, Optional
44

5+
import requests
56
from requests.auth import HTTPBasicAuth
67
from requests.exceptions import JSONDecodeError, RequestException
78

8-
import advocate
9-
from advocate import UnacceptableAddressException
109
from baserow.contrib.database.data_sync.exceptions import SyncError
1110
from baserow.contrib.database.data_sync.registries import DataSyncProperty, DataSyncType
1211
from baserow.contrib.database.data_sync.utils import compare_date
@@ -226,7 +225,7 @@ def _get_issue_count(self, instance, jql, headers, kwargs):
226225

227226
url = f"{instance.jira_url}/rest/api/2/search/approximate-count"
228227
try:
229-
response = advocate.post(
228+
response = requests.post(
230229
url,
231230
headers={**headers, "Content-Type": "application/json"},
232231
json={"jql": jql},
@@ -235,7 +234,7 @@ def _get_issue_count(self, instance, jql, headers, kwargs):
235234
)
236235
if response.ok:
237236
return response.json().get("count", 0)
238-
except (RequestException, UnacceptableAddressException, ConnectionError):
237+
except (RequestException, ConnectionError):
239238
pass
240239
return 0
241240

@@ -278,7 +277,7 @@ def _fetch_issues(self, instance, progress_builder: ChildProgressBuilder):
278277
if next_page_token:
279278
params["nextPageToken"] = next_page_token
280279

281-
response = advocate.get(
280+
response = requests.get(
282281
url, headers=headers, params=params, timeout=10, **kwargs
283282
)
284283
if not response.ok:
@@ -307,7 +306,7 @@ def _fetch_issues(self, instance, progress_builder: ChildProgressBuilder):
307306
next_page_token = data.get("nextPageToken")
308307
if not next_page_token:
309308
break
310-
except (RequestException, UnacceptableAddressException, ConnectionError) as e:
309+
except (RequestException, ConnectionError) as e:
311310
raise SyncError(f"Error connecting to Jira: {str(e)}")
312311

313312
return issues

0 commit comments

Comments
 (0)