Skip to content

Reintroduce dropping of default Gitconfig values

Patrick Steinhardt requested to merge pks-reintroduce-drop-git-defaults into master

What does this MR do?

This MR reintroduces !6598 (merged), which had to be revert in !6608 (merged) due to a regression.

The regression was able to sneak in because we were lacking test coverage that verified whether we actually rendered the gitconfig files correctly. This MR thus adds a preparatory commit that introduces additional tests for rendering both the system- and user-level gitconfig, which I have verified to indeed trigger the bug. The bug itself was trivial to fix:

diff --git a/files/gitlab-cookbooks/gitlab/recipes/default.rb b/files/gitlab-cookbooks/gitlab/recipes/default.rb
index 63e767618..187b39db9 100644
--- a/files/gitlab-cookbooks/gitlab/recipes/default.rb
+++ b/files/gitlab-cookbooks/gitlab/recipes/default.rb
@@ -70,7 +70,7 @@ end
 template "#{install_dir}/embedded/etc/gitconfig" do
   source "gitconfig-system.erb"
   mode 0755
-  variables gitconfig: node['gitlab']['omnibus-gitconfig']['system']
+  variables gitconfig: node.dig('gitlab', 'omnibus-gitconfig', 'system') || {}
 end
 
 # This recipe needs to run before gitlab-rails

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

Merge request reports