-
Notifications
You must be signed in to change notification settings - Fork 10
Description
@bockthom discovered that some commit_added events are missing in the final issue data. After looking into it, I found out that this is the result of the author post-processing, where all commits identified as being authored by github are removed. It turns out, that all commits committed by a bot provided by github, such as dependabot, are represented as being authored by github in our data. Github is, however, in this case only the user, and not the author. Therefore, to my understanding, it is not intended to remove these commits.
There are multiple ways to fix this:
- Simply change what is written into the issue data file, which is later read again in the author post-processing. This can be done with a ternary expression in the
print_to_diskfunction. Here is the Python 3 code that solves the issue after upgrading the file from python 2 to python 3 (lines 811-812):
event["commit"]["author"]["name"] if event["event"] == "commit_added" else event["user"]["name"],
event["commit"]["author"]["email"] if event["event"] == "commit_added" else event["user"]["email"],
This would solve the problem and would leave everything else as is, but does not remove the github user from the data - if the skript is ever extended, this problem may occur again.
-
In
merge__issue__events, change theuserfield of allcommit_addedevents. This would result in the field being correct from the beginning, but would also remove the original user before it is added to the user dictionary or the functioninsert__user__datais called. -
In
reformat__events, change theuserfield of allcommit_addedevents. This would retain the data in the user dictionary, but this would still be beforeinsert_user_datais called.
Since I can't run the skript using a codeface database, I can not estimate the impact of not having the correct user for insert_user_data.
Also, all of these points do not specifically target commit_added events made by a github bot - they all would change the listed user behind a commit_added event to the author of the commit for all commit_added events (though a simple if statement could theoretically change that.. ). I am unsure what would be the correct and intended behaviour here.