CI when option to automatically trigger manual step after a first full pipeline success

Description

Add a new CI when property to trigger some steps after a first pipeline success on the given branch.

Proposal

The new when option could be named:

manual_until_success, pipeline_succeeed_once or complete_run_success

Overview

We should be able to set a job on the pipeline to be executed:

  • manually until the job was triggered manually and pipeline was run at least one time completely and successfully
  • THEN automatically in subsequent runs if pipeline succeeded at least one time

The main problem should to consider this job to be manual until a flag is properly set to tell gitlab the pipeline was ran completely (I mean including the manually triggered job) and successfuly at least one time.

Is this kind of flag possible to save and where.

Use cases

The pipeline for the project has a deploy step.

When working on the branch, I may not want to deploy before the branch reach a certain maturity. So this step should be manual at first. For example the deploy step could provision a machine on AWS and I don't want to pay this machine until I'm ready to see my branch deployed.

When I'm ready I trigger the step manually.

On the pipeline success, some flag could be recorded in Gitlab to remember this pipeline was run entirely and successfully one time at least.

From there, all subsequent next pipelines execution on this branch should trigger automatically the deploy step without manual action.

Feature checklist

Make sure these are completed before closing the issue, with a link to the relevant commit.

  • Feature assurance
  • Documentation
  • Added to features.yml
Assignee Loading
Time tracking Loading