From 3872f65c5460f9f6c3f8d5cd5620b64031e82978 Mon Sep 17 00:00:00 2001 From: mjgaughan Date: Tue, 31 Oct 2023 15:53:17 -0500 Subject: [PATCH] updated milestone parsing --- github_api_req.py | 7 +++++-- perceval_tasks.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/github_api_req.py b/github_api_req.py index 0591f23..623b941 100644 --- a/github_api_req.py +++ b/github_api_req.py @@ -30,8 +30,11 @@ def parse_milestones(milestones, earliest_date): for entry in milestones: #if entry date is more recent than the earliest date we're looking at # TODO: decide whether to use created_at or updated_at or closed_at - if dt.datetime.fromisoformat(entry['updated_at'][:-1]) > earliest_date: - count_of_milestones += 1 + # problem is that no one closes their milestones?! hardly seems representative?! + # making this a note here, as both Tamburri and van Meijel use 'closed_at' + if entry['updated_at'] != None: + if dt.datetime.fromisoformat(entry['updated_at'][:-1]) > earliest_date: + count_of_milestones += 1 return count_of_milestones diff --git a/perceval_tasks.py b/perceval_tasks.py index b57000a..05d3b99 100644 --- a/perceval_tasks.py +++ b/perceval_tasks.py @@ -17,7 +17,8 @@ def main(vcs_path, begin_date): # this is the primary function for getting the list of commits from perceval def get_perceval_log(vcs_path, begin_date): print(vcs_path) - repo_dir = '/tmp/' + str(vcs_path[0].split('/')[-1]) + ".git" + repo_dir = '/tmp/' + str(vcs_path[0].split('/')[-1]) + #gitpath=repo_dir repo = Git(uri=vcs_path[0], gitpath=repo_dir) # this is a temporary date_from, will need to be more inclusive in the future fetched_commits = repo.fetch(from_date=begin_date)