From b97e543ce39b7831b97dfba68ec0faa2371f95f2 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 30 Jun 2015 23:02:27 +0300 Subject: [PATCH] Project Github Info Update Changes now showing commits as well (to see changes in UI run the Cron Job) --- SE_API/GitHub_API_Connector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SE_API/GitHub_API_Connector.py b/SE_API/GitHub_API_Connector.py index 57d4035..ddba971 100644 --- a/SE_API/GitHub_API_Connector.py +++ b/SE_API/GitHub_API_Connector.py @@ -47,6 +47,11 @@ def get_repo_weekly_commits(repo_url): return week_obj +def get_repo_commits(repo_url): + url = 'https://api.github.com/repos/' + repo_url + '/commits' + '?client_id=' + githubKeys.getId() + '&client_secret=' + githubKeys.getSecret() + req = requests.get(url) + return req.json() + def make_macro(stats, info, project_id): macro = {'labels': [], 'data': [[0]]} macro['labels'].append('Commits') @@ -87,6 +92,7 @@ def get_github_data(repo_url, project_id): project_info['stats']['micro'] = make_micro(github_stats, issues) project_info['stats']['weekly_commits'] = weekly_commits project_info['issues'] = issues + project_info['commits'] = get_repo_commits(repo_url) return project_info