DRY up "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}" from dependency proxy code
The following discussion from !54559 (merged) should be addressed:
-
@tkuah started a discussion: (+1 comment) non-blocking Should we extract
"#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}"
into it's own helper method, seeing it's used multiple times in various places ?
/cc @sabrams
$ gg "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}"
app/models/project.rb: variables.append(key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}")
app/models/project.rb: value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{namespace.root_ancestor.path}#{DependencyProxy::URL_SUFFIX}"
lib/gitlab/ci/build/credentials/registry/dependency_proxy.rb: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}"
spec/lib/gitlab/url_blocker_spec.rb: import_url = "http://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/t.git"
spec/lib/gitlab/url_blocker_spec.rb: web_url = "javascript://#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/t.git%0aalert(1)"
spec/models/ci/build_spec.rb: { key: 'CI_DEPENDENCY_PROXY_SERVER', value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}", public: true, masked: false },
spec/models/ci/build_spec.rb: value: "#{Gitlab.config.gitlab.host}:#{Gitlab.config.gitlab.port}/#{project.namespace.root_ancestor.path}#{DependencyProxy::URL_SUFFIX}",
Edited by Thong Kuah