The commits page does not display any pipelines when viewing a commit (e.g. via the ref selector dropdown)
Related to Tag list page links to latest pipeline of the c... (#347526)
When viewing the commits page and selecting a commit sha as the ref do not display the pipeline statuses next to the commits.
This happens because the backend is attempting to send the commit sha to the backend as a ref. The root cause of this is how we define routes in rails, the route includes a :ref parameter /:project_id/-/commits/:ref, however, a commit sha is not a ref compatible with ci pipelines as we always expect them to be run within a branch or tag context, not in a detached head state.
The fix for this would be to check if the params[:ref] value looks like a commit sha and nullify it. This will work as the graphql logic for these pipelines is nested under the lastCommit node and then we extract the sha value from the commit. So when we eventually lookup the pipeline it would be ref: nil, sha: commit.sha. This will allow us to find pipelines applicable to any ref.
In practice this will mean when viewing commits in a detached head state we would show pipelines from multiple refs in the list.