Skip to content

Commit

Permalink
Initial LLM-powered code generation script (#4537)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminmah authored Oct 30, 2024
1 parent 3f2a523 commit b515adb
Show file tree
Hide file tree
Showing 5 changed files with 959 additions and 16 deletions.
15 changes: 15 additions & 0 deletions bugbug/phabricator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from datetime import datetime, timedelta
from typing import Collection, Iterator, NewType

import requests
import tenacity
from libmozdata.phabricator import PhabricatorAPI
from tqdm import tqdm
Expand Down Expand Up @@ -293,3 +294,17 @@ def get_pending_review_time(rev: RevisionDict) -> timedelta | None:
return datetime.utcnow() - last_exclusion_end_date
else:
return datetime.utcnow() - creation_date


def fetch_diff_from_url(
revision_id, first_patch, second_patch=None, single_patch=False
):
if single_patch:
url = f"https://phabricator.services.mozilla.com/D{revision_id}?id={first_patch}&download=true"
else:
url = f"https://phabricator.services.mozilla.com/D{revision_id}?vs={first_patch}&id={second_patch}&download=true"

response = requests.get(url)
response.raise_for_status()

return response.text
Loading

0 comments on commit b515adb

Please sign in to comment.