commit | bf5ccb94943bbce279f9b8f2beb7a64444abab7b | [log] [tgz] |
---|---|---|
author | Edwin Kempin <ekempin@google.com> | Tue Aug 31 15:13:37 2021 +0200 |
committer | Edwin Kempin <ekempin@google.com> | Tue Aug 31 15:21:08 2021 +0200 |
tree | 34a65cc24f3dde8f32c6c2260d81df67eaba5f61 | |
parent | d45c8c489843d58d694f93c567d27d71e650b7a5 [diff] |
ChangedFiles: Check experiment flag only when current user is available Checking whether the experiment flag for using the diff cache is set requires a current user, at least with the Google implementation of experiment flags. If a current user is not available a warning is logged and the experiment flag is considered as not set. Since ChangedFiles is called from a background thread regularly (e.g. when indexing a change) we see this warning frequently. Fix this by checking for the experiment flag only when a current user is available, otherwise return false to not use the diff cache in this case. Alternatively it was considered to make a current user available by opening a ManualRequestContext, but we don't have a suitable user available that should be provided as current user and providing the internal user would always evaluate to false, since experiment flags are never set for the internal user. This means we better directly return false in this case. Bug: Google b/191961988 Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ia0359f5e8ea661df734b53739772e4b2282e2bcc
This plugin provides support for defining code owners for files in a repository.
If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.
Also see resources/Documentation/about.md.
IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md.