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

metadata view: introduce a minimal task metadata view #1886

Merged
merged 11 commits into from
Dec 16, 2024

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Aug 8, 2024

Closes #1071
Closes #1896

  • Bare bones task metadata view.
  • Display task metadata, prerequisites and outputs.
  • Display / functionality improvements and support for other information to follow in future PRs.

Screenshot from 2024-08-08 15-44-54

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).
  • Applied any dependency changes to both setup.cfg (and conda-environment.yml if present).
  • Tests are included (or explain why tests are not needed).
  • Changelog entry included if this is a change that can affect users
  • Cylc-Doc - bumped changes entry to a PR (view is likely to change further before release)
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@oliver-sanders oliver-sanders added this to the 2.6.0 milestone Aug 8, 2024
@oliver-sanders oliver-sanders self-assigned this Aug 8, 2024
@hjoliver
Copy link
Member

hjoliver commented Aug 9, 2024

Ping @ScottWales @ColemanTom (you were wanting this for viewing prerequisites etc.)

@ScottWales
Copy link

Great! thanks for this

@oliver-sanders oliver-sanders force-pushed the metadata-view-template branch from 2e5c1b5 to d6d9e10 Compare August 12, 2024 14:36
@oliver-sanders oliver-sanders marked this pull request as ready for review August 12, 2024 14:37
@oliver-sanders
Copy link
Member Author

oliver-sanders commented Aug 12, 2024

Added offline-data and tests.

Many, many enhancements and features left to add to this view, but will leave it at basic metadata, prereqs and outputs for this PR. The main work here is getting the template for the view in place (it's quite different to other views).

Further enhancements will slot into this template fairly easily provided the required data is present (and accurate) in the schema.

@oliver-sanders oliver-sanders force-pushed the metadata-view-template branch from d6d9e10 to cfbc4a9 Compare August 12, 2024 16:10
src/components/cylc/Info.vue Outdated Show resolved Hide resolved
v-model="panelExpansionModel"
>
<!-- The metadata -->
<v-expansion-panel class="metadata-panel">
Copy link
Member

@wxtim wxtim Aug 15, 2024

Choose a reason for hiding this comment

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

IMO most users will be coming here for the pre-reqs and outputs and not the metadata - these should go first and probably not be collapsed.

Could they go in neighbouring Columns?

Happy to spin this out into an issue and not block this PR.

e.g.:

| Prerequisites |                | Outputs     |
| list of       |   task icon    |             |
------------------------------------------------
| Metadata                                     |   

Copy link
Member Author

Choose a reason for hiding this comment

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

Columns aren't an option (or at least aren't always an option) because they won't work in narrow widths.

We can't expand all of the sections by default as there will be a lot of them, from prerequisites, to completion expression satisfaction, to runtime configuration and broadcasts. Prereqs are important, but so are all the other sections.

We could start with nothing expanded, but I thought the title, description and URL (often used to link to documentation) are notably important and deserve to be displayed at all times. Important messages like "do not re-run this task" or "if it fails, try re-running in shortstep mode" will be prominent as a result.

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

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

  • Manually tested
  • Read PR content

I've made some comments, none of which should block the PR going in if they cost any effort to implement.


<!-- The prereqs -->
<v-expansion-panel class="prerequisites-panel">
<v-expansion-panel-title color="blue-grey-lighten-2">
Copy link
Member

Choose a reason for hiding this comment

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

This one is inconsistent with the others

Suggested change
<v-expansion-panel-title color="blue-grey-lighten-2">
<v-expansion-panel-title color="blue-grey-lighten-1">

Copy link
Member Author

Choose a reason for hiding this comment

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

On purpose.

There will be other sections in the near future. I tried adding a few extras and it ended up as a giant block of "blue-grey" which didn't make it especially obvious that these are individual sections that can be expanded.

I thought it was clearer if the sections were striped ("lighten-1", "lighten-2", "lighten-1", ...).

Copy link
Member

Choose a reason for hiding this comment

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

To me it doesn't really indicate clickability, it looks like it's selected or has keyboard focus or something. Not too important

@oliver-sanders
Copy link
Member Author

oliver-sanders commented Aug 16, 2024

Unfortunately, this work may be blocked by cylc/cylc-flow#6307 which also imposes some back-compatibility constraints :(

I can hack it for outputs, but I'm not sure I can hack it for prerequisites.

@oliver-sanders
Copy link
Member Author

oliver-sanders commented Oct 11, 2024

The cylc-flow blocker to this has not been resolved, however, I have come up with a workaround: cylc/cylc-flow#6403

I have also added an output completion expression (closes #1896) so this should now be more or less a direct analogue of cylc show with a similar display interface.

info

@MetRonnie
Copy link
Member

MetRonnie commented Oct 16, 2024

Have you/are you considering a client-side workaround (i.e. in the onUpdated method of the InfoCallback) rather than cylc/cylc-flow#6403 (still in draft)?

Other feedback: to me, these look like bullet points rather than yes/no indicators. (Tested on Windows, FF & Chrome)

image

@oliver-sanders
Copy link
Member Author

Have you/are you considering a client-side workaround

It's possible, but it would require iterating over the received delta and the fix would only apply to the info view and not to other views which might want this information (e.g. the tree view currently uses it).

I think the long-term fix should be cylc-flow end so would rather stick any bodges / workarounds there if possible. Happy to undraft the hack PR, was hoping we could come up with a more global fix.

@hjoliver
Copy link
Member

hjoliver commented Nov 5, 2024

Unblocked by merge of cylc/cylc-flow#6403 ... I think

src/services/mock/json/infoView.json Outdated Show resolved Hide resolved
cypress/component/info.cy.js Outdated Show resolved Hide resolved
Comment on lines 224 to +227
isEditable (mutation, authorised) {
return mutation.name !== 'log' && !this.isDisabled(mutation, authorised)
return mutation.name !== 'log' && mutation.name !== 'info' && !this.isDisabled(mutation, authorised)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
isEditable (mutation, authorised) {
return mutation.name !== 'log' && !this.isDisabled(mutation, authorised)
return mutation.name !== 'log' && mutation.name !== 'info' && !this.isDisabled(mutation, authorised)
isEditable (mutation = {}, authorised = false) {
return !['log', 'info'].includes(mutation.name) && !this.isDisabled(mutation, authorised)

tests/e2e/specs/info.cy.js Outdated Show resolved Hide resolved
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

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

Approved although ideally pending the fix for default view selection

oliver-sanders and others added 9 commits December 11, 2024 10:51
* Bare bones task metadata view.
* Display task metadata, prerequisites and outputs.
* Support for viewing task configuration, broadcasts, etc to follow in
  future PRs.
* Support for markup (e.g. markdown & reStructured text) to arrive in
  future PRs (pending a decision on how to configure the markup
  language).
* Added offline data.
* Added component tests to cover component display.
* Added e2e test to cover opening view, expansion state and data
  provision.
* Remove the "c" prefix from prerequisite expressions and task aliases.
* This matches `cylc show`.
Co-authored-by: Tim Pillinger <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
@oliver-sanders
Copy link
Member Author

Approved although ideally pending the fix for default view selection

On it.

@oliver-sanders
Copy link
Member Author

(rebased)

@oliver-sanders oliver-sanders mentioned this pull request Dec 11, 2024
@wxtim
Copy link
Member

wxtim commented Dec 16, 2024

Re-reviewed and happy. 👍🏼

@wxtim wxtim merged commit 0db3d62 into cylc:master Dec 16, 2024
7 checks passed
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.

info view: add completion expression info task metadata view
5 participants