Gate new container registry features behind a `!Gitlab.jh?` check
Context
Since &5523 (closed), we're running a new version of the container registry on GitLab.com and other on self-managed instances. On the Rails codebase we have been gating changes related to the new registry version behind a Gitlab.com?
check (example).
Problem
It seems like the Gitlab.com?
will also evaluate to true
for JiHu GitLab. I found instances (example) where Gitlab.com? && !Gitlab.jh?
is used to determine if the code is running on GitLab.com only.
This means that this code might be currently enabled on JiHu GitLab which should not be the case as the new registry is only available on GitLab.com.
This is less problematic because we usually perform an additional check against #supports_gitlab_api?
, which should evaluate to false
unless the registry is indeed the new one (example). Nevertheless, better safe than sorry so we should be more explicit.
Solution
Add a && !Gitlab.jh?
to all places in the Rails codebase where we're gating features related to the new registry version. There is an open MR which is adding a new Gitlab.com_except_jh?
check that will do both (!116720 (merged)), so use that if possible.