-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add initial infrastructure to generate a report using new functions and classes #73
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Script for producing Reports from data in ElasticSearch | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Authors: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '.') | ||
|
||
from manuscripts2.report import Report | ||
|
||
test_report = Report(data_dir="PERCEVAL_TESTS", data_sources=['git', 'github_issues', 'github_prs']) | ||
test_report.get_activity_metrics() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
|
||
from manuscripts2.new_functions import Query | ||
|
||
|
||
class GitMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "git" | ||
self.commits = Query(index) | ||
|
||
def get_section_metrics(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you're going to need parameters here... Maybe you could start with some, just to make it clear how that would work? For example, a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes @jgbarah you are right, each class will need a start and end date to configure the range in which to search/query for data. Thanks for pointing it out! |
||
|
||
return { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is very much JavaScript-like ;-) I'm not completely sure yet, but I think we could improve it. But for now, that's ok with me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am sorry, I don't get the reference here. What is JS like? |
||
"overview": { | ||
"activity_metrics": [self.commits.get_cardinality("hash").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
# TODO: Authors is not activity but we need two metrics here | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "", | ||
"patchsets_metrics": [] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above... |
||
|
||
from manuscripts2.derived_classes import Issues | ||
|
||
|
||
class IssuesMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "github_issues" | ||
self.opened_issues = Issues(index) | ||
self.closed_issues = Issues(index) | ||
self.closed_issues.is_closed() | ||
|
||
def get_section_metrics(self): | ||
|
||
return { | ||
"overview": { | ||
"activity_metrics": [self.opened_issues.get_cardinality("id").by_period(), | ||
self.closed_issues.get_cardinality("id").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "Days to close (median and average)", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "", | ||
"patchsets_metrics": [] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
|
||
from manuscripts2.derived_classes import PullRequests | ||
|
||
|
||
class PullRequestsMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "github_prs" | ||
self.opened_prs = PullRequests(index) | ||
self.closed_prs = PullRequests(index) | ||
self.closed_prs.is_closed() | ||
|
||
def get_section_metrics(self): | ||
|
||
return { | ||
"overview": { | ||
"activity_metrics": [self.opened_prs.get_cardinality("id").by_period(), | ||
self.closed_prs.get_cardinality("id").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "Days to close (median and average)", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "Days to close review (median and average)", | ||
"patchsets_metrics": [] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this?