cylc-ui icon indicating copy to clipboard operation
cylc-ui copied to clipboard

Xtriggers and mode in info view

Open wxtim opened this issue 8 months ago • 2 comments

Requires https://github.com/cylc/cylc-flow/pull/6671

Check List

  • [x] I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • [x] Contains logically grouped changes (else tidy your branch by rebase).
  • [x] Does not contain off-topic changes (use other PRs for other changes).
  • [x] Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • [x] Tests are included (or explain why tests are not needed).
  • [x] Changelog entry included if this is a change that can affect users
  • [x] Cylc-Doc pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • [x] If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

wxtim avatar Mar 12 '25 13:03 wxtim

Broken for this workflow::

#!/bin/bash
TMP=$(mktemp -d)
echo Files extracted to ${TMP}
mkdir -p "${TMP}/."

cat > "${TMP}/./flow.cylc" <<__ICI__
[scheduler]
    allow implicit tasks = True
    cycle point format = %Y

[scheduling]
    initial cycle point = 2026
    [[graph]]
        R1 = """
            @myxt => foo
            @echo => foo
        """
    [[xtriggers]]
        echo = echo('Hello, world!', succeed=False)
        myxt = myxt():PT1S

[runtime]
    [[foo]]
        [[[meta]]]
            description = """
                Xtriggers dissapear from the gui

                to make myxt return true

                touch ~/foo.flag
            """__ICI__

mkdir "${TMP}/./lib"

mkdir "${TMP}/./lib/python"

cat > "${TMP}/./lib/python/myxt.py" <<__ICI__
from pathlib import Path

def myxt():
    """Switched by the existance of a file foo.flag in the users home
    directory.
    """
    if (Path.home() / 'foo.flag').exists():
        return True, {}
    return False, {}
__ICI__

When one touches the foo.flag file the state of myxt correctly displays as satisfied, but the still unsatisfied echo trigger dissapears.

wxtim avatar Mar 12 '25 13:03 wxtim

Note to self - remove the note from cylc doc added in https://github.com/cylc/cylc-doc/pull/816 about info view not showing xtriggers.

wxtim avatar Apr 08 '25 09:04 wxtim

PR is ready for review, but only works in combination with https://github.com/cylc/cylc-flow/pull/6671

wxtim avatar May 01 '25 07:05 wxtim

Checks cancelled because diff is https://github.com/cylc/cylc-ui/compare/077f8cd1ae3363314ac038512e84b079f8bfee10..73a93e22501b5e39032ad35029c8db0f81184004 no change

wxtim avatar May 01 '25 07:05 wxtim

I get a blank Info view on this branch, I'm afraid (cylc-flow PR checked out, cylc-uiserver at master)

MetRonnie avatar May 12 '25 15:05 MetRonnie

I get a blank Info view on this branch, I'm afraid (cylc-flow PR checked out, cylc-uiserver at master)

Can confirm - I've made a mistake in the graphql - I'll have a poke at some point, but i think some of the reviewing I have is more urgent

wxtim avatar May 13 '25 09:05 wxtim

Unfortunately, if there is a problem/mistake in a subscription query, we don't seem to be getting any error reporting

MetRonnie avatar May 13 '25 09:05 MetRonnie

Unfortunately, if there is a problem/mistake in a subscription query, we don't seem to be getting any error reporting

My evidence is that I checked out the upstream/master src/views/Info.vue and it all worked fine. This also demonstates that I haven't used the extra data, so it's pointless, and that I hadn't finished something I was doing on branch!

wxtim avatar May 13 '25 09:05 wxtim

(I've started looking at this one)

hjoliver avatar May 23 '25 04:05 hjoliver

(I've started looking at this one)

For context, task filtering based on xtrigger-derived state & task icon badges will follow in future PRs, this one is just about the info view.

oliver-sanders avatar May 23 '25 08:05 oliver-sanders

Something is going wrong with the trigger time field:

Screenshot from 2025-06-10 13-00-40

And what's up with the sort order? Why is the latest xtrigger in the middle?

oliver-sanders avatar Jun 10 '25 12:06 oliver-sanders

LGTM, small issue with xtrigger sorting and trigger time calculation.

Note, we could just replace the trigger_time field in the xtriggers signature with the ISO8601 value to avoid adding an extra column (that only applies to @clock triggers).

oliver-sanders avatar Jun 10 '25 12:06 oliver-sanders

Something is going wrong with the trigger time field:

I've removed seconds. Forgot about retry triggers when I did that. Thought that minutes would be fine.

And what's up with the sort order? Why is the latest xtrigger in the middle?

I've done nothing to sort the items. I imagine accidentally shearing seconds off them won't help. It seems to have sorted itself out in the process of fixing the other issues.

wxtim avatar Jun 19 '25 09:06 wxtim

The re-formatted trigger-time field looks great.

The xtriggers are still being displayed in the order the backend provides them in which is unsorted. Not a biggie, but I think it would be good for the info view to sort by label, then signature.

Screenshot from 2025-06-20 10-34-40

Screenshot from 2025-06-20 10-43-08

oliver-sanders avatar Jun 20 '25 09:06 oliver-sanders

Yes, it's covered in https://github.com/cylc/cylc-flow/issues/6298.

To some extent, https://github.com/cylc/cylc-flow/issues/6810 will help.

oliver-sanders avatar Jul 08 '25 08:07 oliver-sanders