-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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: only count users own actions for heatmap contributions #5647
fix: only count users own actions for heatmap contributions #5647
Conversation
Signed-off-by: Julian Tölle <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #5647 +/- ##
==========================================
+ Coverage 37.8% 37.81% +0.01%
==========================================
Files 322 322
Lines 47489 47498 +9
==========================================
+ Hits 17951 17962 +11
+ Misses 26950 26948 -2
Partials 2588 2588
Continue to review full report at Codecov.
|
@apricote Do you consider implementing a case differentiation between organizations and users? e.g. showing the "old" heatmap for organizations and the "new" heatmap for users? |
Signed-off-by: Julian Tölle <[email protected]>
@jonasfranz I added a check for organisations, their heatmap will now again show the combined contributions. |
CI failed on mssql test |
Signed-off-by: Julian Tölle <[email protected]>
Signed-off-by: Julian Tölle <[email protected]>
@lunny Fixed now |
As suggested by lafriks in his review
@lafriks need your review |
Please send backport to release/v1.7 |
Signed-off-by: Julian Tölle <[email protected]>
Thanks for PR |
Problem / Current Behaviour
The current query used to count contributions includes notifications sent to watchers of the repository.
Imagine following setup:
0
and1
0
has a repository with id0
1
watches the repository0
creates a new issue "Test" (or any other action) in the repoaction
table now contains following entries:The current query only checks that the
user_id
matches, this means that the issue created by user0
will show up as 1 contribution for both users.Proposed Fix
By also checking for
act_user_id
we can assure that only actions that the user did himself are counted as a contribution.We can not drop the check for
user_id
, assuming the scenario from above, the one issue created would show up as 2 (1 + number of watchers) contributions for the user who created the issue.Drawback
Edit: Resolved by only adding the condition if the user is not an organization.
The organization's heatmap will now only contain meta-actions likeActionCreateRepo
, previously all contributions made by users in this repository were also counted, resulting in a nice summary heatmap for all activity.