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

Modernise 'cylc dump -t' print format. #6440

Merged
merged 5 commits into from
Nov 20, 2024
Merged

Conversation

hjoliver
Copy link
Member

@hjoliver hjoliver commented Oct 22, 2024

This has been annoying me forever.

Master 🤮:

$ cylc dump -t bug --flows
foo, 100, running, not-held, not-queued, not-runahead, [1]
foo, 101, waiting, not-held, not-queued, runahead, [1]
foo, 96, running, not-held, not-queued, not-runahead, [1]
foo, 97, running, not-held, not-queued, not-runahead, [1]
foo, 98, running, not-held, not-queued, not-runahead, [1]
foo, 99, running, not-held, not-queued, not-runahead, [1]

This branch:

$ cylc dump -t bug --flows
91/foo:running flows=[1]
92/foo:running flows=[1]
93/foo:running flows=[1]
94/foo:running flows=[1]
95/foo:running flows=[1]
96/foo:waiting (runahead) flows=[1]

QUESTION: is it OK to make the new format the default?
(As I have done, with -l/--legacy to generate the old format)

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 pull request opened if required at cylc/cylc-doc/pull/XXXX.
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@hjoliver hjoliver added small question Flag this as a question for the next Cylc project meeting. could be better Not exactly a bug, but not ideal. labels Oct 22, 2024
@hjoliver hjoliver added this to the 8.4.0 milestone Oct 22, 2024
@hjoliver hjoliver self-assigned this Oct 22, 2024
@oliver-sanders
Copy link
Member

I think this is fine (especially as you've added a legacy format option).

If we're preserving the old format long-term we might want to call it --porcelain or something like that (the simple table is much easier for things like awk to parse).

@oliver-sanders oliver-sanders removed the question Flag this as a question for the next Cylc project meeting. label Oct 24, 2024
@hjoliver hjoliver marked this pull request as ready for review November 8, 2024 09:22
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.

LGTM

Copy link
Member

@dwsutherland dwsutherland left a comment

Choose a reason for hiding this comment

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

Looks good.. We adding a legacy format to avoid changing all the tests?
I guess someone might like it (or use it) 😆

@hjoliver
Copy link
Member Author

Looks good.. We adding a legacy format to avoid changing all the tests? I guess someone might like it (or use it) 😆

Not so much adding it, but keeping it just in case anyone is relying on it. (Not trying to avoid changing the tests, honest!)

@dwsutherland
Copy link
Member

I don't know how the patch coverage has been calculated? I wouldn't have thought there would be many indirect losses from this change...

@hjoliver
Copy link
Member Author

From a quick look on Codecov, I don't get it:

Screenshot (17)

The yellow ("partial") lines are covered by my integration test, and the red (not-covered) lines are not changed on this branch.

@oliver-sanders
Copy link
Member

To turn those yellow lines green we need a test that makes the if fall in either direction, e.g. at least one task which is held and one task which is not held.

@hjoliver
Copy link
Member Author

At first glance I thought it was odd because those if blocks don't have an else clause. But the do-nothing option does affect the following logic of course - so that explains it, thanks! I'll extend the tests...

@hjoliver
Copy link
Member Author

Patch coverage now 100% 🎉

@hjoliver hjoliver merged commit 01bbca5 into cylc:master Nov 20, 2024
26 checks passed
@hjoliver hjoliver deleted the cylc-dump-format branch November 20, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could be better Not exactly a bug, but not ideal. small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants