Add execute permission to gerrymander-changes script

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Remove accidental debug print statements

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Cast hash keys to list object for python 3

The hash.keys() method no longer returns a list() object in
python3, so must be cast before we can sort it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix number of keys in lambda map functions

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Let gerrit filter on reviewer directly

There's no need to re-implement filtering on reviewers client
side when gerrit can do it for us.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Use full filepath when unlinking from cache

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add helper APIs to check if a change has been reviewed by users

Add some helper APIs to the Change/Patch/Approvals model classes
to check whether they've got approvals including/excluding a list
of user names

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix bogus status constants for open/closed

It isn't possible to query open/closed status by using a
list of other status codes. We must treat open/closed as
proper constants in the their right.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix detection of error response from gerrit

The error response has a key   type='error', not a
key called 'error'.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add support for negating terms in query clauses

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Split ReportChanges into two classes

Allow reuse of some code from ReportChanges by splitting out
the column definitions into a base class ReportBaseChange

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Allow the cache to be disabled from command line flag

Remove use of client cache from base command class and
add a separate CommandCaching class which includes a
--no-cache command line flag.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add flag to force refresh of the cache

Add a --refresh command line option that says to refresh
the cached client data even if not otherwise outdated.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add config file example for cache settings.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add config file option for listing robot accounts

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Introduce common subclass for reports dealing with projects

Move the --projects, --groups, --all-groups flags into a new
CommandProject class, so that the base CommandReport class is
more generic.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Add some scripts for reporting on todoo lists

Add four "todo list" scripts / reports

 - mine - any change where I've previously commented, but not on latest
 - others - any change where people except me and bots have commented
 - anyones - any change where anyone except bots have commented
 - noones - any change where noone except bots have commented

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Introduce two cache buckets with different lifetimes

Some heavy reports can be cached for a long time (1 day)
where as others can only be cached a short time (5 minutes)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Allow patch review stats to be filtered by day count

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Ensure change number is an integer

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>