Allow bootsnap to be disabled
What does this MR do and why?
While diagnosing gitlab-development-kit!2236 (closed), I discovered there was no way to properly disable Bootsnap for gitlab-org/gitlab. This MR fixes that by allowing ENABLE_BOOTSNAP to be set to 0, no or false.
In this MR I also upgraded bootsnap from 1.4.6 to 1.9.1, added require: false given we only 'load' bootsnap if:
require 'bootsnap/setup' if ENV['RAILS_ENV'] != 'production' && !%w(0 no false).include?(ENV['ENABLE_BOOTSNAP'])
Related: gitlab-development-kit!2239 (merged)
How to set up and validate locally
-
In your GDK_ROOT/gitlab directory, check out the
ashmckenzie/allow-bootsnap-to-be-disabledbranch for GitLab:git fetch && git checkout ashmckenzie/allow-bootsnap-to-be-disabled -
In your GDK_ROOT directory, ensure you are up-to-date:
git fetch && git checkout main && git pull -r -
Disable
gitlab.rails.bootsnap:gdk config set gitlab.rails.bootsnap false -
Reconfigure your GDK:
gdk reconfigure -
Stop your GDK:
gdk stop && gdk kill -
Remove any existing bootsnap cache:
rm -rf gitlab/tmp/cache/bootsnap-* -
Start your GDK:
gdk start -
Wait until Rails has fully loaded (check http://localhost:3000)
-
Confirm that bootsnap has not recreated any cache:
ls -la gitlab/tmp/cache/bootsnap-*
It's also worth testing with a clean tmp/cache and gdk config set gitlab.rails.bootsnap true to verify that cache is still created by default or when gitlab.rails.bootsnap is explicitly set.
gdk config set gitlab.rails.bootsnap true && gdk reconfigure if you want the default behaviour to return.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.