Frontend: Show Pipeline tab on MR if no pipeline ever ran
If a project has merge request pipelines configured, but for some reason no merge request pipeline was started. There is no manual way to create a new Merge Request pipeline, therefore the MR cannot be merged. This happened on a recent community contribution (!60168 (merged)). One can also not start a pipeline via the normal <project>/-/pipelines/new
interface because that only triggers branch pipelines.
In this specific case there is likely an edge case because of forks.
Workaround: Issuing a manual POST request to: https://gitlab.com/api/v4/projects/<id>/merge_requests/<iid>/pipelines
:
curl --header "PRIVATE-TOKEN: <API_TOKEN>" -X POST --data-raw='' \
'https://gitlab.com/api/v4/projects/<id>/merge_requests/<iid>/pipelines'
Screenshot of the MR interface below, notably missing the Pipelines tab
. So even if #326541 (closed) were solved, there would be no way to run a pipeline in an MR where no pipeline ran before.
Proposal(Updated)
Given merge request pipelines are enabled for a project
And No Pipeline ran
When I am on the Merge Request Page
Then I see the pipelines tab with 0 run pipelines
And I can click the tab
And I see an empty state where I can "Run a pipeline"
- When pipelines are enabled for a project always show the tab on the MR page
- Don't show the
Run pipeline
button in the following cases:- when no pipeline exists for the project. In this case we go ahead with the current banner for creating a pipeline.
- when pipeline is not configured to run on the branch in use. We should surface a warning making a mention of that