Using 'Run Pipeline' for a branch without build tasks creates an uncancel-able pipeline
Summary
Creating a pipeline for a branch without any build tasks will produce a pipeline that cannot be cancelled.
The new pipeline is stuck in pending status. If the old and new branch share the same HEAD, the commit shows a running status.
Steps to reproduce
- Create a .gitlab-ci.yml file with at least one task that applies only to one branch (e.g.,
master@group/repo
). - Create a new branch from that branch (
bompus
in screenshots), retaining the .gitlab-ci.yml file. This branch shouldn't match the first branch. - From the Pipelines page of the project, click 'Run pipeline'.
- Enter the second branch's name (
bompus
). - Click 'Create pipeline'.
Once reproduced, the only way to stop this pipeline is to update the pipeline's record in the ci_commits table.
Expected behavior
The pipeline should be either complete (since it has no tasks) or not created (since it can't possibly run anything). The commit should not be stuck in a 'running' state.
Relevant logs and/or screenshots
Nothing I've noticed in logs for this. Seems to be OK with everything.
Pipelines list
Pipeline view
Builds tab for commit
Output of checks
Results of GitLab Application Check
Moved to check.txt because it's kind of big.
Results of GitLab Environment Info
Hostname of the installation has been omitted.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.8p440
Gem Version: 2.5.1
Bundler Version:1.10.6
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.10.6
Revision: ea71c20
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://hostname-omitted
HTTP Clone URL: https://hostname-omitted/some-group/some-project.git
SSH Clone URL: git@hostname-omitted:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: google_oauth2
GitLab Shell
Version: 3.2.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git