ultralytics-actions 0.1.5__py3-none-any.whl → 0.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ultralytics-actions might be problematic. Click here for more details.
- actions/__init__.py +1 -1
- actions/review_pr.py +25 -2
- actions/utils/github_utils.py +8 -7
- actions/utils/openai_utils.py +2 -0
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/METADATA +1 -1
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/RECORD +10 -10
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/WHEEL +0 -0
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/entry_points.txt +0 -0
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/top_level.txt +0 -0
actions/__init__.py
CHANGED
actions/review_pr.py
CHANGED
|
@@ -8,6 +8,7 @@ import re
|
|
|
8
8
|
from .utils import GITHUB_API_URL, MAX_PROMPT_CHARS, Action, get_completion, remove_html_comments
|
|
9
9
|
|
|
10
10
|
REVIEW_MARKER = "🔍 PR Review"
|
|
11
|
+
ERROR_MARKER = "⚠️ Review generation encountered an error"
|
|
11
12
|
EMOJI_MAP = {"CRITICAL": "❗", "HIGH": "⚠️", "MEDIUM": "💡", "LOW": "📝", "SUGGESTION": "💭"}
|
|
12
13
|
SKIP_PATTERNS = [
|
|
13
14
|
r"\.lock$", # Lock files
|
|
@@ -179,7 +180,7 @@ def generate_pr_review(repository: str, diff_text: str, pr_title: str, pr_descri
|
|
|
179
180
|
error_details = traceback.format_exc()
|
|
180
181
|
print(f"Review generation failed: {e}\n{error_details}")
|
|
181
182
|
summary = (
|
|
182
|
-
f"
|
|
183
|
+
f"{ERROR_MARKER}: `{type(e).__name__}`\n\n"
|
|
183
184
|
f"<details><summary>Debug Info</summary>\n\n```\n{error_details}\n```\n</details>"
|
|
184
185
|
)
|
|
185
186
|
return {"comments": [], "summary": summary}
|
|
@@ -219,7 +220,29 @@ def post_review_summary(event: Action, review_data: dict, review_number: int) ->
|
|
|
219
220
|
|
|
220
221
|
review_title = f"{REVIEW_MARKER} {review_number}" if review_number > 1 else REVIEW_MARKER
|
|
221
222
|
comments = review_data.get("comments", [])
|
|
222
|
-
|
|
223
|
+
summary = review_data.get("summary") or ""
|
|
224
|
+
|
|
225
|
+
# Don't approve if error occurred or if there are critical/high severity issues
|
|
226
|
+
has_error = not summary or ERROR_MARKER in summary
|
|
227
|
+
has_issues = any(c.get("severity") not in ["LOW", "SUGGESTION", None] for c in comments)
|
|
228
|
+
requests_changes = any(
|
|
229
|
+
phrase in summary.lower()
|
|
230
|
+
for phrase in [
|
|
231
|
+
"please",
|
|
232
|
+
"should",
|
|
233
|
+
"must",
|
|
234
|
+
"need to",
|
|
235
|
+
"needs to",
|
|
236
|
+
"before merging",
|
|
237
|
+
"fix",
|
|
238
|
+
"error",
|
|
239
|
+
"issue",
|
|
240
|
+
"problem",
|
|
241
|
+
"warning",
|
|
242
|
+
"concern",
|
|
243
|
+
]
|
|
244
|
+
)
|
|
245
|
+
event_type = "COMMENT" if (has_error or has_issues or requests_changes) else "APPROVE"
|
|
223
246
|
|
|
224
247
|
body = (
|
|
225
248
|
f"## {review_title}\n\n"
|
actions/utils/github_utils.py
CHANGED
|
@@ -125,21 +125,22 @@ class Action:
|
|
|
125
125
|
|
|
126
126
|
def _request(self, method: str, url: str, headers=None, expected_status=None, hard=False, **kwargs):
|
|
127
127
|
"""Unified request handler with error checking."""
|
|
128
|
-
|
|
128
|
+
r = getattr(requests, method)(url, headers=headers or self.headers, **kwargs)
|
|
129
129
|
expected = expected_status or self._default_status[method]
|
|
130
|
-
success =
|
|
130
|
+
success = r.status_code in expected
|
|
131
131
|
|
|
132
132
|
if self.verbose:
|
|
133
|
-
|
|
133
|
+
elapsed = r.elapsed.total_seconds()
|
|
134
|
+
print(f"{'✓' if success else '✗'} {method.upper()} {url} → {r.status_code} ({elapsed:.1f}s)")
|
|
134
135
|
if not success:
|
|
135
136
|
try:
|
|
136
|
-
print(f" ❌ Error: {
|
|
137
|
+
print(f" ❌ Error: {r.json().get('message', 'Unknown error')}")
|
|
137
138
|
except Exception:
|
|
138
|
-
print(f" ❌ Error: {
|
|
139
|
+
print(f" ❌ Error: {r.text[:200]}")
|
|
139
140
|
|
|
140
141
|
if not success and hard:
|
|
141
|
-
|
|
142
|
-
return
|
|
142
|
+
r.raise_for_status()
|
|
143
|
+
return r
|
|
143
144
|
|
|
144
145
|
def get(self, url, **kwargs):
|
|
145
146
|
"""Performs GET request with error handling."""
|
actions/utils/openai_utils.py
CHANGED
|
@@ -125,6 +125,8 @@ def get_completion(
|
|
|
125
125
|
|
|
126
126
|
try:
|
|
127
127
|
r = requests.post(url, json=data, headers=headers, timeout=600)
|
|
128
|
+
success = r.status_code == 200
|
|
129
|
+
print(f"{'✓' if success else '✗'} POST {url} → {r.status_code} ({r.elapsed.total_seconds():.1f}s)")
|
|
128
130
|
r.raise_for_status()
|
|
129
131
|
|
|
130
132
|
# Parse response
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ultralytics-actions
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Ultralytics Actions for GitHub automation and PR management.
|
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
actions/__init__.py,sha256=
|
|
1
|
+
actions/__init__.py,sha256=owzYNIk3pmwSP7At9iZuEgZyKtiaKSazh22WkbEyfFo,772
|
|
2
2
|
actions/dispatch_actions.py,sha256=i81UeHrYudAsOUFUfN71u6X-1cmZaZaiiTj6p2rvz8A,4217
|
|
3
3
|
actions/first_interaction.py,sha256=QxPsLjd-m2G-QYOcQb2hQfIB_alupzeZzSHTk-jw0bg,9856
|
|
4
|
-
actions/review_pr.py,sha256=
|
|
4
|
+
actions/review_pr.py,sha256=_x-HwX2iqR1xhQkJBDW5CPVq-4Cba7pZZBz63hN9e1Y,15060
|
|
5
5
|
actions/summarize_pr.py,sha256=3nFotiZX42dz-mzDQ9wcoUILJKkcaxrC5EeyxvuvY60,5775
|
|
6
6
|
actions/summarize_release.py,sha256=iCXa9a1DcOrDVe8pMWEsYKgDxuIOhIgMsYymElOLK6o,9083
|
|
7
7
|
actions/update_file_headers.py,sha256=E5fKYLdeW16-BHCcuqxohGpGZqgEh-WX4ZmCQJw2R90,6684
|
|
8
8
|
actions/update_markdown_code_blocks.py,sha256=w3DTRltg2Rmr4-qrNawv_S2vJbheKE0tne1iz79FzXg,8692
|
|
9
9
|
actions/utils/__init__.py,sha256=unjXYIFNFeHrdC8LooDFVWlj6fAdGhssUgASo5229zY,1073
|
|
10
10
|
actions/utils/common_utils.py,sha256=2DRvcyCgmn507w3T4FJcQSZNI9KC1gVUb8CnJqPapD0,11943
|
|
11
|
-
actions/utils/github_utils.py,sha256=
|
|
12
|
-
actions/utils/openai_utils.py,sha256=
|
|
11
|
+
actions/utils/github_utils.py,sha256=cBgEDJBpImTJbGBoZTteVSmCqXPuzEb51np7gRhqPeM,19702
|
|
12
|
+
actions/utils/openai_utils.py,sha256=xI_DZpsEBzXyqQDozMLEtmjwuNlOpNL9n2b-gA6xL5Y,10658
|
|
13
13
|
actions/utils/version_utils.py,sha256=EIbm3iZVNyNl3dh8aNz_9ITeTC93ZxfyUzIRkO3tSXw,3242
|
|
14
|
-
ultralytics_actions-0.1.
|
|
15
|
-
ultralytics_actions-0.1.
|
|
16
|
-
ultralytics_actions-0.1.
|
|
17
|
-
ultralytics_actions-0.1.
|
|
18
|
-
ultralytics_actions-0.1.
|
|
19
|
-
ultralytics_actions-0.1.
|
|
14
|
+
ultralytics_actions-0.1.6.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
15
|
+
ultralytics_actions-0.1.6.dist-info/METADATA,sha256=7Zj67iXEIw61XyAKY8Myu0vZYqsO7F_08XvcDstqhWI,12368
|
|
16
|
+
ultralytics_actions-0.1.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
ultralytics_actions-0.1.6.dist-info/entry_points.txt,sha256=n_VbDs3Xj33daaeN_2D72UTEuyeH8hVc6-CPH55ymkY,496
|
|
18
|
+
ultralytics_actions-0.1.6.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
|
19
|
+
ultralytics_actions-0.1.6.dist-info/RECORD,,
|
|
File without changes
|
{ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{ultralytics_actions-0.1.5.dist-info → ultralytics_actions-0.1.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|