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
13.98k stars 3.41k forks source link

Activity stream entry for ad hoc command creation has no links #5011

Open AlanCoding opened 4 years ago

AlanCoding commented 4 years ago
ISSUE TYPE
SUMMARY

Ad hoc commands in the UI do not link to anything, but they should logically link to:

ENVIRONMENT
STEPS TO REPRODUCE

Run an ad hoc command

find this action via the "all activity" in the activity stream heartbeat icon link from the dashboard

EXPECTED RESULTS

Links

ACTUAL RESULTS

no links

Screen Shot 2019-10-14 at 2 06 56 PM

ADDITIONAL INFORMATION

API data for this entry:

{
    "id": 7361,
    "type": "activity_stream",
    "url": "/api/v2/activity_stream/7361/",
    "related": {
        "actor": "/api/v2/users/1/",
        "ad_hoc_command": [
            "/api/v2/ad_hoc_commands/443/"
        ]
    },
    "summary_fields": {
        "ad_hoc_command": [
            {
                "id": 443,
                "name": "ping",
                "status": "successful",
                "limit": ""
            }
        ],
        "actor": {
            "id": 1,
            "username": "admin",
            "first_name": "",
            "last_name": ""
        }
    },
    "timestamp": "2019-10-14T18:03:03.001087Z",
    "operation": "create",
    "changes": {
        "job_type": "run",
        "inventory": "Inventory - ShapeMedia돻-101",
        "limit": "",
        "credential": "Credential - StandMapﮈ-145",
        "module_name": "ping",
        "module_args": "",
        "forks": 0,
        "verbosity": 0,
        "extra_vars": "",
        "become_enabled": false,
        "diff_mode": false,
        "id": 443
    },
    "object1": "ad_hoc_command",
    "object2": "",
    "object_association": "",
    "action_node": "awx",
    "object_type": ""
}

You can see the inventory info is missing, so the API will have to furnish this in order to link to the inventory.

The data needed to link to the ad hoc command, itself, is there.

unlikelyzero commented 3 years ago

@akus062381 please verify that we have a stub for ad hoc commands in the activity stream tests

akus062381 commented 3 years ago

Applicable stubs have been added. I am putting this back to needs_devel because these changes have not been implemented per the original issue details.