ultralytics-actions 0.0.28__py3-none-any.whl → 0.0.29__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.
actions/__init__.py CHANGED
@@ -22,4 +22,4 @@
22
22
  # ├── test_summarize_pr.py
23
23
  # └── ...
24
24
 
25
- __version__ = "0.0.28"
25
+ __version__ = "0.0.29"
actions/summarize_pr.py CHANGED
@@ -21,7 +21,7 @@ SUMMARY_START = (
21
21
 
22
22
 
23
23
  def generate_merge_message(pr_author, contributors, pr_summary=None):
24
- """Generates an AI thank you message for merged PRs using OpenAI."""
24
+ """Generates a thank-you message for merged PR contributors."""
25
25
  contributors_str = ", ".join(f"@{c}" for c in contributors if c != pr_author)
26
26
  mention_str = f"@{pr_author}"
27
27
  if contributors_str:
@@ -38,15 +38,15 @@ def generate_merge_message(pr_author, contributors, pr_summary=None):
38
38
  f"Context from PR:\n{pr_summary}\n\n"
39
39
  f"Start with the exciting message that this PR is now merged, and weave in an inspiring quote "
40
40
  f"from a famous figure in science, philosophy or stoicism. "
41
- f"Make the message relevant to the specific contributions in this PR. "
42
- f"We want them to feel their hard work is acknowledged and will make a difference in the world.",
41
+ f"Keep the message concise yet relevant to the specific contributions in this PR. "
42
+ f"We want the contributors to feel their effort is appreciated and will make a difference in the world.",
43
43
  },
44
44
  ]
45
45
  return get_completion(messages)
46
46
 
47
47
 
48
48
  def post_merge_message(pr_number, pr_author, contributors, summary):
49
- """Posts AI-generated thank you message on PR after merge."""
49
+ """Posts thank you message on PR after merge."""
50
50
  message = generate_merge_message(pr_author, contributors, summary)
51
51
  comment_url = f"{GITHUB_API_URL}/repos/{GITHUB_REPOSITORY}/issues/{pr_number}/comments"
52
52
  response = requests.post(comment_url, json={"body": message}, headers=GITHUB_HEADERS)
@@ -54,7 +54,7 @@ def post_merge_message(pr_number, pr_author, contributors, summary):
54
54
 
55
55
 
56
56
  def generate_issue_comment(pr_url, pr_summary):
57
- """Generates a personalized issue comment using AI based on the PR context."""
57
+ """Generates a personalized issue comment using based on the PR context."""
58
58
  messages = [
59
59
  {
60
60
  "role": "system",
@@ -62,14 +62,14 @@ def generate_issue_comment(pr_url, pr_summary):
62
62
  },
63
63
  {
64
64
  "role": "user",
65
- "content": f"Write a comment for a GitHub issue where a potential fix has been merged in PR: {pr_url}\n\n"
65
+ "content": f"Write a GitHub issue comment announcing a potential fix has been merged in linked PR {pr_url}\n\n"
66
66
  f"Context from PR:\n{pr_summary}\n\n"
67
67
  f"Include:\n"
68
68
  f"1. An explanation of key changes from the PR that may resolve this issue\n"
69
- f"2. Testing options:\n"
69
+ f"2. Options for testing if PR changes have resolved this issue:\n"
70
70
  f" - pip install git+https://github.com/ultralytics/ultralytics.git@main # test latest changes\n"
71
71
  f" - or await next official PyPI release\n"
72
- f"3. Request feedback on whether these changes resolve the issue\n"
72
+ f"3. Request feedback on whether the PR changes resolve the issue\n"
73
73
  f"4. Thank 🙏 for reporting the issue and welcome any further feedback if the issue persists\n\n",
74
74
  },
75
75
  ]
@@ -141,12 +141,12 @@ query($owner: String!, $repo: String!, $pr_number: Int!) {
141
141
  }
142
142
  url
143
143
  body
144
- author { login }
144
+ author { login, __typename }
145
145
  reviews(first: 50) {
146
- nodes { author { login } }
146
+ nodes { author { login, __typename } }
147
147
  }
148
148
  comments(first: 50) {
149
- nodes { author { login } }
149
+ nodes { author { login, __typename } }
150
150
  }
151
151
  }
152
152
  }
