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

Tree view of task-get shows duplicate "next start" information for applications with multiple triggers #333

Closed
berdan opened this issue Oct 24, 2023 · 3 comments · Fixed by #321
Labels
bug Something isn't working
Milestone

Comments

@berdan
Copy link

berdan commented Oct 24, 2023

What version of Ctrl-Q are you using?

3.13.2

What version of Node.js are you using? Not applicable if you use the standalone version of Ctrl-Q.

No response

What command did you use to start Ctrl-Q?

ctrl-q.exe task-get --auth-type cert --host redacted.se --output-format tree --output-dest screen --auth-user-dir redacted --auth-user-id redacteduser --tree-icons --text-color yes --tree-details --task-type reload ext-program

What operating system are you using?

Windows 11

What CPU architecture are you using?

x86_64

What Qlik Sense versions are you using?

2023-February p5

Describe the Bug

In the tree view, I get multiple lines for an app with multiple triggers as expected, but the "Next start" information is the same for all lines.

Expected Behavior

I expect to get multiple lines for applications with multiple load triggers, but the "Next start" should reflect the individual triggers.

To Reproduce

Have a Qlik application with multiple reload triggers:

image

Export data with ctrl-q as JSON.

ctrl-q.exe task-get --auth-type cert --host redacted.se --output-format table --output-dest file --auth-user-dir redacted --auth-user-id redacteduser --task-type reload ext-program --output-file-format json --output-file-name tasks-alldetails.json

In my example I get the results of the last load and two separate items for the respective triggers. One monthly and one once.

    [
        165,
        "Reload",
        "Resultatanalys_datastore 1 - Resultatanalys_datastore",
        "a558b10c-4f1d-468f-aa4e-70cedf29872a",
        true,
        1440,
        0,
        "d50e2093-3831-4ee8-abc9-855896e2c4cd",
        "",
        "",
        "",
        "",
        "✅ FinishedSuccess",
        "2023-10-02T23:10:03.377Z",
        "2023-10-02T23:33:41.913Z",
        "0:23:38",
        "redacted.se",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        165,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        1,
        "Schema",
        "Monthly",
        true,
        "2020-11-18T07:43:35.108Z",
        "2020-11-18T07:43:35.108Z",
        "redacted-user",
        "monthly",
        "0 0 1 0",
        "ObserveDaylightSavingTime",
        "2020-11-18T01:10:03.000",
        "9999-01-01T00:00:00.000",
        "* * - * * 1,2,3 * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        165,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        2,
        "Schema",
        "Once",
        true,
        "2020-11-23T11:58:37.063Z",
        "2020-11-23T11:58:37.063Z",
        "redacted-user",
        "once",
        "0 0 0 0",
        "ObserveDaylightSavingTime",
        "2020-11-23T13:05:05.000",
        "9999-01-01T00:00:00.000",
        "* * - * * * * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ]

But the task tree shows the application on two rows, with the same future reload info:

ctrl-q.exe task-get --auth-type cert --host redacted.se --output-format tree --output-dest screen --auth-user-dir redacted --auth-user-id redacteduser --tree-icons --text-color yes --tree-details --task-type reload ext-program

image

And on a job with four reloads during the day, the JSON looks like this:

    [
        136,
        "Reload",
        "Reload task of Assortment-fix",
        "793126a8-f6e2-41ee-97e2-bf69bdb3f6a9",
        true,
        1440,
        0,
        "4f623ed2-fbb2-46b8-8a63-e361327d81a5",
        "",
        "",
        "",
        "",
        "✅ FinishedSuccess",
        "2023-10-24T11:00:56.223Z",
        "2023-10-24T11:03:33.444Z",
        "0:02:37",
        "redacted.se",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        136,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        1,
        "Schema",
        "Daily 07:00",
        true,
        "2022-08-03T09:05:46.344Z",
        "2022-08-03T13:08:26.838Z",
        "redacteduser",
        "daily",
        "0 0 1 0",
        "ObserveDaylightSavingTime",
        "2022-08-03T07:00:29.000",
        "9999-01-01T00:00:00.000",
        "* * - * * * * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        136,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        2,
        "Schema",
        "Daily 13:00",
        true,
        "2022-08-03T13:08:26.838Z",
        "2022-08-03T13:08:26.838Z",
        "redacteduser",
        "daily",
        "0 0 1 0",
        "ObserveDaylightSavingTime",
        "2022-08-03T13:00:56.000",
        "9999-01-01T00:00:00.000",
        "* * - * * * * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        136,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        3,
        "Schema",
        "Daily 16:00",
        true,
        "2022-08-04T13:02:31.930Z",
        "2022-08-04T13:02:31.930Z",
        "redacteduser",
        "daily",
        "0 0 1 0",
        "ObserveDaylightSavingTime",
        "2022-08-04T16:00:55.000",
        "9999-01-01T00:00:00.000",
        "* * - * * * * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ],
    [
        136,
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        4,
        "Schema",
        "Daily 22:00",
        true,
        "2022-08-04T15:30:38.595Z",
        "2022-08-04T15:30:38.595Z",
        "redacteduser",
        "daily",
        "0 0 1 0",
        "ObserveDaylightSavingTime",
        "2022-08-04T22:00:21.000",
        "9999-01-01T00:00:00.000",
        "* * - * * * * *",
        "Europe/Paris",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
    ]

And the tree view:
image

@mountaindude
Copy link
Contributor

Nice find.

Current version of Ctrl-Q has issues with the tree view.
Mostly it's external program tasks that cause troubles, but that code needs some attention - which it is also currently getting.
A significant refactoring is being done, will take this bug into account too.

@mountaindude
Copy link
Contributor

Just to confirm, I see the same behaviour.
Multiple lines for a single task is definitely a 🐛.

When it comes to showing information about triggers I am not sure what the preferred behaviour is though.

The "Next start" field in the task tree comes straight from the repository API and is the same value that is shown in the QMC for the task. I.e. it's a task-level property, not a trigger-level property.

I can see two alternatives:

  1. One line for each task. If a task is triggered by another (upstream) task, that will be reflected by the fact that the task of interest appears beneath the upstream task in the tree. If a task has multiple triggers, pointing to different upstream tasks, the task would appear in multiple places in the tree. In this option the triggering info
  2. Adding optional trigger information to each line in the task tree.

I feel option 1 is most intuitive and best reflect what's seen in the QMC.
But I do see the value of having info about each triggers next execution, at least for schema triggers.
But as the task tree shows relationships between tasks, I think the info shown should show the task's next execution.

Open for a discussion though, of course! :)

@mountaindude
Copy link
Contributor

I had a think about this and here's the plan:

  • Fix the immediate bug (i.e. several identical rows in the task tree/one row for each task trigger)
  • Add a feature suggestion for coming versions, for showing in a suitable way when each schema trigger will fire next time. This will add something that's not currently visible in the QMC or anywhere else - that's always nice :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants