AbstractGetCodeOwnersForPath: Add a comment
I keep forgetting why we need to inspect all relevant code owner config
files even if we already have found more code owners than the limit. Add
a comment about this.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I2695d16d71e9758975cdfa93f887ce098aa42ad1
diff --git a/java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java b/java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java
index 6f11173..6b5b28d 100644
--- a/java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java
+++ b/java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java
@@ -204,6 +204,11 @@
}
}
+ // We always need to iterate over all relevant OWNERS files (even if the limit has already
+ // been reached).
+ // This is needed to collect distance scores for code owners that are mentioned in the
+ // more distant OWNERS files. Those become relevant if further scores are applied later
+ // (e.g. the score for current reviewers of the change).
return true;
});