-
Notifications
You must be signed in to change notification settings - Fork 27
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
Auto-collapse single run-dir workflows #1037
Conversation
3ebcf47
to
9905273
Compare
To test this I installed and ran multiple instances of a workflow, one with one run dir, and one with two; and the same again with an additional level in the hierarchy: for N in cat dog dog top/cat top/dog top/dog; do
cylc install --workflow-name=$N
cylc play $N
done Result: $ tree -d -L 3 ~/cylc-run/ | grep -E -v '(log|share|work|cylc)'
├── cat
│ ├── run1
│ └── runN -> run1
├── dog
│ ├── run1
│ ├── run2
│ └── runN -> run2
└── top
├── cat
│ ├── run1
│ └── runN -> run1
└── dog
├── run1
├── run2
└── runN -> run2 So the collapse/expand seems to work well, and it looks great, but the state summary propagates upward only if there is a single child workflow, and then only up one level. But ...
... maybe that indicates this was intentional, as a first cut @AaronDCole ? (And finally: |
9905273
to
b210962
Compare
@AaronDCole - I'm now getting a summary when there are multiple workflows at the same level, but the summary seems to be that of a single one of them, rather than a combined summary? |
6a18379
to
70f830b
Compare
@AaronDCole - what's the status of this one now? It looks like you've pushed commits since my review comments above, but you haven't commented on what changed... |
70f830b
to
9ed89fa
Compare
@AaronDCole - I checked out the branch and tested it, looking good.
However, the summaries:
I need to remind myself of what form the summary data is - not sure if it can be easily aggregated like that? (For others, propagation of state summaries to higher levels - e.g. to |
BTW: if it's not so easy to get the multi-run-dir summaries working (requires combining summary data from multiple workflows) you could punt that to follow-up work. Here, you could just to do the single-run-dir collapse summaries (as per the title of this PR) and not show a summary at all for workflows with more than one run-dir. |
I think the reason I dont show all the job icons including the greyed out ones, is that when you combine the single run name with the task title below it (aka something/something), it tends to overrun the available space. This wont be such an issue once the resizable drawer is merged however. I may have to push the aggregate job tasks to another ticket, but Im investigating currently |
9ed89fa
to
45f33ef
Compare
@hjoliver Ive just pushed an update to this which hopefully adds the missing features from last time, it now shows the task state summaries at every level (and fixed an issue with the-child workflow button not working at the level above it). |
Thanks @AaronDCole - taking a look at this tomorrow. |
The icons for stopped multilevel workflows are not grey like the one-level ones. Also, if there are more than 2 levels, the icon is a question mark. If you click on the question mark, you can see that the reason it's a question mark is because it's not the full workflow ID, and there is no workflow |
…open the collapsed workflow if desired but all the important info is available without opening
…to make the test work as originally intended and this meant I had to update some other tests as the data had changed
…s with more then one child
…n and multi-child dropdowns
Looking into these comments now, Im aiming to have this closed up by the end of the week |
…nd stoped workflows not having greyed out icons
38b8485
to
e04eefa
Compare
The new data store which automatically creates intermediate nodes (e.g. I think this PR should be fairly easy to reconcile with the data store work as there's minimal overlap. The main changes which may impact are:
Happy to help as needed whichever way around they're merged. |
I think:
E.G. this tree:
Should be auto-collapsed as:
With that logic the test for auto-collapsing would be something like: function shouldAutoCollapse (node) {
// return `false` if the node should not auto-collapse, return the tree's workflow status if it should
const stack = [node]
let item
while (stack.length) {
item = stack.pop()
if (item.children.length === 1) {
// there is only one child, this might be auto-collapsible, check children recursively to make sure
stack.push(item.children[0])
} else {
// node has more than one children, this is not auto-collapsible
return false
}
}
return item.node.status
} The test for displaying the workflow-icon on a workflow-part node would be: shouldAutoCollapse(node) && !node.isExpanded Untested! |
Superseded by #1175? |
Sorry for the mess-around guys.
This is (once again) a MR to collapse the single child workflows in the gscan component + fixed some unit test that were causing me grief.
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.