Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWX: Job Output UI does not show DateTime labels with free/host_pinned strategy #3077

Open
moonrail opened this issue Dec 13, 2024 · 0 comments

Comments

@moonrail
Copy link

Hello together,

the Job Output does not render DateTime labels for Tasks in Jobs running with Ansible strategies "free" or "host_pinned".

This would be less problematic, if the Event Details view would show DateTimes of an event row, but it does not.

This issue has been present with the "old" UI present in AWX 24.6.1 and before as well, but since there is neither an issue at ansible/awx nor here, I decided to open it here.

Observed Behaviour

Example using public test playbooks:

Used playbooks are ping-20.yml for linear and free-waiter.yml for free. Ansible version was 2.17 with ansible-runner 2.4.0.
Screenshot_20241213_175950

As you can see, only linear has DateTime labels for task rows:
Screenshot_20241213_180026

When inspecting the Event Detail modal, no DateTime label is shown as well, so we cannot see at all when an event did happen in a Job with free strategy.
Screenshot_20241213_183535

Finding the cause for missing task DateTime labels

This seems to be due to logic found here:

{row.isHeaderLine && row.canCollapse && (
<>
&nbsp; <Label isCompact>{new Date(row.created ?? '').toLocaleTimeString()}</Label>
</>
)}

So a row must be a HeaderLine and collapsible to receive a DateTime label.

If its a HeaderLine is determined by this logic:

if (stdout) {
isHeaderLine = !foundHeaderLine;
foundHeaderLine = true;
} else {

So a row is a HeaderLine if it has stdout and there was no HeaderLine row yet.

If its collapsible is determined by this logic:

let canCollapse = false;
switch (jobEvent.event) {
case 'playbook_on_play_start':
case 'playbook_on_task_start':
case 'playbook_on_stats':
canCollapse = playUuid !== '' || taskUuid !== '';
}

As well as:
canCollapse: canCollapse && isHeaderLine,

So a row is collapsible, if:

  • it is one of 3 specific "header" events
  • the event has either a play uuid or task uuid defined
  • it is a HeaderLine

When we look into the events stored for the example jobs, we see two relevant differences:

  1. Event playbook_on_task_start only has stdout for linear playbooks, but not free
  2. Event runner_on_ok has only host specific stdout (such as "ok: [hostname]") for linear but with free the missing task stdout from playbook_on_task_start is present as well

Screenshot_20241213_184219
Screenshot_20241213_184050

Used ansible-ui version

The "Next UI" compiled into AWX 24.6.1 container image seems to have been built from the main branch of ansible-ui at release date, so 2024-07-02: https://github.com/ansible/awx/releases/tag/24.6.1
The main Branch of ansible-ui was then at commit 298aac6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant