wikimedia / WikiContrib

A tool for Wikimedia community members to visualize their technical contributions
https://wikicontrib.toolforge.org
MIT License
23 stars 32 forks source link

Count contributions made by a user to GitLab #283

Open wkyoshida opened 1 year ago

wkyoshida commented 1 year ago

Hey there! :wave:

This issue would be for a feature.

As more Wikimedia development moves to https://gitlab.wikimedia.org/, it could be nice to have the ability to aggregate contribution data for https://gitlab.wikimedia.org/ also in WikiContrib. For this there would of course be two parts - generally, the API integration with GitLab in the back-end and then the inclusion of GitLab in the front-end as an option to the query and the resulting graph. Let me know if more information is needed.

Cheers! wkyoshida

wkyoshida commented 1 year ago

Seems that the GET /users/:id/events endpoint could be used for the GitLab contribution data.

Docs: https://docs.gitlab.com/ee/api/events.html#get-user-contribution-events

The action and target_type parameters could also be used to filter only for contribution events that would be relevant.

NdibeRaymond commented 1 year ago

hello @wkyoshida, thanks for submitting this PR! I will definitely start looking at merging this by weekend

wkyoshida commented 1 year ago

Hey @NdibeRaymond!

Atm I only have the issue created for this unfortunately, but I am happy to help with some development for it though. I'm thinking there might be some details also that likely might have to be defined first perhaps?

In the docs, I see that specific contribution types for each platform are considered for the purposes of WikiContrib:

In this tool, all the contributions of the user from Gerrit are being fetched. But in the case of phabricator, two kinds of tasks are taken into count:

  1. Tasks authored by the user.
  2. Tasks assigned to the user.

For Github, we are only concerned with the contributors commits.

For https://gitlab.wikimedia.org/, what contribution types does WikiContrib want to consider? Apart from this main detail though, my assumption is that the implementation for GitLab will likely follow into the same architecture of the other platforms and can likely piggy-back off of what exists already - would that be right. Would there be any other considerations to think through first?