Remove dependency on the database from the shellcheck templates lint
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
The following discussion from !80435 (merged) should be addressed:
-
@kwiebers
started a discussion: (+4 comments)Is shellcheck a static analysis linter for the template files? If so, is there a need for Postgres or Rails cache?
@godfat-gitlab
:
This feels really heavy because even
setup-test-env
doesn't need to use the database, and a lot of our rake tasks don't need database either.
I wonder if it's possible to use
Gitlab::Ci::YamlProcessor
without booting the whole Rails application? In theory it shouldn't really need to connect to a database? I see if this takes too much effort to do, we can take that to next iteration.
@bwill
:
I tried to get this to work without the DB, but I can't seem to find a way to get the rails environment to load without the DB: https://gitlab.com/gitlab-org/gitlab/-/jobs/2129593347
Reading https://stackoverflow.com/questions/821251/how-to-configure-ruby-on-rails-with-no-database, I think we would probably have to add a new environment in
config/environments/
with no ActiveRecord, or maybe even control it with an environment variable inconfig/application.rb
. I would rather not touch those files as part of this MR, so I will leave that to a later iteration.