Don't show 'Free Trial of GitLab.com Gold' message for readonly DB's
requested to merge 8591-geo-http-403-when-dismissing-free-trial-of-gitlab-com-gold-message into master
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:
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?
[ ] Changelog entry added, if necessary[ ] Documentation created/updated-
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides [ ] Conforms to the database guides- ~~[ ] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.~~
-
EE specific content should be in the top level /ee
folder [ ] For a paid feature, have we considered GitLab.com plans, how it works for groups, and is there a design for promoting it to users who aren't on the correct plan?-
Security reports checked/validated by reviewer
Closes #8591 (closed)
Edited by Ash McKenzie