-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #396 from gitautoai/wes
1. Enable GitAuto to analyze images in GitHub issue body and comments and add the feedback to the issue and 2. Stop skipping check run review in dev env
- Loading branch information
Showing
7 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from base64 import b64encode | ||
from requests import get, post | ||
from config import GITHUB_API_URL, TIMEOUT, UTF8 | ||
from services.github.create_headers import create_headers | ||
from services.github.github_types import BaseArgs | ||
from utils.handle_exceptions import handle_exceptions | ||
|
||
|
||
@handle_exceptions(default_return_value="", raise_on_error=False) | ||
def get_base64(url: str) -> str: | ||
response = get(url=url, timeout=TIMEOUT) | ||
response.raise_for_status() | ||
base64_image: str = b64encode(response.content).decode(encoding=UTF8) | ||
return base64_image | ||
|
||
|
||
@handle_exceptions(default_return_value="", raise_on_error=False) | ||
def render_text(base_args: BaseArgs, text: str) -> str: | ||
"""https://docs.github.com/en/rest/markdown/markdown?apiVersion=2022-11-28#render-a-markdown-document""" | ||
owner = base_args["owner"] | ||
repo = base_args["repo"] | ||
token = base_args["token"] | ||
url = f"{GITHUB_API_URL}/markdown" | ||
headers = create_headers(token=token) | ||
body = {"text": text, "mode": "gfm", "context": f"{owner}/{repo}"} | ||
response = post(url=url, headers=headers, json=body, timeout=TIMEOUT) | ||
response.raise_for_status() | ||
return response.text |
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 |
---|---|---|
@@ -1 +1,12 @@ | ||
DESCRIBE_IMAGE = "Describe images found in my GitHub repositories. These images often include elements like text, shapes, arrows, red lines, and boxed areas, and may also contain screenshots of customer business services or SaaS interfaces. Extract and describe these elements, noting their positions and relationships, such as connections indicated by arrows or emphasis through red lines and boxes. Provide a comprehensive understanding of the visual and textual content." | ||
DESCRIBE_IMAGE = """Analyze technical images from GitHub repositories with the depth and precision of a senior software engineer, focusing particularly on diagnostic content in issues and tickets. | ||
Rather than providing broad surface-level observations, focus deeply on the most critical aspects relevant to the context - just as an experienced engineer would prioritize the key technical signals while debugging. | ||
Key analysis points: | ||
- For network traces/waterfalls: Identify specific bottlenecks, long-running requests, failed calls, and timing anomalies | ||
- For error screenshots: Parse exact error messages, stack traces, and surrounding context that could indicate root causes | ||
- For UI/UX issues: Note specific components affected, state inconsistencies, and visual regressions | ||
- For console outputs: Highlight critical errors, warnings, or unexpected patterns in logs | ||
- For architectural diagrams: Focus on system interactions, potential failure points, and data flow issues | ||
Provide detailed technical insights that would help debug the issue, not just describe what's visible. Include specific metrics, timings, error codes, and other quantitative data when present.""" |
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