Add Gitlab relational data to API

Created on 19 November 2023, about 1 year ago
Updated 20 August 2024, 5 months ago

Problem/Motivation

I'd appreciate if projects and users returned by the d7-api would return the associated Gitlab ID for each.

Right now the only way to reliably determine the Gitlab ID for a d.o user is to heavily scrape the full Gitlab API. For the users who have an avatar, the avatar URL happens to have the d.o user ID in it, sadly not all users have an avatar. Its not possible to reliably match user/username etc. User (do: #3589086, gitlab: #41385) is a good example of this.

This kind of data will help consumers match existing collected data to Gitlab, especially if there is any API decommissioning in the future.

Steps to reproduce

Visit https://www.drupal.org/api-d7/user/123456.json or https://www.drupal.org/api-d7/node/123456.json for a project there is no relational data for Gitlab.

Proposed resolution

Visit https://www.drupal.org/api-d7/user/123456.json and see the Gitlab user ID.

Visit https://www.drupal.org/api-d7/node/123456.json for a project and see the Gitlab project ID.

Remaining tasks

Discuss and create MR.

User interface changes

Nil

API changes

New fields

Data model changes

Nil

Feature request
Status

Postponed

Version

3.0

Component

Code

Created by

🇦🇺Australia dpi Perth, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dpi
  • 🇦🇺Australia dpi Perth, Australia

    Note about not all users having an avatar :/

  • 🇦🇺Australia dpi Perth, Australia

    Being about to search the Gitlab API on the `identities` properties could also work.

    However, this data is not public data unless you are specifically requesting the current user.

    E.g for my user:

    identities	
      0	
        provider	"jwt"
        extern_uid	"dpi@81431.no-reply.drupal.org"

    But this data is not visible for other users, or is searchable/filterable on the `/users` endpoint as far as I can tell.

  • Status changed to Postponed 5 months ago
  • 🇺🇸United States drumm NY, US

    https://www.drupal.org/d7-api will not exist in any form once the site is upgraded past Drupal 7. It is not getting any additional functionality, unless it is needed for the upgrade.

    GitLab’s API is provided by GitLab and is not customizable.

    We can revisit this once Drupal.org is upgraded and we can see what is possible with jsonapi.

Production build 0.71.5 2024