Skip to content

Missing git tags in CI jobs

Summary

Git tags are missing in jobs that are running on Gitlab runner 12.5.0-rc1, where they are present in jobs that are running version 12.4.1

Steps to reproduce

We are using git-semrel for our automated semantic versioning, and this is now failing because it can not find the preceding versions.

.gitlab-ci.yml
release/cut:
  stage: release
  image: registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1
  script:
    - release next-version
    - release tag
  allow_failure: false
  only:
    variables:
      - $CI_COMMIT_TITLE =~ /^\s*(?:feat|fix|refactor|perf|docs|style|test)\s*(?:\([^\)]*\))?:\s*[^\n]*/ || $CI_COMMIT_MESSAGE =~ /BREAKING\s*(?:CHANGE)?:?/

Actual behavior

Fails on trying to cut a release that already exists.

Expected behavior

Cut a new release based on the tags that are available in the repository.

Relevant logs and/or screenshots

job log

Failed job on rc-1:

Running with gitlab-runner 12.5.0-rc1 (b295d93b)
  on docker-auto-scale fa6cab46
Using Docker executor with image registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Using docker image sha256:ad6bec6c16fa222e55f37513bd4cfa2836beeea34cbaeefefd613494e3d182e0 for registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Running on runner-fa6cab46-project-15066787-concurrent-0 via runner-fa6cab46-srm-1573544172-3df4eda3...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/synadia/ops/registry/dind-aws/.git/
Created fresh repository.
From https://gitlab.com/synadia/ops/registry/dind-aws
 * [new ref]         refs/pipelines/95258289 -> refs/pipelines/95258289
 * [new branch]      master                  -> origin/master
Checking out 573c8d7e as master...

Skipping Git submodules setup
Authenticating with credentials from job payload (GitLab Registry)
$ release next-version
0.1.0
$ release tag
release create: POST https://gitlab.com/api/v4/projects/synadia/ops/registry/dind-aws/releases: 409 {message: Release already exists}

Not trying to continue after this kind of error.
If you think recovery should be attempted, please create an issue
at https://gitlab.com/juhani/go-semrel-gitlab/issues/new
or by email incoming+juhani/go-semrel-gitlab@incoming.gitlab.com
2019/11/12 07:37:38 workflow execution failed
ERROR: Job failed: exit code 1

Same job, on same commit but different gitlab-runner version yet this one works:

Running with gitlab-runner 12.4.1 (05161b14)
  on docker-auto-scale ed2dce3a
Using Docker executor with image registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Authenticating with credentials from job payload (GitLab Registry)
Pulling docker image registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Using docker image sha256:ad6bec6c16fa222e55f37513bd4cfa2836beeea34cbaeefefd613494e3d182e0 for registry.gitlab.com/juhani/go-semrel-gitlab:v0.21.1 ...
Running on runner-ed2dce3a-project-15066787-concurrent-0 via runner-ed2dce3a-srm-1573544339-2796a715...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/synadia/ops/registry/dind-aws/.git/
Created fresh repository.
From https://gitlab.com/synadia/ops/registry/dind-aws
 * [new ref]         refs/pipelines/95258684 -> refs/pipelines/95258684
 * [new branch]      master                  -> origin/master
 * [new tag]         v0.1.0                  -> v0.1.0
 * [new tag]         v0.1.1                  -> v0.1.1
 * [new tag]         v0.2.0                  -> v0.2.0
Checking out 573c8d7e as master...

Skipping Git submodules setup
Authenticating with credentials from job payload (GitLab Registry)
$ release next-version
0.2.1
$ release tag
Job succeeded

Environment description

We're using the shared runners on Gitlab.com

Used GitLab Runner version

See the logs above.

Possible fixes

Edited by Zeger-Jan van de Weg
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information