[go: up one dir, main page]

Add committer avatar and profile URL fields to GraphQL API

What does this MR do and why?

This MR adds three new GraphQL fields to the CommitType to support displaying committer avatar and profile links in the UI.

The new fields are:

  • committerAvatarUrl: Returns the committer's avatar (GitLab or Gravatar)
  • committerWebUrl: Returns the committer's profile URL (if GitLab user)
  • committer: Returns the full User object (if GitLab user)

This is the backend portion of the feature to display committer information in the last commit info box. The frontend changes are in a separate MR !207302 which will be merged after this.

Fixes #551775

How to set up and validate locally

Detailed explanation: !207302 (comment 2798953831)

I tested this using the GraphQL explorer at http://localhost:3000/-/graphql-explorer.

Test Query:

query {
  project(fullPath: "root/asdf") {
    repository {
      lastCommit {
        committerName
        committerEmail
        committerAvatarUrl
        committerWebUrl
        committer {
          name
          username
          webPath
          avatarUrl
        }
      }
    }
  }
}

Follow-up

Frontend MR: !207302

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading