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

Add gscan component #301

Merged
merged 20 commits into from
Nov 11, 2019
Merged

Add gscan component #301

merged 20 commits into from
Nov 11, 2019

Conversation

kinow
Copy link
Member

@kinow kinow commented Nov 5, 2019

These changes partially address #139

Initial version of the GScan component. Will need more iterations later until the requirements in #139 are fully addressed.

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • No documentation update required.

@kinow kinow added this to the 0.2 milestone Nov 5, 2019
@kinow kinow self-assigned this Nov 5, 2019
@kinow kinow mentioned this pull request Nov 5, 2019
9 tasks
@kinow
Copy link
Member Author

kinow commented Nov 5, 2019

Note: it takes users to /workflows/$workflow-name. Which at the moment is rendered by the Tree view. Later, we should replace it by a Workflow.vue I think, which adds the initial area to add tabs as in #98

It also does not implement any hierarchy.

@kinow
Copy link
Member Author

kinow commented Nov 5, 2019

And a GIF of what it looks like in action:

GIFrecord_2019-11-05_165021

@codecov-io
Copy link

codecov-io commented Nov 5, 2019

Codecov Report

Merging #301 into master will increase coverage by 4.87%.
The diff coverage is 67.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #301      +/-   ##
==========================================
+ Coverage   62.57%   67.44%   +4.87%     
==========================================
  Files          22       24       +2     
  Lines         318      341      +23     
  Branches       17       20       +3     
