Problem to solve
How to prevent Developer/ Maintainer to manually re-run any GitLab jobs of the successful pipeline.
Steps to reproduce
- Create a new pipeline which will executed on merge_request only.
- When any user creates a merge_request then the pipeline will get triggered.
- After successful pipeline execution , the user can have an access to the re-run option for any job of that pipeline.
When user click on Re-run UI menu then It will perform the same operations again and create duplicate data.
When Pipeline triggered on merge request and re-run the job manually, the value of the source parameter is “merge_request_event”. Hence it difficult to identify that the job executed in pipeline or manually.
Do we have any mechanism where we can prevent user to re-run the job for successful pipeline ?
CI_JOB_MANUALwith the description ofOnly available if the job was started manually. true when available.. While this wont prevent you being able to replay success jobs, you could have some logic that doesnt allow the job to be replayed based on this flag. However this will apply to replaying a failed job.