-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36868a2
commit 1745bbb
Showing
8 changed files
with
74 additions
and
106 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import requests | ||
|
||
|
||
CODECOV_TOKEN = 'FETCH FROM ENV' | ||
CODECOV_TOKEN = "FETCH FROM ENV" | ||
|
||
|
||
class CodecovClient: | ||
@staticmethod | ||
def fetch_coverage(owner_username, repo_name, pullid, token=CODECOV_TOKEN): | ||
url = f"https://api.codecov.io/api/v2/github/{owner_username}/repos/{repo_name}/pulls/{pullid}" | ||
headers = { | ||
"Authorization": f"Bearer {token}", | ||
"Accept": "application/json" | ||
} | ||
headers = {"Authorization": f"Bearer {token}", "Accept": "application/json"} | ||
response = requests.get(url, headers=headers) | ||
if response.status_code == 200: | ||
return response.json() | ||
return response.text | ||
else: | ||
response.raise_for_status() | ||
return None | ||
|
||
@staticmethod | ||
def fetch_test_results_for_commit(owner_username, repo_name, latest_commit_sha, token=CODECOV_TOKEN): | ||
url = f"https://api.codecov.io/api/v2/github/{owner_username}/repos/{repo_name}/test-results" | ||
def fetch_test_results_for_commit( | ||
owner_username, repo_name, latest_commit_sha, token=CODECOV_TOKEN | ||
): | ||
url = f"https://api.codecov.io/api/v2/github/{owner_username}/repos/{repo_name}/test-results?commit_id={latest_commit_sha}&outcome=failure" | ||
headers = { | ||
"Authorization": f"Bearer {token}", | ||
"Accept": "application/json", | ||
latest_commit_sha: latest_commit_sha, | ||
} | ||
response = requests.get(url, headers=headers) | ||
if response.status_code == 200: | ||
return response.json() | ||
if response.json()["count"] == 0: | ||
return None | ||
return response.text | ||
else: | ||
response.raise_for_status() | ||
|
||
return None | ||
|
||
@staticmethod | ||
def ping(): | ||
return "pong" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,6 @@ class Config: | |
|
||
|
||
class LlmAgent(ABC): | ||
|
||
def __init__( | ||
self, | ||
config: AgentConfig, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters