Skip to content

Decorate git-notes with Merge Request information

Problem to solve

A lot of Gitlab concepts, like merge request, CI pipelines, issues are not native to git. This creates a lot of friction in Dev Experience when they have to relies on the web ui to navigate around.

Intended users

User experience goal

User should be able to obtain basic information about Gitlab concepts such as Merge Requests, Pipelines without having to leave the terminal.

Proposal

According to @jramsay in gitlab-foss#13899 (comment 179112967), git-notes is not on Gitlab roadmap but you folks might accept community contribution.

But I think it would be quite a simple implementation for Gitaly to support git-notes. So I want to put the idea forward before I start any implementation.

The value here is that with git-notes, developer can get a lot of metadata information about merge request or code review information, which are native to Gitlab but is not native to Git, using git-log.

Further details

Implementation steps

  1. Adding a GRPC in Gitaly to support adding/remove/prune git-notes.
  2. Adding a Pre-Receive git hook to block user update on some special internal git-notes refs (so these refs cannot be tampered with by users). i.e. refs/notes/internal/merge-requests and refs/notes/internal/pipelines
  3. Adding a client call from Gitlab (rails) side to create a git-note in a special refs every time a merge request was merged. Effectively decorate all commits in a merged MR with the Merge Request URL and Reviewer / Approver / Merge Time / Target Branch information.
  4. Adding documentation guiding user to fetch these special refs to decorate their git-log on client-side.

Eventually I would like to extend this to not just capture Merge Request information, but also code review discussions and deployments.

It would also be nice to have a REST API to add git notes so that external services could decorate git log with other information as well (CD/CI status, Deployments, Audit, Security Scan, Code Quality etc).

The goal here is to improve client side Dev/User Experience for Gitlab (without having to create a dedicated client/wrapper around git).

Links / references

References: