DB fixture 17_cycle_analytics.rb fails on undefined method `success!' for nil
Summary
Execution of db/fixtures/development/17_cycle_analytics.rb by GDK failed with:
rake aborted!
NoMethodError: undefined method `success!' for nil:NilClass
(eval):210:in `block in deploy_to_production'
(eval):203:in `each'
(eval):203:in `deploy_to_production'
(eval):99:in `block (2 levels) in seed!'
/Users/brandonlabuschagne/.rvm/gems/ruby-2.6.3/gems/sidekiq-5.2.7/lib/sidekiq/testing.rb:16:in `__set_test_mode'
/Users/brandonlabuschagne/.rvm/gems/ruby-2.6.3/gems/sidekiq-5.2.7/lib/sidekiq/testing.rb:34:in `inline!'
(eval):68:in `block in seed!'
/Users/brandonlabuschagne/development/gdk-ee/gitlab/config/initializers/forbid_sidekiq_in_transactions.rb:8:in `skipping_transaction_check'
(eval):67:in `seed!'
The problem is that project is nil because there are no ci_builds records returned by merge_request.head_pipeline.builds.where.not(environment: nil). Those records are supposed to be created by the run_builds method in the file.
Steps to reproduce
Follow the Set up GDK instructions.
What is the current bug behavior?
Execution of db/fixtures/development/17_cycle_analytics.rb by GDK fails.
What is the expected correct behavior?
Execution of db/fixtures/development/17_cycle_analytics.rb by GDK succeeds.
Relevant logs and/or screenshots
- Reported in #36649 (comment 246256935)
- Commit introducing the relevant code: 2110989f
Possible fixes
Changing save_on_errors: false to save_on_errors: true on line 186 allows execution to succeed.
Edited by Dan Jensen