Make `lib/gitlab/build/trigger.rb` more robust
As you can see in https://gitlab.com/gitlab-org/omnibus-gitlab/-/jobs/76141216, sometimes GitLab will fail momentarily and return a GitLab is not responding
response, then the pipeline waiter in lib/gitlab/build/trigger.rb
will fail when trying to parse the response since it's not a valid JSON.
$ bundle exec rake qa:test
Triggered https://gitlab.com/gitlab-org/gitlab-qa/pipelines/24210427
Waiting for downstream pipeline status
......................rake aborted!
JSON::ParserError: 743: unexpected token at 'GitLab is not responding'
/builds/gitlab-org/omnibus-gitlab/gems/ruby/2.3.0/gems/json_pure-1.8.1/lib/json/common.rb:155:in `parse'
/builds/gitlab-org/omnibus-gitlab/gems/ruby/2.3.0/gems/json_pure-1.8.1/lib/json/common.rb:155:in `parse'
/builds/gitlab-org/omnibus-gitlab/lib/gitlab/build/trigger.rb:65:in `status'
/builds/gitlab-org/omnibus-gitlab/lib/gitlab/build/trigger.rb:34:in `block in wait!'
/builds/gitlab-org/omnibus-gitlab/lib/gitlab/build/trigger.rb:31:in `loop'
/builds/gitlab-org/omnibus-gitlab/lib/gitlab/build/trigger.rb:31:in `wait!'
/builds/gitlab-org/omnibus-gitlab/lib/gitlab/tasks/qa.rake:65:in `block (2 levels) in <top (required)>'
/usr/local/bin/bundle:22:in `load'
/usr/local/bin/bundle:22:in `<main>'
We should make this more robust and simply return a :running
status in that case so that the job continues to wait. In the case GitLab is still failing to answer with a valid JSON response, we have a 2h timeout for the job anyway.