Skip to content

Commit

Permalink
CommitReport
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur S. Farias committed Oct 4, 2017
1 parent b7c6de9 commit 442b261
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions script.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,30 @@ def filter(json):
dic["title"] = json["fields"]["summary"]
dic["author"] = json["fields"]["creator"]["displayName"]

dic["reportDate"] = json["fields"]["created"]
dic["fixDate"] = json["fields"]["resolutiondate"]

os.system("git -C spring-framework log -1 --before={} > temp/log.log".format(json["fields"]["created"]))

arq = open('temp/log.log', 'r')
commit = arq.readlines()

dic["commitReport"] = {}
dic["commitReport"]["name"] = json["fields"]["reporter"]["name"]
dic["commitReport"]["key"] = json["fields"]["reporter"]["key"]
dic["commitReport"]["emailAddress"] = json["fields"]["reporter"]["emailAddress"]
strCommit = str(commit[0]).split()
dic["commitReport"]["commitReport"] = strCommit[1]

if ("Author" in str(commit[1])):
strCommit = str(commit[1]).split(": ")
else:
strCommit = str(commit[2]).split(": ")

strCommit = str(strCommit[1]).split(" <")
dic["commitReport"]["nameReport"] = strCommit[0]

strCommit = strCommit[1].split(">")
dic["commitReport"]["emailReport"] = strCommit[0]

arq.close()

dic["labels"] = json["fields"]["issuetype"]["name"]

Expand All @@ -104,12 +124,6 @@ def filter(json):
else:
dic["comments"] = []

dic["reportDate"] = json["fields"]["created"]

dic["fixDate"] = json["fields"]["resolutiondate"]
# Still on tests
teste = os.system("git -C spring-framework log --after=2017-10-02T13:40:56 > log.log")

return dic


Expand Down Expand Up @@ -143,4 +157,3 @@ def filter(json):
elif(choosen == 4):
print("Getting details of issues:")
getDetails("bugs", "bugsUrls")

0 comments on commit 442b261

Please sign in to comment.