0

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 ?

1
  • Not tried it but the docs seem to list the variable CI_JOB_MANUAL with the description of Only 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. Commented Sep 4 at 20:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.