Make `gitlab-ci.yml` for GitLab project compliant with Yamllint

Summary

All yaml inside project should be compliant with Yamllint https://yamllint.readthedocs.io. This does not affect the parsing of yaml, however, it does help with reading and debugging.

This is linked with:

  • Issues: #60818 (closed) #60819 (closed) #60283 (moved)
  • Merge Requests: $27453 $27576 $27579

Steps to reproduce

You would need to install yamllint (pip, apt-get etc... https://yamllint.readthedocs.io) and then run yamllint. I have included a custom .yamllint as rules extended for GitLab which suppresses issues with document-start (requiring --- at the start of yaml files and line-length as this is only a warning and likely needs extra understanding.

What is the current bug behavior?

will@ubuntu $ yamllint .gitlab/
.gitlab/route-map.yml
  2:27      warning  too few spaces before comment  (comments)
  3:21      warning  too few spaces before comment  (comments)

.gitlab/ci/pages.gitlab-ci.yml
  1:1       error    too many blank lines (1 > 0)  (empty-lines)

.gitlab/ci/global.gitlab-ci.yml
  3:12      warning  too few spaces before comment  (comments)

.gitlab/ci/rails.gitlab-ci.yml
  132:33    warning  too few spaces before comment  (comments)
  288:5     error    wrong indentation: expected 6 but found 4  (indentation)

.gitlab/ci/frontend.gitlab-ci.yml
  139:3     error    wrong indentation: expected 4 but found 2  (indentation)
  152:5     error    wrong indentation: expected 6 but found 4  (indentation)
  218:38    warning  too few spaces before comment  (comments)
  233:30    warning  too few spaces before comment  (comments)

What is the expected correct behavior?

(What you should see instead)

will@ubuntu $ yamllint .gitlab/
will@ubuntu $

^ No output.

Output of checks

This does not affect the reading or parsing of Yaml, it is only for linting compliance of coding standards.

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

I will submit a merge request shortly.

Edited Apr 23, 2019 by Will Hall
Assignee Loading
Time tracking Loading