Skip to content
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

[GSoC] Add reference implementation for Issue Response Time #202

Closed
wants to merge 2 commits into from

Conversation

Polaris000
Copy link
Contributor

This pull request adds the reference implementation for Issue Response Time along with tests.

This patch adds the python script for the dataframe implementation of issue response time metric. 
 
Signed-off-by: Aniruddha Karajgi <akarajgi0@gmail.com>
@Polaris000
Copy link
Contributor Author

Polaris000 commented Jul 8, 2019

@jgbarah, please have a look at the implementation. I'll add the tests today. Let me know if you think it is ok.
Please have a look at my comments below. Thanks!

# this check removes pull requests from the
# analysis.
if 'pull_request' in item['data']:
return []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am removing pull requests from the issues data (since GitHub treats all pull requests as issues too). Hope this is fine. (this check will of course be in the Issue_Github category class (in _flatten) and is not specific to this metric.)

Copy link
Collaborator

@jgbarah jgbarah Aug 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in other cases, i think it is easier for this reference implementation to just assume that the class is fed only with issues. It is easy to do that before instantiating the class. So, please remove that check...


flat['issue_resp_time'] = np.NaN if len(member_comments) == 0 \
else (datetime.now()
- utils.str_to_date(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To find the first comment by a maintainer, I used the following logic. Please have a look and let me know if this is easy to understand / requires other changes. What I am doing here is this:

  • Pickout the comments by maintainers and store in member_comments.
  • Add the issue response time to flat by calculated the number of days between today and the first comment by a maintainer (using the min).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this rationale. Time should be from the moment the issue is opened, to the moment it receives the first reponse (not from the first comment to today). If there was still no comment, we should ignore the issue, since it is not correct to say it was responded today...

Are we in sync?


df = df.resample(period).agg({'issue_resp_time': 'mean'})
df['issue_resp_time'] = df['issue_resp_time'].fillna(0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fillna(0) is required to make it easier to plot the dataframe in notebooks. I could just as well remove this line and in the notebook, just before plotting, I could run this line. What do you prefer?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better if you do it when plotting. Otherwise, you're assuming that this is being called before plotting, which maybe is not the case...

This patch adds the reference implementation notebook for the metric Issue Response Time. 
 
Signed-off-by: Aniruddha Karajgi <akarajgi0@gmail.com>
@jgbarah
Copy link
Collaborator

jgbarah commented Jul 10, 2019

Before entering into details, I think we should focus on metrics that already done, at least done enough to be relases. Those are the ones listed here.

Until we're done with those, let's keep this one in the fridge. I'll try to work on its definition meanwhile.

Copy link
Collaborator

@jgbarah jgbarah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, have a look at my comments. Thanks for including your own comments!

@sgoggins
Copy link
Member

@Polaris000 : Could you look at this and resolve the questions?

@Polaris000
Copy link
Contributor Author

Hi @sgoggins. Thank you for your interest.
I'll try my best to do this over the weekend. If not, I'll work on it in the first week(s) of October, since I'm a little busy, right now. Sorry :(

@jgbarah
Copy link
Collaborator

jgbarah commented Aug 29, 2019

@Polaris000, if you don't find the time, don't worry. This metric is not fully defined anyway, so we could just reopen a pr later, when that's done.

@jgbarah
Copy link
Collaborator

jgbarah commented Sep 12, 2019

Since I see no movement, I´m closing this for now. @Polaris000, please feel free to open a new pr when you have time.

@jgbarah jgbarah closed this Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants