Preparing auto-deploy branches can fail to notify Slack
In https://ops.gitlab.net/gitlab-org/release/tools/-/jobs/1439031 the following error was produced:
2020-07-14 12:52:03.507408 I ReleaseTools::Tasks::AutoDeploy::Prepare -- Notifying the operation results on slack
2020-07-14 12:52:03.507625 F Rake::Task -- Task failed -- Exception: NoMethodError: undefined method `project' for nil:NilClass
/builds/gitlab-org/release/tools/lib/release_tools/slack/auto_deploy_notification.rb:24:in `block in on_create'
/builds/gitlab-org/release/tools/lib/release_tools/slack/auto_deploy_notification.rb:23:in `map'
/builds/gitlab-org/release/tools/lib/release_tools/slack/auto_deploy_notification.rb:23:in `on_create'
/builds/gitlab-org/release/tools/lib/release_tools/tasks/auto_deploy/prepare.rb:42:in `notify_results'
/builds/gitlab-org/release/tools/lib/release_tools/tasks/auto_deploy/prepare.rb:17:in `execute'
/builds/gitlab-org/release/tools/lib/tasks/auto_deploy.rake:13:in `block (2 levels) in <top (required)>'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `block in execute'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `each'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:273:in `execute'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.6.0/monitor.rb:235:in `mon_synchronize'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:194:in `invoke_with_call_chain'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/task.rb:183:in `invoke'
/builds/gitlab-org/release/tools/Rakefile:18:in `invoke'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:160:in `invoke_task'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `each'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:116:in `block in top_level'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:125:in `run_with_threads'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:110:in `top_level'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:83:in `block in run'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/lib/rake/application.rb:80:in `run'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/bin/rake:23:in `load'
/builds/gitlab-org/release/tools/vendor/ruby/2.6.0/bin/rake:23:in `<top (required)>'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `load'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:463:in `exec'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/2.6.0/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
While this doesn't seem to block the creation of auto-deploy branches, it does lead to pipeline failures.
@rspeicher is this perhaps related to your recent refactoring of auto-deploy notifications?