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

Github "issues commented" includes comments by other users #325

Open
nikic opened this issue Sep 22, 2023 · 4 comments · May be fixed by #363
Open

Github "issues commented" includes comments by other users #325

nikic opened this issue Sep 22, 2023 · 4 comments · May be fixed by #363

Comments

@nikic
Copy link

nikic commented Sep 22, 2023

The "issues commented" are currently computed like this:

query = "search/issues?q=commenter:{0}+updated:{1}..{2}".format(

What this gives you is any issues that a) I commented on and b) that were updated in the date period. This means that if I commented on an issue at some point, and then someone else leaves a comment on it in the date period, then it will be reported as if I commented that week, which is probably not what was intended?

The same issue exists for "pull requests commented".

@nikic
Copy link
Author

nikic commented Sep 22, 2023

I think there are other related issues as well, e.g. it looks like "issues closed" is determined based on issues closed in the time frame where I am the assignee, rather than issues that I closed.

It's probably not possible to implemented correct behavior using the search API. I found that there is an API for getting events for a user: https://docs.github.com/en/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user This does seem to provide the necessary information to correctly determine all the issues/PRs a user interacted with in a specific way.

However, that API does not seem to allow specifying a time range, so one would have to scan the feed backwards from the current time. This would only work for recent date ranges.

@psss
Copy link
Owner

psss commented Nov 8, 2023

Yes, sometimes the stats are tricky and hard to be extracted correctly. For some plugins we do some additional filtering of the detailed history. We could perhaps do something similar for the github plugin as well.

@Felixoid
Copy link

Hi-hi! I started using the program recently and love it!

However, I faced precisely the same issue described here. Reading the GH API documentation doesn't help. The events API does not provide a way to filter them by dates.

What we can use is additional filtering for the comments and review comments like here:

https://api.github.com/repos/ClickHouse/ClickHouse/issues/56317/comments?since=2023-11-15&sort=created
https://api.github.com/repos/ClickHouse/ClickHouse/pulls/56317/comments?since=2023-11-15&sort=created

The first link is for normal comments in the PRs and issues, and the latter one is for the review comments.

@Felixoid Felixoid linked a pull request Mar 26, 2024 that will close this issue
@Felixoid
Copy link

I've implemented the filter in #363, but I've found that the PullRequestsReviewed has a very solid query, so it's unnecessary to use https://api.github.com/repos/ClickHouse/ClickHouse/pulls/56317/comments?since=2023-11-15&sort=created there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants