diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8cf4a302..2da079da 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ TBD - Fixed self reference bug that was returning back output instead of Request object. - Fixed self reference bug, when SystemClient calls itself but doesn't have a current request. This allows for support to run SystemClient in a sub-thread to the plugin. +- Expand Job model to include Skipped and Canceled counters 3.23.0 ------ diff --git a/brewtils/models.py b/brewtils/models.py index 95b5c241..f1f99128 100644 --- a/brewtils/models.py +++ b/brewtils/models.py @@ -1192,6 +1192,8 @@ def __init__( next_run_time=None, success_count=None, error_count=None, + canceled_count=None, + skip_count=None, status=None, max_instances=None, timeout=None, @@ -1206,6 +1208,8 @@ def __init__( self.next_run_time = next_run_time self.success_count = success_count self.error_count = error_count + self.canceled_count = canceled_count + self.skip_count = skip_count self.status = status self.max_instances = max_instances self.timeout = timeout diff --git a/brewtils/schemas.py b/brewtils/schemas.py index e3c9c94d..19301a03 100644 --- a/brewtils/schemas.py +++ b/brewtils/schemas.py @@ -516,6 +516,8 @@ class JobSchema(BaseSchema): next_run_time = DateTime(allow_none=True, format="epoch", example="1500065932000") success_count = fields.Int(allow_none=True) error_count = fields.Int(allow_none=True) + canceled_count = fields.Int(allow_none=True) + skip_count = fields.Int(allow_none=True) status = fields.Str(allow_none=True) max_instances = fields.Int(allow_none=True) timeout = fields.Int(allow_none=True) @@ -529,7 +531,14 @@ class JobExportSchema(JobSchema): def __init__(self, *args, **kwargs): # exclude fields from a Job that we don't want when we later go to import # the Job definition - self.opts.exclude += ("id", "next_run_time", "success_count", "error_count") + self.opts.exclude += ( + "id", + "next_run_time", + "success_count", + "error_count", + "canceled_count", + "skip_count", + ) super(JobExportSchema, self).__init__(*args, **kwargs) @post_load diff --git a/brewtils/test/fixtures.py b/brewtils/test/fixtures.py index 81f1fd91..4d10930a 100644 --- a/brewtils/test/fixtures.py +++ b/brewtils/test/fixtures.py @@ -569,6 +569,8 @@ def job_dict(ts_epoch, request_template_dict, date_trigger_dict): "next_run_time": ts_epoch, "success_count": 0, "error_count": 0, + "canceled_count": 0, + "skip_count": 0, "status": "RUNNING", "max_instances": 3, "timeout": 30, @@ -616,7 +618,14 @@ def job_ids_dict(job_dict): def job_dict_for_import(job_dict): """A job dict but some keys and values are missing.""" dict_copy = copy.deepcopy(job_dict) - for field in ["id", "next_run_time", "success_count", "error_count"]: + for field in [ + "id", + "next_run_time", + "success_count", + "error_count", + "canceled_count", + "skip_count", + ]: dict_copy.pop(field, None) return dict_copy