ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.05k stars 3.42k forks source link

[ui_next] Broken Job Templates should be highlighted in the workflow visualizer + currently hide 400 errors #6805

Open dsesami opened 4 years ago

dsesami commented 4 years ago
ISSUE TYPE
SUMMARY

In the old UI, workflow nodes that were broken -- for example, a job template with a now-deleted project -- had no way of showing that they were broken from the workflow view. It was greyed-out if you went to the details of the node, yes, but no further information was given. Showing the actual details of what is broken is covered by some of the work in https://github.com/ansible/awx/issues/6530.

This issue centers around putting some kind of error indication here: Screenshot_20200422_133714

dsesami commented 4 years ago

Changing to medium since I realized this obfuscates 400s.

mabashian commented 3 years ago

I think this was just unimplemented in the new ui. Needs to be added back in.

mabashian commented 3 years ago

OK, I was mistaken about this issue. I thought this behavior existed in the old app but it does not:

In the old UI, workflow nodes that were broken -- for example, a job template with a now-deleted project -- had no way of showing that they were broken from the workflow view

The api doesn't give us any information about the project/inventory in the summary fields on a node. Here are two nodes (one with missing inv/proj and one with intact inv/proj:

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": 1,
            "type": "workflow_job_template_node",
            "url": "/api/v2/workflow_job_template_nodes/1/",
            "related": {
                "credentials": "/api/v2/workflow_job_template_nodes/1/credentials/",
                "create_approval_template": "/api/v2/workflow_job_template_nodes/1/create_approval_template/",
                "success_nodes": "/api/v2/workflow_job_template_nodes/1/success_nodes/",
                "failure_nodes": "/api/v2/workflow_job_template_nodes/1/failure_nodes/",
                "always_nodes": "/api/v2/workflow_job_template_nodes/1/always_nodes/",
                "unified_job_template": "/api/v2/job_templates/9/",
                "workflow_job_template": "/api/v2/workflow_job_templates/10/"
            },
            "summary_fields": {
                "workflow_job_template": {
                    "id": 10,
                    "name": "workflow",
                    "description": ""
                },
                "unified_job_template": {
                    "id": 9,
                    "name": "Ping w/o related",
                    "description": "",
                    "unified_job_type": "job"
                }
            },
            "created": "2021-02-23T21:36:43.791258Z",
            "modified": "2021-02-23T21:36:43.791470Z",
            "extra_data": {},
            "inventory": null,
            "scm_branch": null,
            "job_type": null,
            "job_tags": null,
            "skip_tags": null,
            "limit": null,
            "diff_mode": null,
            "verbosity": null,
            "workflow_job_template": 10,
            "unified_job_template": 9,
            "success_nodes": [],
            "failure_nodes": [],
            "always_nodes": [],
            "all_parents_must_converge": false,
            "identifier": "22fdc6ee-c606-4d36-b6e2-051f3e522be5"
        },
        {
            "id": 2,
            "type": "workflow_job_template_node",
            "url": "/api/v2/workflow_job_template_nodes/2/",
            "related": {
                "credentials": "/api/v2/workflow_job_template_nodes/2/credentials/",
                "create_approval_template": "/api/v2/workflow_job_template_nodes/2/create_approval_template/",
                "success_nodes": "/api/v2/workflow_job_template_nodes/2/success_nodes/",
                "failure_nodes": "/api/v2/workflow_job_template_nodes/2/failure_nodes/",
                "always_nodes": "/api/v2/workflow_job_template_nodes/2/always_nodes/",
                "unified_job_template": "/api/v2/job_templates/7/",
                "workflow_job_template": "/api/v2/workflow_job_templates/10/"
            },
            "summary_fields": {
                "workflow_job_template": {
                    "id": 10,
                    "name": "workflow",
                    "description": ""
                },
                "unified_job_template": {
                    "id": 7,
                    "name": "Ping w/ related",
                    "description": "",
                    "unified_job_type": "job"
                }
            },
            "created": "2021-02-23T21:36:44.352998Z",
            "modified": "2021-02-23T21:36:44.353071Z",
            "extra_data": {},
            "inventory": null,
            "scm_branch": null,
            "job_type": null,
            "job_tags": null,
            "skip_tags": null,
            "limit": null,
            "diff_mode": null,
            "verbosity": null,
            "workflow_job_template": 10,
            "unified_job_template": 7,
            "success_nodes": [],
            "failure_nodes": [],
            "always_nodes": [],
            "all_parents_must_converge": false,
            "identifier": "93032bea-76d7-4647-94f1-f58aaa260ff0"
        }
    ]
}

If the api provided us with the inventory/project id's in the summary fields then we could determine that a node was invalid by looking at the combination of the node inv/proj and the jt inv/proj. If both are missing then the node is invalid.

We do have to think about the scenario where an inv/proj was promptable and a node value was supplied but then the JT was changed to no longer prompt and the default value is deleted. In that case we couldn't tell that the node is invalid because we don't have the ask_ attribute in the summary fields either. If those could be added then we could definitely determine whether the node is valid or not.