Skip to content

Don't show 'Free Trial of GitLab.com Gold' message for readonly DB's

What does this MR do?

When the GitLab Gold trial callout is dismissed on a Geo secondary, it results in a HTTP 403 and red error alert because a Geo secondary is not permitted to perform DB writes:

Projects___Dashboard___GitLab_2018-11-27_14-04-04

This MR updates EE::UserCalloutsHelper.show_gold_trial?() to also consider !::Gitlab::Geo.secondary_with_primary? as part of the checks.

I also swapped the order of checks used in _gold_trial_callout.html.haml from:

- if show_gold_trial? && user_default_dashboard?

to:

- if user_default_dashboard? && show_gold_trial?

because I benchmarked each method and found .user_default_dashboard?() to require less resources so it makes sense running it first.

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ee/issues/8591

Does this MR meet the acceptance criteria?

Closes #8591 (closed)

Edited by Ash McKenzie

Merge request reports

Loading