Some commit displays don't provide the cherry-pick option

Summary

Not all methods of viewing a commit in the UI will allow you to cherry-pick it:

  • If I go to a commit via Code → Commit in the left sidebar, Options → Cherry-pick is available in the top right corner.
  • If I go to a commit via merge request → Commits tab, Options → Cherry-pick is NOT shown.

Discovered in Cherry-picking page: review / test all tasks (!141438 - merged), specifically this thread: !141438 (comment 1720727851), as part of a FY24 OKR: https://gitlab.com/gitlab-org/technical-writing/-/issues/936+

Steps to reproduce

  1. The merge request !141438 (merged) contains multiple commits.
  2. Let's use the second commit, 73520775 (735207758373b27630f4677a15f3b60f5ce00b2d)
  3. Go to it via the merge request:
    1. Select the Commits tab.
    2. Select the commit.
    3. No cherry-pick option is displayed in the top right corner.
  4. Go to it via the project's commit list:
    1. In the left nav, go to Code → Commits. The commit is probably really far down in the commit list now, so I'll spare you the hunt and give you the direct link: 73520775
    2. This version of the commit page contains a cherry-pick option.

From talking with @thomasrandolph, the two pages are built by different code, which would explain the inconsistency. Is it high enough priority to fix? Likely not, at least in the short term, but the right thing to do is file an issue so I've at least spoken up:

Repository versus MR display of the same feature is sticky. Is this a UI bug? Sure! Should we fix it? Well, maybe? Do users care? Unifying the way we display the same feature across Diffs and Repository (Code Review & Source Code) is one of the sub-primary (not quite secondary!) goals of the New Diffs architecture work. So maybe a note or an issue somewhere mentioning that there's a difference here is enough and we'll eventually write some components that make this a single experience.

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Amy Qualls