143fc48aba
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. |
||
---|---|---|
.. | ||
api | ||
assets | ||
backup | ||
banzai | ||
bitbucket | ||
ci | ||
constraints | ||
container_registry | ||
declarative_policy | ||
generators/rails/post_deployment_migration | ||
github | ||
gitlab | ||
json_web_token | ||
mattermost | ||
microsoft_teams | ||
omni_auth | ||
peek/rblineprof | ||
rouge | ||
support | ||
system_check | ||
tasks | ||
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 | ||
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 |