A lot of constants redefinition warnings
We now have this when the application is loaded:
lib/gitlab.rb:12: warning: already initialized constant Gitlab::COM_URL
lib/gitlab.rb:12: warning: previous definition of COM_URL was here
lib/gitlab.rb:13: warning: already initialized constant Gitlab::APP_DIRS_PATTERN
lib/gitlab.rb:13: warning: previous definition of APP_DIRS_PATTERN was here
lib/gitlab.rb:14: warning: already initialized constant Gitlab::SUBDOMAIN_REGEX
lib/gitlab.rb:14: warning: previous definition of SUBDOMAIN_REGEX was here
lib/gitlab.rb:15: warning: already initialized constant Gitlab::VERSION
lib/gitlab.rb:15: warning: previous definition of VERSION was here
lib/gitlab.rb:16: warning: already initialized constant Gitlab::REVISION
lib/gitlab.rb:16: warning: previous definition of REVISION was here
lib/gitlab/webpack/manifest.rb:7: warning: already initialized constant Gitlab::Webpack::Manifest::AssetMissingError
lib/gitlab/webpack/manifest.rb:7: warning: previous definition of AssetMissingError was here
lib/omni_auth/strategies/jwt.rb:7: warning: already initialized constant OmniAuth::Strategies::JWT::ClaimInvalid
lib/omni_auth/strategies/jwt.rb:7: warning: previous definition of ClaimInvalid was here
lib/rspec_flaky/report.rb:11: warning: already initialized constant RspecFlaky::Report::OUTDATED_DAYS_THRESHOLD
lib/rspec_flaky/report.rb:11: warning: previous definition of OUTDATED_DAYS_THRESHOLD was here
It could be reproduced by running rake dev:load
. Why static-analysis
didn't catch this? If I update it to make it run only rake dev:load
, I see this locally:
> ./scripts/static-analysis
$ bin/rake dev:load
==> Finished in 53.45439708 seconds
===================================================
All static analyses passed successfully, but we have warnings:
**** bin/rake dev:load had the following warning(s):
...
But it's not the case on CI: https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/68931239
So we have two problems here:
-
static-analysis
didn't catch this - We got a lot of warnings
/cc @rymai @rspeicher