batches: add queries for batch changes on a repo
Created by: courier-new
Adds the ability to query several fields on a Repository
that are required to support the repo batch changes badge and new page with results filtered to an individual repo:
-
batchChangesDiffStat
- The total file diff stat across all changesets on a repository
-
changesetsStats
- Stats on all the changesets that have been applied to a repository
-
batchChanges
- Lists the batch changes filtered to a repository
Also added another parameter to the changesets
query to filter to those belonging to an individual repo.
I decided to write new store methods to support the stats queries rather than repurposing the existing ones to take an optional RepoID
or something; while there's an argument to be made for generalizing those methods, they still felt different enough to warrant being separate (especially the changeset stats one, which wants the counts for only a subset of the original query statuses).
I tried to add tests wherever there seemed to be a precedent, but let me know if I missed any that you'd like to see!