Skip to content

Fix a typo in the suggested-reviewers secret creation block

What does this MR do?

This fixes an typo error introduced in !6560 (merged), causing an undefined method `[]' for nil:NilClass error during reconfigure when upgrading, see gitlab-com/gl-infra/production#8193 (closed)

Recipe: gitlab::default
  * directory[/etc/gitlab] action create (up to date)

  ================================================================================
  Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
  ================================================================================

  NoMethodError
  -------------
  undefined method `[]' for nil:NilClass

  Cookbook Trace: (most recent call first)
  ----------------------------------------
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:416:in `block in from_file'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:408:in `from_file'
    /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:87:in `from_file'

  Relevant File Content:
  ----------------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/gitlab-rails.rb:

  409:    link_from File.join(gitlab_rails_source_dir, '.gitlab_suggested_reviewers_secret')
  410:    link_to File.join(gitlab_rails_etc_dir, 'gitlab_suggested_reviewers_secret')
  411:    source 'secret_token.erb'
  412:    owner 'root'
  413:    group 'root'
  414:    mode '0644'
  415:    sensitive true
  416>>   variables(secret_token: node['gitlab']['suggested-reviewers']['api_secret_key'])
  417:    dependent_services.each { |svc| notifies :restart, svc }
  418:    only_if { node['gitlab']['suggested-reviewers']['api_secret_key'] }
  419:  end
  420:
  421:  rails_env = {
  422:    'HOME' => node['gitlab']['user']['home'],
  423:    'RAILS_ENV' => node['gitlab']['gitlab-rails']['environment'],
  424:  }
  425:

Related issues

corrective action for 2022-12-28: dev.gitlab.org is down (gitlab-com/gl-infra/production#8193 - closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by Pierre Guinoiseau

Merge request reports