Skip to content

Allow GITLAB_SIMULATE_SAAS outside development

Matthias Käppler requested to merge mk-always-allow-simulate-saas into master

What does this MR do and why?

In order to test changes in a GitLab test instance that uses a production Rails env (such as those deployed via GET), we need to drop the check that only interprets GITLAB_SIMULATE_SAAS when in development. This first came up here: https://gitlab.com/gitlab-org/gitlab/-/issues/373015#note_1242375786

We decided to address this by extending the existing check to also consider the current GitLab license being used. If it was issued to a GitLab team member (by looking at their email address), we also allow to simulate_saas? now. (See MR comments for how we arrived at this.)

I also fixed another smaller issue, which is that we did not default this to false. This was masked by the fact that the unit test explicitly set the env var to 0, but it's unlikely anyone will ever do that; it would be not set instead, which leads to Gitlab.to_boolean returning nil. While this is "falsey", it is cleaner to actually return false here.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

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

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 Matthias Käppler

Merge request reports