Commit Status API only creates branch pipelines, even if ref is a tag
Summary
The Commit Status API only creates branch pipelines, even if ref is a tag.
The ref parameter is used to set the ref in the created pipeline, but the tag attribute is never provided:
https://gitlab.com/gitlab-org/gitlab/-/blob/75db1c044bbb151266e7d0dbb5050b0167a2a4f1/app/services/ci/create_commit_status_service.rb#L113-129
And the default value for the tag column is false if not provided:
https://gitlab.com/gitlab-org/gitlab/-/blob/7cea882041755dd12e4e524d83af83bb609a2fa0/db/structure.sql#L5453
The documentation suggests you can supply a ref parameter that can either be a branch or tag. However, regardless of what type of ref it is, only branch pipelines are created:
https://docs.gitlab.com/api/commits/#set-commit-pipeline-status
| ref | string | No | The ref (branch or tag) to which the status refers. Must be 255 characters or fewer.
Steps to reproduce
- Create a new project
- Create a new commit in the project
- Create a new tag from main (
v0.0.1) - Call the Commit Status API to set the status for the commit SHA using the tag in the
refparameter
Example Project
What is the current bug behavior?
A branch pipeline is created with ref: "v0.0.1" and tag: false.
What is the expected correct behavior?
A tag pipeline is created with ref: "v0.0.1" and tag: true.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.