Skip to content

Run pipeline through WebIDE without committing

Problem to solve

When working on Gitlab CI/CD, it is often necessary to create test commits to see how the pipeline will run. These commits clutter up the history with commits which are not useful to roll-back to, as they are experiments rather than developments.

The same difficulty arises when using the WebIDE to work on any code in a project which requires going through the CI/CD pipeline to test the work done.

Intended users

DevOps Engineers, Developers

Further details

Example situation:

  • Add a new job to the .gitlab-ci.yml via the WebIDE
  • Run .gitlab-ci.yml through CI-linter to check syntax errors
  • With no syntax errors, commit changes to run pipeline
  • Pipeline fails
  • Commit new changes to fix mistakes
  • Repeat until pipeline succeeds

Re-basing/squasing would clean the history, but this may not be compatible with a team's merging policy.

Proposal

Add a way to run a pipeline on staged changes in the WebIDE, before commiting. To facilitate this, create a temporary commit for testing, but do not add it to the WebIDE's target branch. Since pipelines operate using information about the branch, it may be best to create a temporary branch for testing as well: treat this testing as a merge-request into the target branch.

Permissions and Security

The same permissions are are required to commit and run a pipeline on the (eventual) target branch.

Documentation

Testing

Ensure that test commits do not affect the target branch.

What does success look like, and how can we measure that?

Links / references

https://gitlab.com/gitlab-org/gitlab-ce/issues/58606