remove a few custom notification fields that don't work

these aren't top-level serializer fields; they're summary fields
if we want to support these properly, we should treat them as
enhancements, and write support, tests, and documentation
This commit is contained in:
Ryan Petrello
2020-03-03 14:58:36 -05:00
parent 32ef805e23
commit e7f36eb2ea
2 changed files with 8 additions and 25 deletions

View File

@@ -272,20 +272,17 @@ class JobNotificationMixin(object):
'approval_status', 'approval_node_name', 'workflow_url', 'approval_status', 'approval_node_name', 'workflow_url',
{'host_status_counts': ['skipped', 'ok', 'changed', 'failed', 'failures', 'dark' {'host_status_counts': ['skipped', 'ok', 'changed', 'failed', 'failures', 'dark'
'processed', 'rescued', 'ignored']}, 'processed', 'rescued', 'ignored']},
{'playbook_counts': ['play_count', 'task_count']},
{'summary_fields': [{'inventory': ['id', 'name', 'description', 'has_active_failures', {'summary_fields': [{'inventory': ['id', 'name', 'description', 'has_active_failures',
'total_hosts', 'hosts_with_active_failures', 'total_groups', 'total_hosts', 'hosts_with_active_failures', 'total_groups',
'has_inventory_sources', 'has_inventory_sources',
'total_inventory_sources', 'inventory_sources_with_failures', 'total_inventory_sources', 'inventory_sources_with_failures',
'organization_id', 'kind']}, 'organization_id', 'kind']},
{'project': ['id', 'name', 'description', 'status', 'scm_type']}, {'project': ['id', 'name', 'description', 'status', 'scm_type']},
{'project_update': ['id', 'name', 'description', 'status', 'failed']},
{'job_template': ['id', 'name', 'description']}, {'job_template': ['id', 'name', 'description']},
{'unified_job_template': ['id', 'name', 'description', 'unified_job_type']}, {'unified_job_template': ['id', 'name', 'description', 'unified_job_type']},
{'instance_group': ['name', 'id']}, {'instance_group': ['name', 'id']},
{'created_by': ['id', 'username', 'first_name', 'last_name']}, {'created_by': ['id', 'username', 'first_name', 'last_name']},
{'labels': ['count', 'results']}, {'labels': ['count', 'results']}]}]
{'source_workflow_job': ['description', 'elapsed', 'failed', 'id', 'name', 'status']}]}]
@classmethod @classmethod
def context_stub(cls): def context_stub(cls):
@@ -315,7 +312,6 @@ class JobNotificationMixin(object):
'limit': 'bar_limit', 'limit': 'bar_limit',
'modified': datetime.datetime(2018, 12, 13, 6, 4, 0, 0, tzinfo=datetime.timezone.utc), 'modified': datetime.datetime(2018, 12, 13, 6, 4, 0, 0, tzinfo=datetime.timezone.utc),
'name': 'Stub JobTemplate', 'name': 'Stub JobTemplate',
'playbook_counts': {'play_count': 5, 'task_count': 10},
'playbook': 'ping.yml', 'playbook': 'ping.yml',
'scm_revision': '', 'scm_revision': '',
'skip_tags': '', 'skip_tags': '',
@@ -348,18 +344,10 @@ class JobNotificationMixin(object):
'name': 'Stub project', 'name': 'Stub project',
'scm_type': 'git', 'scm_type': 'git',
'status': 'successful'}, 'status': 'successful'},
'project_update': {'id': 5, 'name': 'Stub Project Update', 'description': 'Project Update',
'status': 'running', 'failed': False},
'unified_job_template': {'description': 'Sample unified job template description', 'unified_job_template': {'description': 'Sample unified job template description',
'id': 39, 'id': 39,
'name': 'Stub Job Template', 'name': 'Stub Job Template',
'unified_job_type': 'job'}, 'unified_job_type': 'job'}},
'source_workflow_job': {'description': 'Sample workflow job description',
'elapsed': 0.000,
'failed': False,
'id': 88,
'name': 'Stub WorkflowJobTemplate',
'status': 'running'}},
'timeout': 0, 'timeout': 0,
'type': 'job', 'type': 'job',
'url': '/api/v2/jobs/13/', 'url': '/api/v2/jobs/13/',

View File

@@ -23,8 +23,11 @@ class TestJobNotificationMixin(object):
'finished': bool, 'finished': bool,
'force_handlers': bool, 'force_handlers': bool,
'forks': int, 'forks': int,
'host_status_counts': {'skipped': int, 'ok': int, 'changed': int, 'host_status_counts': {
'failures': int, 'dark': int}, 'skipped': int, 'ok': int, 'changed': int,
'failures': int, 'dark': int, 'processed': int,
'rescued': int, 'failed': bool
},
'id': int, 'id': int,
'job_explanation': str, 'job_explanation': str,
'job_slice_count': int, 'job_slice_count': int,
@@ -36,7 +39,6 @@ class TestJobNotificationMixin(object):
'modified': datetime.datetime, 'modified': datetime.datetime,
'name': str, 'name': str,
'playbook': str, 'playbook': str,
'playbook_counts': {'play_count': int, 'task_count': int},
'scm_revision': str, 'scm_revision': str,
'skip_tags': str, 'skip_tags': str,
'start_at_task': str, 'start_at_task': str,
@@ -68,17 +70,10 @@ class TestJobNotificationMixin(object):
'name': str, 'name': str,
'scm_type': str, 'scm_type': str,
'status': str}, 'status': str},
'project_update': {'id': int, 'name': str, 'description': str, 'status': str, 'failed': bool},
'unified_job_template': {'description': str, 'unified_job_template': {'description': str,
'id': int, 'id': int,
'name': str, 'name': str,
'unified_job_type': str}, 'unified_job_type': str}},
'source_workflow_job': {'description': str,
'elapsed': float,
'failed': bool,
'id': int,
'name': str,
'status': str}},
'timeout': int, 'timeout': int,
'type': str, 'type': str,