Merge branch 'stable-3.10' * stable-3.10: Document Owned Files tab in the Change screen's owners UI Expire the owners cache after 1 minute and make it unlimited Optimize the 'path_owners_entries' cache eviction Introduce PathOwners cache from Ic7d61de07 Change-Id: I57d7ab110be6729e437e86add05df408b7c2ec9e
diff --git a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java index 901dbc8..aea33ff 100644 --- a/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java +++ b/owners-common/src/main/java/com/googlesource/gerrit/owners/common/PathOwnersEntriesCache.java
@@ -26,6 +26,7 @@ import com.google.inject.Module; import com.google.inject.Singleton; import com.google.inject.TypeLiteral; +import java.time.Duration; import java.util.Objects; import java.util.Optional; import java.util.concurrent.Callable; @@ -38,7 +39,9 @@ return new CacheModule() { @Override protected void configure() { - cache(CACHE_NAME, Key.class, new TypeLiteral<Optional<OwnersConfig>>() {}); + cache(CACHE_NAME, Key.class, new TypeLiteral<Optional<OwnersConfig>>() {}) + .maximumWeight(Long.MAX_VALUE) + .expireAfterWrite(Duration.ofSeconds(60)); bind(PathOwnersEntriesCache.class).to(PathOwnersEntriesCacheImpl.class); DynamicSet.bind(binder(), GitBatchRefUpdateListener.class) .to(OwnersRefUpdateListener.class);
diff --git a/owners/src/main/resources/Documentation/how-to-use.md b/owners/src/main/resources/Documentation/how-to-use.md index aa9191a..1ccff9d 100644 --- a/owners/src/main/resources/Documentation/how-to-use.md +++ b/owners/src/main/resources/Documentation/how-to-use.md
@@ -123,3 +123,28 @@ The owners status per file when [default submit requirements](config.html#owners.enableSubmitRequirement) are enabled doesn't differ from [submit requirements mode](#ownersStatus.submitRequirement.files). + +### Files that are assigned to the current user based on the OWNERS + +When the current user is mentioned directly or indirectly via a group +ownership as the owner of one or more files, the change screen displays +an additional tab called _Owned Files_. + + + +The tab indicates whether the current user has review duties based on the +icon displayed on the right side of the tab. If the icon is an orange +clock, the current user is required to review the files indicated in the +tab; otherwise, if the icon is a green tick, then the current user review +input is not strictly required for the change to be merged. + +The list of files included in the _Owned Files_ tab, a subset of the full +list displayed in the _Files_ tab, are the ones assigned to the +current user through the OWNERS file. + +> **NOTE**: When the `owners.config` has `owners.expandGroups = false` +> then the association between files and the current user may not be +> accurate or not available because of the lack of group expansion and +> account resolution service on the backend. In this case, the +> _Owned Files_ tab may be absent even if the current user is effectively +> owner of one or more files in the change.
diff --git a/owners/src/main/resources/Documentation/owned-files.png b/owners/src/main/resources/Documentation/owned-files.png new file mode 100644 index 0000000..f88cbee --- /dev/null +++ b/owners/src/main/resources/Documentation/owned-files.png Binary files differ