gitlab-org--gitlab-foss/lib
Lin Jen-Shin 143fc48aba Add RequestStoreWrap to cache via RequestStore
I don't like the idea of `RequestStore` at all, because it's just a
global state which shouldn't be used at all. But we have a number of
places calling `ProtectedBranch.protected?` and `ProtectedTag.protected?`
in a loop for the same user, project, and ref whenever we're checking
against if the jobs for a given pipeline is accessible for a given user.
This means we're effectively making N queries for the same thing over
and over.

To properly fix this, we need to change how we check the permission,
and that could be a huge work. To solve this quickly, adding a cache
layer for the given request would be quite simple to do.

We're already doing this in Commit#author, and this is extending that
idea and make it generalized.
2017-07-17 23:24:46 +08:00
..
api Merge branch 'fixes-for-internal-auth-disabled' into 'master' 2017-07-14 08:49:36 +00:00
assets
backup
banzai Merge branch 'acet-fix-tooltip-placement' into 'master' 2017-07-06 19:01:04 +00:00
bitbucket
ci Pass before_script and script as-is preserving arrays 2017-07-07 14:42:54 +02:00
constraints
container_registry
declarative_policy
generators/rails/post_deployment_migration
github
gitlab Add RequestStoreWrap to cache via RequestStore 2017-07-17 23:24:46 +08:00
json_web_token
mattermost
microsoft_teams
omni_auth
peek/rblineprof Improve & fix the performance bar UI and behavior 2017-07-06 19:37:31 +00:00
rouge
support
system_check
tasks Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
additional_email_headers_interceptor.rb
banzai.rb
declarative_policy.rb
disable_email_interceptor.rb
email_template_interceptor.rb
event_filter.rb
expand_variables.rb
extracts_path.rb
feature.rb Re-add Feature.register_feature_groups which is already documented 2017-07-10 15:56:23 +02:00
file_size_validator.rb
file_streamer.rb
gitlab.rb
gt_one_coercion.rb
repository_cache.rb
static_model.rb
system_check.rb
unfold_form.rb
uploaded_file.rb
version_check.rb