grimoirelab
grimoirelab copied to clipboard
Ignore submodule updates when calculating git stats
Gerrit has a feature called Submodule subscriptions [0] where it will automatically move the commit hash pointer for aggregator projects that are configured to subscribe to a submodule. When it does this however it automatically creates a new commit in the aggregator project for the updated submodule.
You can see many examples in this project [1] where most of the commits are just "Update git submodules" the result of this is that the contribution of to submodule project causes contributions to count more than once (by the number of projects that load the submodule).
[0] https://gerrit-review.googlesource.com/Documentation/user-submodules.html [1] https://github.com/opendaylight/releng-autorelease/commits/master
Interesting. I didn't know about that. In the meantime, I think is possible to add a filter to the dashboard to ignore these commits. I see the commit message is always the same, so it will would be quite easy to filter these commits.
@alpgarcia or @dicortazar do you have any idea about how it should be done?
If filtering out all messages starting with "Update git submodules" and then an empty line, it could be enough to have a Kibana filter as follows:
{
"query": {
"prefix": {
"message": "Update git submodules\n\n"
}
}
}
I've tested this with OpenDayLight and it seems to work, but it would be better if you have a look at it before implementing it... I've prepared a proof of concept:
https://opendaylight.biterg.io/goto/6f3bfe07bef0c9a82847fb9db12373d5
The filter is in the top line with filters, look for "Submodule Updates". By clicking on the icons on the filter itself, you can disable it (which would revert the dashboard to the "current" view), make it positive (which will show only commits corresponding to submodule updates) or make it negative (now by default, in red), showing all commits except for module updates.
When making the filter positive, I see 3,927 commits corresponding to submodule updates during the last two years, see screenshot below.

@zxiiro: would this be good enough?
@jgbarah Yes I think this filter is sufficient.
OK, thanks @zxiiro
@dicortazar @alpgarcia could you please copy this into the corresponding panels, if you want to include this in the GrimoireLab standard dashboard?
This issue has no activity, so I'm closing it. However, it contains an interesting feature that we can add to the panels. We'll come back to this when we decide to include it.