ConfigNotesMigration: Allow "sequence" option name
checkConfig was helpfully sanity-checking values in the noteDb sections, and I forgot to add "sequence" as an allowed option. This was not caught because although the NotesMigration interface got plenty of testing, it was all via TestNotesMigration in acceptance tests, not ConfigNotesMigration. Change-Id: I09f8ad4f049501b99e7770cafc80dcc80d84b2f3
This commit is contained in:
@@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.gerrit.server.notedb.NoteDbTable.ACCOUNTS;
|
||||
import static com.google.gerrit.server.notedb.NoteDbTable.CHANGES;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.gerrit.server.config.GerritServerConfig;
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Inject;
|
||||
@@ -57,12 +58,12 @@ public class ConfigNotesMigration extends NotesMigration {
|
||||
for (NoteDbTable t : NoteDbTable.values()) {
|
||||
keys.add(t.key());
|
||||
}
|
||||
Set<String> allowed = ImmutableSet.of(READ, WRITE, SEQUENCE);
|
||||
for (String t : cfg.getSubsections(NOTE_DB)) {
|
||||
checkArgument(keys.contains(t.toLowerCase()),
|
||||
"invalid NoteDb table: %s", t);
|
||||
for (String key : cfg.getNames(NOTE_DB, t)) {
|
||||
String lk = key.toLowerCase();
|
||||
checkArgument(lk.equals(WRITE) || lk.equals(READ),
|
||||
checkArgument(allowed.contains(key.toLowerCase()),
|
||||
"invalid NoteDb key: %s.%s", t, key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user