[go: up one dir, main page]

Skip to content

Assign service user contributions from Bitbucket Server to GitLab service user

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The following discussion from !165855 (merged) should be addressed:

  • @SamWord started a discussion: (+1 comment)

    I noticed there was a placeholder user I didn't add.

    It turns out I made a bitbucket server for myself a while ago, so I had an open pull request for some time. I guess after 21 weeks Bitbucket server just declines an open PR, but does so with a system user that gets imported as a placeholder

    image

    image

    Should those users be handled differently? It's like some kind of system user that doesn't make sense to map to a real user IMO.

Implementation suggestion

Bitbucket Server provides a user type in the API response. This is also included in the user data we get in API responses for things like pull requests.

curl http://user:pass@localhost:7990/rest/api/latest/users/bitbucket.system-user
{
  "name": "bitbucket.system-user",
  "active": true,
  "displayName": "Bitbucket",
  "id": 1,
  "slug": "bitbucket.system-user",
  "type": "SERVICE",
  "links": {
    "self": [
      {
        "href": "http://localhost:7990/bots/bitbucket.system-user"
      }
    ]
  }
}

We could:

  • Add this field to the user representation.
  • Pass the field to UserFinder#uid / UserFinder#author_id
  • If type == "SERVICE", return the service user.
  • Skip pushing references to service users.
Edited by 🤖 GitLab Bot 🤖