Enable convenient typing of LocalSite-or-ALL parameters.
Review Request #13144 — Created July 13, 2023 and submitted
Review Board 5 introduced a
LocalSite.ALL
value, which could be used
to query state without considering aLocalSite
value (as opposed to a
None
value for the global site). This was a bit hard to type
correctly, and we ran the risk of different blocks of code attempting
their own typing.This change introduces an
AnyOrAllLocalSites
type, which supports a
LocalSite
instance,None
, orALL
.To make this work,
ALL
needed to be converted from a singleton object
to a value supported inLiteral
. The safest approach was to use an
enum (which won't unintentionally cast to a string or integer in a
query). So we now have a private enum with only anALL
value.
All unit tests pass.
Summary | ID |
---|---|
6b30c79b3751319859b45defba9002ad47e33abd |