Introduce LocalSite.ALL as a method for querying across all LocalSites.
Review Request #12328 — Created June 2, 2022 and submitted
The common query methods for review requests, review groups, and
repositories had one parameter for specifying aLocalSiteand another
(show_all_local_sites) for specifying if the query should be across
allLocalSites.As we begin to add more methods for calculating
LocalSite-related
stats, we have more cases where callers need to be able to provide a
LocalSite, the global site, or specify "across all sites". Keeping
this two-parameter approach just makes all this more complicated and
messy, so this change introduces a new approach.There's now a
LocalSite.ALLvalue that represents "across all sites".
Functions can optionally accept this in order to explicitly request this
kind of query.This is just a simple object, and will fail if being passed into
queryset filters, which means we won't accidentally break anything if
passed in. Any function that acceptsLocalSite.ALLwill need to be
documented as explicitly supporting it.Right now, support is available in
ReviewRequestManager,
ReviewGroupManager, andRepositoryManagerquery methods. Some of the
new stat-calculation functions will soon take this as well.The old
show_all_local_sitesflag still works, but will emit a
deprecation warning. All internal code has been updated to use
LocalSite.ALLinstead.
All unit tests pass, with no related warnings.
| Summary | ID |
|---|---|
| 593576ba73454d5b592de19658e61b88b29e402b |