fix: only count users own actions for heatmap contributions#5647
Merged
lafriks merged 6 commits intoJan 6, 2019
Conversation
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
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.
|
lafriks
approved these changes
Jan 5, 2019
Member
|
@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? |
Contributor
Author
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
Contributor
Author
|
@jonasfranz I added a check for organisations, their heatmap will now again show the combined contributions. |
Member
|
CI failed on mssql test |
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
Contributor
Author
|
@lunny Fixed now |
lunny
approved these changes
Jan 6, 2019
lafriks
requested changes
Jan 6, 2019
As suggested by lafriks in his review
jonasfranz
approved these changes
Jan 6, 2019
Member
|
@lafriks need your review |
kolaente
approved these changes
Jan 6, 2019
lafriks
approved these changes
Jan 6, 2019
Member
|
Please send backport to release/v1.7 |
lafriks
pushed a commit
that referenced
this pull request
Jan 6, 2019
Member
|
Thanks for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.









Problem / Current Behaviour
The current query used to count contributions includes notifications sent to watchers of the repository.
Imagine following setup:
0and10has a repository with id01watches the repository0creates a new issue "Test" (or any other action) in the repoactiontable now contains following entries:The current query only checks that the
user_idmatches, this means that the issue created by user0will show up as 1 contribution for both users.Proposed Fix
By also checking for
act_user_idwe 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.