"Run Pipeline" button appears on merge requests in projects that do not have pipelines for merge requests
Summary
We display the "Run Pipeline" button on the merge request pipelines tab even when pipelines for merge requests cannot be run.
Steps to reproduce
- Follow the reproduction steps in #324110 (closed) to persist a merge request pipeline with invalid YAML configuration syntax.
- See the "Run Pipeline" button appear when the invalid pipelines are created.
- Click "Run Pipeline" and get an error message.
What is the current bug behavior?
The "Run Pipeline" button appears.
What is the expected correct behavior?
The "Run Pipeline" button should not appear.
Why is this happening?
Part of the logic was removed from this button's display code:
Possible fixes
- Ensure that the most recent pipeline having the detached flag also has a valid CI configuration.
- To be more through, we should ensure that the ref that the new pipeline would point to has a valid CI configuration. It's possible that this may be different from the currently most-recent pipeline.
- We should ensure that the person clicking the button can, in fact, create a merge request pipeline. Not just that someone else has created one and assume the current user can as well.