-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix review count #198
fix review count #198
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
could you please review it |
@@ -191,10 +197,27 @@ export function getCalendarData(activity: Activity[]) { | |||
}; | |||
} | |||
acc[date].count += 1; | |||
|
|||
const uniquePrReviews = new Set(); |
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.
Could you explain why there are Two sets? All Unique and Unique? Could you explain the algorithm for how you are solving the problem?
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.
The AllUnq set is used to count the total unique pull requests (PRs) reviewed.
and the 2nd set is For PRs reviewed in the last 7 days, we calculate and count the reviews for each date (day) and sum them up over this period.
In this process, if a PR has multiple reviews on the same day or on subsequent days, it is only counted once for its first review. Any subsequent reviews of the same PR are not counted again.
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.
@konavivekramakrishna multiple distinct reviews on the same PR must be counted. But we shouldn't count the individual review comment on the PR. We should only count one review event.
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.
@rithviknishad
For example, in the following pr: ohcnetwork/care_fe#6479
what should be the count of pr_reviewed
The count of 'pr_reviewed' for this pull request in the current staging leaderboard is 13
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.
@konavivekramakrishna multiple distinct reviews on the same PR must be counted. But we shouldn't count the individual review comment on the PR. We should only count one review event.
@rithviknishad are you referring to multiple individuals reviewing the same pull request, or do you mean counting multiple distinct reviews by a single person?"
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.
No. For example, the recent review I've made on your PR in care (ohcnetwork/care_fe#7152 (review)), I've only requested changes ONCE (and you might have also got a mail notification once for the same). However, leaderboard shows 2 review events even though I've made only 1 review event.
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.
The review event seems to be having an ID. Could you update the types? Or if we are not scrapping the ID, can we adjust the scraper to report only one review event for an ID?
can you please check |
@konavivekramakrishna conversation #198 (comment) has not been resolved |
@konavivekramakrishna any updates on this? |
Closing this PR due to no activity |
Fixes #105
Before:
After: