Support hyphens in GitLab subdomain regex

What does this MR do and why?

MR adds support for hyphens in GitLab subdomains to allow Staging Ref environment be considered as GitLab subdomain.

All previous x.gitlab.com environments only had letters in them (like staging.gitlab.com or pre.gitlab.com). Staging Ref has - in the domain staging-ref.gitlab.com and it affects how environment is configured. Specifically paid tiers plans are unavailable because Gitlab.dev_env_org_or_com? returns false - see #342150 (comment 819512595) for further details.

Per suggestion in !79158 (comment 822753052), a follow on this MR would be to update .staging? method to return true for Staging Ref.

Related to #342150 (closed)

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Check new regex using Staging Ref url:
    %r{\Ahttps://[a-z0-9-]+\.gitlab\.com\z} === "https://staging-ref.gitlab.com"
    => true

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nailia Iskhakova

Merge request reports

Loading