Skip to content

Geo: Remove Alternate URL

Michael Kozono requested to merge mk/remove-alternate-url into master

What does this MR do?

Removes Alternate URL which was introduced in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9544.

CE backport: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27074

From https://gitlab.com/gitlab-org/gitlab-ee/issues/9123#note_155318195:

...there's a fundamental problem with Alternate URL.

The concept of Alternate URL is essentially to replace External URL. Unfortunately, External URL is a fundamental attribute in GitLab Rails. It is used to build every absolute URL in the app. For example:

  • when displaying Git clone URLs (this issue)
  • when returning full URLs from the API
  • when sending an Email (and this is from Sidekiq)

Even if we did a great job overriding External URL with Alternate URL, here's how it would work:

  • Set up https://secondary
  • Set its Alternate URL to https://load-balancer (and restart all Rails instances BTW)
  • Send it traffic from https://load-balancer. This would work.
  • But, if https://secondary still receives traffic, then any URLs (like the git clone URL in this issue) would be "wrong", based on https://load-balancer. And don't forget, Sidekiq needs to know the root URL, so we can't assume we have a request.

I think it's accurate to say that GitLab Rails depends on a canonical root URL, therefore it can only properly serve one URL. And it would take a ton of work to remove this dependency.

And since we intend to simplify the URL situation, I think there is no longer a use-case for Alternate URL, so we should remove it.

Part of https://gitlab.com/gitlab-org/gitlab-ee/issues/9123.

Proof that I didn't break the UI doing this

UI_looks_fine_after_removing_Alternate_URL

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by 🤖 GitLab Bot 🤖

Merge request reports