gitlab-org--gitlab-foss/app
Sean McGivern f9c456bd0c Make performance bar enabled checks consistent
Previously, we called the `peek_enabled?` method like so:

    prepend_before_action :set_peek_request_id, if: :peek_enabled?

Now we don't have a `set_peek_request_id` method, so we don't need that
line. However, the `peek_enabled?` part had a side-effect: it would also
populate the request store cache for whether the performance bar was
enabled for the current request or not.

This commit makes that side-effect explicit, and replaces all uses of
`peek_enabled?` with the more explicit
`Gitlab::PerformanceBar.enabled_for_request?`. There is one spec that
still sets `SafeRequestStore[:peek_enabled]` directly, because it is
contrasting behaviour with and without a request store enabled.

The upshot is:

1. We still set the value in one place. We make it more explicit that
   that's what we're doing.
2. Reading that value uses a consistent method so it's easier to find in
   future.
2019-08-28 17:25:02 +01:00
..
assets Revert "Merge branch 'user-tracking-settings' into 'master'" 2019-08-26 22:16:23 +00:00
controllers Make performance bar enabled checks consistent 2019-08-28 17:25:02 +01:00
finders Add service classes for mutating AwardEmoji 2019-08-21 11:39:41 +12:00
graphql Replace echo function with a resolver 2019-08-26 17:43:38 +00:00
helpers Make performance bar enabled checks consistent 2019-08-28 17:25:02 +01:00
mailers Handle namespaced models 2019-08-21 19:23:27 +00:00
models Add encrypted optional option to DeployToken authentication field 2019-08-26 19:39:48 -07:00
policies Guard against deleted project feature entry 2019-08-26 13:37:42 -07:00
presenters Use ActiveModel's type instead of virtus 2019-08-20 10:52:21 +00:00
serializers Merge branch '66037-deployment-user' into 'master' 2019-08-23 20:50:01 +00:00
services Add usage pings for merge request creating 2019-08-26 14:30:45 +00:00
uploaders
validators
views Make performance bar enabled checks consistent 2019-08-28 17:25:02 +01:00
workers Merge branch 'master' into 'master' 2019-08-23 12:39:44 +00:00