summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Hiesel <hiesel@google.com>2022-05-12 14:58:30 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2022-05-12 14:58:30 +0000
commit309272bffd71f1f09089e95cb2e9d654d39fcec2 (patch)
tree4fc066fa82105709c300222c220c4a9213592327
parentd10ac8ca1a32f1d9356287aa9d3a4a28523158d2 (diff)
parentc3c8b313e86edb75cd535c04c0dd2c03576c5a9e (diff)
Merge "Load change notes eagerly to omit unparsable changes from results" into stable-3.6
-rw-r--r--java/com/google/gerrit/server/permissions/GitVisibleChangeFilter.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/java/com/google/gerrit/server/permissions/GitVisibleChangeFilter.java b/java/com/google/gerrit/server/permissions/GitVisibleChangeFilter.java
index 5a7b3cb2dc..506d292e3a 100644
--- a/java/com/google/gerrit/server/permissions/GitVisibleChangeFilter.java
+++ b/java/com/google/gerrit/server/permissions/GitVisibleChangeFilter.java
@@ -100,7 +100,11 @@ public class GitVisibleChangeFilter {
.map(
id -> {
try {
- return changeDataFactory.create(projectName, id);
+ ChangeData cd = changeDataFactory.create(projectName, id);
+ cd.notes(); // Make sure notes are available. This will trigger loading notes and
+ // throw an exception in case the change is corrupt and can't be loaded. It will
+ // then be omitted from the result.
+ return cd;
} catch (Exception e) {
// We drop changes that we can't load. The repositories contain 'dead' change refs
// and we want to overall operation to continue.