-
Notifications
You must be signed in to change notification settings - Fork 94
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
Flow trigger CLI and defaults #4739
Conversation
d5e6156
to
7bbc0c4
Compare
7bbc0c4
to
a1eefed
Compare
Fast tests will fail till #4746 goes in. |
742e4e4
to
eb958ca
Compare
This fixes and extends the DB $ sqlite3 -header ~/cylc-run/ft/runN/log/db "select * from task_outputs;"
cycle|name|flow_nums|outputs
1|foo|[1]|["submitted", "started", "succeeded"]
1|bar|[1]|["submitted", "started", "the quick brown fox", "succeeded"]
1|baz|[1]|["submitted", "started", "failed"] For repeat-running a task in the same flow via |
DONE |
b00913e
to
52b7f52
Compare
52b7f52
to
bf94081
Compare
bf94081
to
294cc56
Compare
(Rebased and deconflicted) |
Reviewing both parts together, only one issue found so far, the trigger mutation is broken in Tui and needs a small metadata change. Here's a PR that adds a default value to the flow arg to allow tui to work with the mutation: And a UI PR to fix a bug that caused the flow arg to be registered as required (in the amended schema): |
Thanks, merged! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most the way through.
2093722
to
70ce9e6
Compare
Feedback addressed. |
70ce9e6
to
1c59e54
Compare
Doesn't look like it's merged.. |
Oops, good spot. It is now. I must have been waiting for tests or something. |
Rightly so, it appears, Looks like there's a style hick-up over the f-docstring:
You wouldn't mind rebasing also? so I don't have to pip install (the master changes) (though I've done my testing, so all good either way) |
* Set default values for args to allow them to be fired without additional context information. * Add descriptions. * Centralise the "flow" argument so it can be easily added to other mutations later.
bf2797c
to
be68c3c
Compare
Rebased. |
(Damn it, tests all passed before I merged that side PR and rebased!) |
FYI @oliver-sanders (and others) - doc-strings cannot be f-strings: https://docs.python.org/3/reference/lexical_analysis.html#formatted-string-literals |
113325b
to
a847222
Compare
All fixed 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me:
- Worked in my environment.
- Tests passed.
- Code is fine.
👍
@@ -1404,6 +1406,11 @@ def description(self): | |||
return StopMode(self.value).describe() | |||
|
|||
|
|||
class Flow(String): | |||
"""An integer or one of {FLOW_ALL}, {FLOW_NEW} or {FLOW_NONE}.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to leave those variables unexpanded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't expand them, or the docstring ceases to be a docstring (see my comment on that).
I think it's fine to leave like that. Docstrings describe code, so it's not unreasonable for them to refer to variable (or constant) names. I should perhaps have removed the braces, but I added to comment to note that it shouldn't be turned back into an f-string.
TIL. You can modify, format or even replace a docstring after it has been declared, however, you cannot do so at the time of declaration. FOO = 42
class Modified:
'{FOO}'
Modified.__doc__ = Modified.__doc__.format(**globals())
class FString:
f'''{FOO}'''
class Format:
'''{FOO}'''.format(**globals())
# this works
print(Modified.__doc__)
# these don't
print(FString.__doc__)
print(Format.__doc__) $ python mess.py
42
None
None |
Note: confirmed the tests from #4651 now all pass on this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completed functional review, all good except one bug which can cause multiple new flows to be created for a single trigger --flow=new
event.
Put up a fix: hjoliver#22
Otherwise good!
Flow triggers wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Thanks @hjoliver this has been a fun one!
Heheh, yes it has 🤣 🎉 |
It turns out there was a change to the DB structure in cylc#4739 (8.0rc3). The restart incompat version should have been bumped but this was missed.
These changes close #4686. Built on top of - and now replaces - #4738
Implement final agreed CLI and defaults for flow triggering.
TBD--flow=INT
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
andconda-environment.yml
.