Skip to content

Rails 4 and 5 specs erroneously running on docs-related branches

After the Rails 4 and 5 .gitlab-ci.yml changes that were merged today, all branches relating to docs (e.g. foo-docs) started to fail because these specs were run when they were not supposed to run (e.g. https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/120612617).

We can see that the except clause is being overwritten:

irb(main):011:0> pp jobs['rspec-mysql-rails4 10 30']
{"retry"=>1,
 "tags"=>["gitlab-org"],
 "except"=>
  {"variables"=>["$CI_COMMIT_REF_NAME =~ /norails4/", "$RAILS5_DISABLED"]},
 "cache"=>
  {"key"=>"debian-stretch-ruby-2.5.3-node-10.x",
   "paths"=>["vendor/ruby", ".yarn-cache/", "vendor/gitaly-ruby"],
   "policy"=>"pull"},
 "stage"=>"test",
 "script"=>
  ["JOB_NAME=( $CI_JOB_NAME )",
   "export CI_NODE_INDEX=${JOB_NAME[-2]}",
   "export CI_NODE_TOTAL=${JOB_NAME[-1]}",
   "export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json",
   "export KNAPSACK_GENERATE_REPORT=true",
Edited by Stan Hu