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

workflow reg argument parsing #4230

Closed
oliver-sanders opened this issue May 26, 2021 · 1 comment · Fixed by #4285
Closed

workflow reg argument parsing #4230

oliver-sanders opened this issue May 26, 2021 · 1 comment · Fixed by #4285
Assignees
Milestone

Comments

@oliver-sanders
Copy link
Member

oliver-sanders commented May 26, 2021

At the moment the parsing of the workflow argument is not fully centralised.

For the "offline" commands (e.g. cylc diff, cylc config, cylc list) we have the centralised parse_workflow_arg function.

For the "online" commands (e.g. pause, stop, trigger) we don't have any centralised function, we usually (but don't always) do os.path.normpath(workflow).

I think we should pull this functionality into a single function something along the lines of:

# cylc.flow.workflow_files
...
def parse_reg(reg, src=False, run=False) -> str:
    """
        Args:
            src: Reg can be a source workflow located by an absolute path.
            run: Reg can be a run directory located by relative path from ~/cylc-run/
    """
# cylc.flow.scripts.pause
...
def main(reg, ...):
     reg = parse_reg(reg, run=True)

This is better for maintenance and would provide us with a good place to handle future changes to registration parsing:

@oliver-sanders
Copy link
Member Author

As of #4228 the runN symlink handling is done in cylc.flow.terminal, this should be moved out into the new centralised thinggy with this issue.

See #4228 (comment)

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 a pull request may close this issue.

2 participants