@@ -163,19 +163,18 @@ query($owner: String!, $repo: String!, $pr_number: Int!) {
163
163
 
164
164
  try:
165
165
  data = response.json()["data"]["repository"]["pullRequest"]
166
- issues = data["closingIssuesReferences"]["nodes"]
166
+ comments = data["reviews"]["nodes"] | data["comments"]["nodes"]
167
167
  author = data["author"]["login"]
168
168
 
169
169
  # Get unique contributors from reviews and comments
170
- contributors = {review["author"]["login"] for review in data["reviews"]["nodes"]}
171
- contributors.update(comment["author"]["login"] for comment in data["comments"]["nodes"])
170
+ contributors = {x["author"]["login"] for x in comments if x["author"]["__typename"] != "Bot"}
172
171
  contributors.discard(author) # Remove author from contributors list
173
172
 
174
173
  # Generate personalized comment
175
174
  comment = generate_issue_comment(pr_url=data["url"], pr_summary=pr_summary)
176
175
 
177
176
  # Update linked issues
178
- for issue in issues:
177
+ for issue in data["closingIssuesReferences"]["nodes"]:
179
178
  issue_number = issue["number"]
180
179
  # Add fixed label
181
180
  label_url = f"{GITHUB_API_URL}/repos/{GITHUB_REPOSITORY}/issues/{issue_number}/labels"
@@ -208,7 +207,7 @@ def remove_todos_on_merge(pr_number):
208
207
 
209
208
 
210
209
  def main():
211
- """Summarize a pull request and update its description with an AI-generated summary."""
210
+ """Summarize a pull request and update its description with a summary."""
212
211
  pr_number = PR["number"]
213
212
 
214
213
  print(f"Retrieving diff for PR {pr_number}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics-actions
3
- Version: 0.0.28
3
+ Version: 0.0.29
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,15 +1,15 @@
1
- actions/__init__.py,sha256=oJiBlCMjm3Z_3o0IevfveLqHijKaZjo9f6a7ide7qwE,749
1
+ actions/__init__.py,sha256=ciqhJCn4bl7THyCj2Be2yGA_LLbT5EwepacbxIWzjjg,749
2
2
  actions/first_interaction.py,sha256=ehHkFwWr-14LgesGmO4lOthu8z626FgvV9e6fiyzN8Q,17648
3
- actions/summarize_pr.py,sha256=R4Hb2bqz_1qCX6KE-c8dWiE66wIME45p9iigjD693Pk,10481
3
+ actions/summarize_pr.py,sha256=jNI-c38A0SAPUMi__hoWzrm4rQrF3pj7CCgH-LMQSyc,10514
4
4
  actions/summarize_release.py,sha256=l8NBdTAXLysfNKl1Kf_1tyuBRmeEBLyzTDXS6s5_eQg,8350
5
5
  actions/update_markdown_code_blocks.py,sha256=WBNcMD_KKsZS-qSPBn6O1G0ggQ_VrT-jTQffbg7xH_M,6369
6
6
  actions/utils/__init__.py,sha256=e3vKraD3_YpFiVUn3B3KR0diqG1ZrXMV9eXQYikObxo,1025
7
7
  actions/utils/common_utils.py,sha256=XT8GG0SWBtlZLruA0nKrY4AJpkitvPbM8zndE8etuDo,3548
8
8
  actions/utils/github_utils.py,sha256=QBNBx_qb3cbMwYmAQqEmUmGj33jir8Hjc6dr8Jk3vws,6286
9
9
  actions/utils/openai_utils.py,sha256=O0sYtLFTPqC4inw9_NWcVNlhElcp0iJ1FvAX3L3arKo,1834
10
- ultralytics_actions-0.0.28.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- ultralytics_actions-0.0.28.dist-info/METADATA,sha256=ZSIzSjDkXiV4jWcfk3AhYpl5DMD3JjBamThoqT_byh8,10591
12
- ultralytics_actions-0.0.28.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
- ultralytics_actions-0.0.28.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
- ultralytics_actions-0.0.28.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
- ultralytics_actions-0.0.28.dist-info/RECORD,,
10
+ ultralytics_actions-0.0.29.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ ultralytics_actions-0.0.29.dist-info/METADATA,sha256=nj5LQrIYYTAuOCpG4_l8VEJ3H8tS38ZlNbohkIuSzbc,10591
12
+ ultralytics_actions-0.0.29.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
+ ultralytics_actions-0.0.29.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
+ ultralytics_actions-0.0.29.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
+ ultralytics_actions-0.0.29.dist-info/RECORD,,