Skip to content

Commit

Permalink
removed get_recent-gmrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sana-Ma committed Oct 17, 2023
1 parent 41134c8 commit 082eaf2
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions code/gits_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from subprocess import PIPE
import subprocess
import requests
import json


def gits_status(args):
Expand All @@ -18,7 +16,6 @@ def gits_status(args):
process1 = subprocess.Popen(status_cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = process1.communicate()
print(stdout.decode("UTF-8"))
get_recent_gmrs()

except Exception as e:
print("ERROR: gits status command caught an exception")
Expand All @@ -27,58 +24,3 @@ def gits_status(args):

return True


def get_recent_gmrs():
target_branch = "main"
graphql_url = "https://api.github.com/graphql"
query = """
{
repository(owner: "Trinea", name: "android-open-project") {
pullRequests(first: 100,states: OPEN, orderBy: { field: CREATED_AT, direction: DESC }) {
nodes {
number
title
author {
login
}
files(first: 100) { # Adjust 'first' to limit the number of files retrieved
nodes {
path
additions
deletions
}
}
baseRef{
target{
oid
}
}
headRef{
target{
oid
}
}
}
}
}
}
"""
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer Your-Git-Token",
}

data = {"query": query}
response = requests.post(graphql_url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
response_data = response.json() # Parse the JSON response
print(json.dumps(response_data, indent=4)) # Print the response data with indentation


else:
print(f"Request failed with status code: {response.status_code}")
print(response.text)


0 comments on commit 082eaf2

Please sign in to comment.