Skip to content

Commit 48b8b27

Browse files
committed
[refactor]: add public wrapper for private _make_request
1 parent 5cfa38f commit 48b8b27

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/app/services/github/issue_processor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def fetch_issue_content(self) -> str:
3636
issue_url = f"{profiler.base_url}/repos/{self.owner}/{self.repo}/issues/{self.issue_number}"
3737
comments_url = f"{issue_url}/comments"
3838

39-
issue_data = await profiler._make_request(issue_url)
39+
issue_data = await profiler.request(issue_url)
4040
if not issue_data:
4141
raise ValueError("Failed to fetch issue data.")
4242

@@ -45,7 +45,7 @@ async def fetch_issue_content(self) -> str:
4545
f"Body: {issue_data['body']}",
4646
]
4747

48-
comments_data = await profiler._make_request(comments_url)
48+
comments_data = await profiler.request(comments_url)
4949
if comments_data:
5050
comment_texts = [
5151
f"Comment by {c['user']['login']}: {c['body']}"

backend/app/services/github/user/profiling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ async def _make_request(self, url: str, params: Dict = None) -> Optional[Dict]:
7474
logger.error(f"Error making request to {url}: {str(e)}")
7575
return None
7676

77+
async def request(self, url: str, params: Dict | None = None) -> Optional[Dict]:
78+
"""Public, stable wrapper around the internal HTTP helper."""
79+
return await self._make_request(url, params)
80+
7781
async def get_user_data(self, github_username: str) -> Optional[Dict]:
7882
"""Fetch user data"""
7983
url = f"{self.base_url}/users/{github_username}"

0 commit comments

Comments
 (0)