==========================================
+ Hits          199      230      +31     
+ Misses        115      105      -10     
- Partials        4        6       +2
Impacted Files Coverage Δ
src/store/workflows.module.js 66.66% <ø> (-33.34%) ⬇️
src/router/index.js 0% <0%> (ø) ⬆️
src/components/cylc/gscan/index.js 100% <100%> (ø)
src/components/cylc/tree/index.js 100% <100%> (ø) ⬆️
src/components/cylc/gscan/GScan.vue 57.89% <57.89%> (ø)
src/services/gquery.js 68.11% <0%> (+14.49%) ⬆️
src/services/workflow.service.js 80% <0%> (+80%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 150a6cd...fc9f14f. Read the comment docs.

@kinow
Copy link
Member Author

kinow commented Nov 5, 2019

Build failed due to sass-loader and vuetify. Removing node-sass to see if it will pass now (off to home, will log in again later to check if build passed). Only tested with the workflow five, so it would be good if a reviewer could test with other workflows and see if there's anything broken :)

@kinow
Copy link
Member Author

kinow commented Nov 5, 2019

Build passed on Travis 🎉

Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was quick!

Looks nice, with your last PR merged this is starting to really look like the Cylc GUI now. It's getting pretty usable!

src/App.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
src/components/cylc/GScan.vue Outdated Show resolved Hide resolved
<v-layout align-center align-content-center wrap>
<v-flex grow>{{ workflow.name }}</v-flex>
<v-flex shrink ml-4>
<!-- task summary tooltips -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

I think we might want to factor out some of this functionality into a common component so all views can benefit from these features (e.g. tooltips).

I was thinking of something like JobBox which either holds:

  • State totals (as in this case).
  • A collection of jobs (which collapses down to state totals if there are too many jobs).

Food for later thought...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders - can you post an issue for this, if you think it's needed.

src/App.vue Outdated
const QUERIES = {
root: `
{
workflows {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: I think we will need to improve the whole gproxy thing so it can merge this query properly, my bad I should have opened a follow on issue at the time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two or three issues created that involve changes in the gproxy, so there's room for improvement, but it was a life saver. Without that early in the project, we would have a lot built on top of - probably - multiple queries spread over the project.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders - ditto this - is an issue needed, it will it be obvious later on?

@kinow
Copy link
Member Author

kinow commented Nov 6, 2019

Rebased, fixed conflicts. May still have to update the code based on further comments from @oliver-sanders (I think I replied with only more questions hehe)

@hjoliver
Copy link
Member

hjoliver commented Nov 8, 2019

@kinow - have you tested this with more than one workflow? When I do, the first one I click on (in the scan bar) appears in the tree view, but then second one results in a blank view. The first view comes back if I click on the first one again in the sidebar.

@kinow
Copy link
Member Author

kinow commented Nov 8, 2019

@kinow - have you tested this with more than one workflow? When I do, the first one I click on (in the scan bar) appears in the tree view, but then second one results in a blank view. The first view comes back if I click on the first one again in the sidebar.

Oh! Interesting issue! I surely tested two workflows, five, and families2 (an example you provided in some issue). But I probably did not test both workflows at the same time 😄

Let me try it and see what happens.

@kinow kinow mentioned this pull request Nov 8, 2019
@kinow
Copy link
Member Author

kinow commented Nov 8, 2019

Ah! Mea culpa! I believe in the families PR I changed the code to build the workflow tree for the first workflow (implemented that for a single workflow, when looking at the /vuews/Tree.vue).

Easy to cover with an e2e test. It might be time to start considering adding more e2e tests, and adding them to Travis/CI. (had added this comment to another issue wrongly, sorry)

I think it's fixed now!

  • moved the logic of computing the workflow out of Vuex, into the view Tree.vue
  • fixed the router title problem, which was not displaying the workflow name in the toolbar
  • tested with two workflows at the same time
    • one workflow (families2 source below) occasionally had some exceptions due to a value missin from the lookup table (i.e. a task firstParent was missing from familyProxies). After that, the application wouldn't allow users to switch workflows, being piratically broken. Added a try/catch and will log the exception to the browser console, and allow users to keep using the rest of the app - there may be a moment that the workflow tree is empty due to this exception

@kinow
Copy link
Member Author

kinow commented Nov 8, 2019

(just need to fix the tests)

@hjoliver
Copy link
Member

hjoliver commented Nov 9, 2019

That's got it, looks great.

Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving this on the basis of functionality (my JS and Vue is still lacking 😬). Looks good, seems to work well, and we can extend and improve it later.

I'd like to get this merged this week to use in demos in the US. @oliver-sanders and @kinow can you figure out between you if all review comments have been addressed or moved to follow-up issues?

Finally, we need some way to access to the cytoscape graph view!

@kinow
Copy link
Member Author

kinow commented Nov 9, 2019

Finally, we need some way to access to the cytoscape graph view!

Without #98 there's no way to access the graph now 😞 unless one knows the URL. Do you have any suggestion where we could include a link for the Graph view? Or perhaps we should try to display both components at the same time by default?

@hjoliver
Copy link
Member

As a temporary measure, could we just keep the old scan table view via a link from the dashboard?

@kinow
Copy link
Member Author

kinow commented Nov 10, 2019

As a temporary measure, could we just keep the old scan table view via a link from the dashboard?

Sure. Or should we add that link under the Dashboard entry in the drawer/left sidebar? It just occurred to me that I could have simply added it under the existing values (a bit of d'oh moment). If that's fine, it'll be a 5 min job.

@hjoliver
Copy link
Member

Yep that’s fine 👍🏻

@kinow
Copy link
Member Author

kinow commented Nov 10, 2019

Yep that’s fine 👍🏻

Done (and rebased too)

image

src/components/cylc/Drawer.vue Outdated Show resolved Hide resolved
import { workflowService } from 'workflow-service'

const QUERIES = {
root: `
Copy link
Member Author

@kinow kinow Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders 👆 moved query and methods/data/etc from App.vue to this component

return 'mdi-pause-octagon'
default:
return 'mdi-help-circle'
}
Copy link
Member Author

@kinow kinow Nov 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliver-sanders, @hjoliver also added an extra commit to choose the workflow icon. Given we have the icons loaded anyway, and they fit the CSS styles, would it be fine? Or do we need the component with SVG? They don't look exactly like the design sketch, but looks good to me.

image

(did a cylc hold five to test both icons)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(note that the Workflows menu item is activated as it matches the "/workflows*" route)

Copy link
Member

@hjoliver hjoliver Nov 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The play and pause icons look fine to me, and we can change to custom svg later on if we want to.

@hjoliver
Copy link
Member

Looking good.

Now wondering if gscan tool-tip reduction is feasible this week (or did that require new data from the back-end? I forget the result of that discussion...).

New:
shot

Old:
shot2

@kinow
Copy link
Member Author

kinow commented Nov 11, 2019

Now wondering if gscan tool-tip reduction is feasible this week (or did that require new data from the back-end? I forget the result of that discussion...).

I think @oliver-sanders pointed the http endpoint from where we used to get this data from, and in the discussion here and on Riot we were discussing that it would be possible to get state totals from the backend - though I believe it is not the same problem.

I think this is the code in GScan that creates the message from your screenshot. It gets the data from this method from the state_summary_mgr.

image

I will try to reproduce this in JS ☝️

@hjoliver
Copy link
Member

Thanks @kinow (and tomorrow is OK!)

@kinow
Copy link
Member Author

kinow commented Nov 11, 2019

Rebased, and implemented:

  • sorting the tasks within each state alphabetically (JS, when creating the summary data)
  • display only N (default to 5) tasks (JS/Vue in the component, we use array.slice(0, N) to get up to N... then another <span v-if="tasks.length > N"> that displays the text "And ${tasks.length - N} more" as before.

Added a simple unit test, but would be good if someone else tested to confirm the values displayed make sense. I didn't use this feature in Cylc 7, so I'm not 100% sure that it's working OK. 👍

@hjoliver
Copy link
Member

Nice, thanks @kinow. Looks great, works great!

We'll need sorting by "time" not name (e.g. when looking at succeeded tasks, want the most recently succeeded ones first). But that can be a follow-up. This is great for my demo as-is (I won't tell anyone it's not really "most recent", he heh 😁 )

The Cylc 7 version also does this server side (I had forgotten) but it is probably better in principle that the UI does it (some future UI component might need to list all tasks in a state, not just a few.)

@hjoliver
Copy link
Member

@oliver-sanders - I'm going to merge this without your approval, as I need it in for demos soon. I believe all your comments have been addressed above, with some things punted to other issues (and/or updated the gscan Issue description). Note two questions on things that might need a new Issue page.

@hjoliver hjoliver merged commit e67f345 into cylc:master Nov 11, 2019
@kinow kinow deleted the add-gscan-component branch March 19, 2020 00:43
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

Successfully merging this pull request may close these issues.

4 participants