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

config: validate [runtime] task names #4199

Merged
merged 2 commits into from
Apr 28, 2021
Merged

Conversation

oliver-sanders
Copy link
Member

@oliver-sanders oliver-sanders commented Apr 27, 2021

Closes #3160

Validate task names in the [runtime] section, autodocument from this code (corrects the docs on valid task name patterns).

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.
  • (master branch) I have opened a documentation PR at Document valid task names cylc-doc#242
  • No dependency changes.

@oliver-sanders oliver-sanders added bug Something is wrong :( small labels Apr 27, 2021
@oliver-sanders oliver-sanders added this to the cylc-8.0b2 milestone Apr 27, 2021
@oliver-sanders oliver-sanders self-assigned this Apr 27, 2021
Comment on lines +56 to +61
validate = partial(
WorkflowConfig,
reg,
str(Path(run_dir, reg, 'flow.cylc')),
ValidateOptions()
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Performing a full validation rather than just calling the TaskNameValidator directly as the reported bug is more nuanced.

@MetRonnie
Copy link
Member

Looks good, apart from need to handle parameterised names

WorkflowConfigError: task/family name can only contain: alphanumeric, ``-``, ``+``, ``%``, ``@``
[runtime][[foo<i>]]

@oliver-sanders
Copy link
Member Author

Looks good, apart from need to handle parameterised names

Parameters are expanded out before the names are validated.

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.

👍

@hjoliver
Copy link
Member

Looks good, apart from need to handle parameterised names

WorkflowConfigError: task/family name can only contain: alphanumeric, ``-``, ``+``, ``%``, ``@``
[runtime][[foo<i>]]

How did you generate that error @MetRonnie ?

@MetRonnie
Copy link
Member

It was in the tests, fixed now

@MetRonnie MetRonnie merged commit 1c8e97a into cylc:master Apr 28, 2021
@oliver-sanders oliver-sanders deleted the 3160 branch April 28, 2021 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :( small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid runtime (only) namespaces pass validation
4 participants