File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ class GraphParser:
186186
187187 # Match @xtriggers.
188188 REC_XTRIG = re .compile (r'@[\w\-+%]+' )
189+ REC_XTRIG_OR = re .compile (r'@.*\s*\|\s*@.*' )
189190
190191 # Match fully qualified parameterized single nodes.
191192 REC_NODE_FULL = re .compile (
@@ -577,11 +578,14 @@ def _proc_dep_pair(
577578 if '' in lefts or left and not all (lefts ):
578579 raise GraphParseError (
579580 f"Null task name in graph: { left } => { right } " )
580-
581581 _rights .update (* ([rights ] or []))
582582
583583 for left in lefts :
584584 # Extract information about all nodes on the left.
585+ if left and self .REC_XTRIG_OR .match (left ):
586+ raise GraphParseError (
587+ "'|' operator is not supported between xtriggers." )
588+
585589 if left :
586590 info = self .__class__ .REC_NODES .findall (left )
587591 expr = left
Original file line number Diff line number Diff line change 3030 WorkflowConfigError ,
3131 XtriggerConfigError ,
3232)
33+ from cylc .flow .graph_parser import GraphParseError
3334from cylc .flow .parsec .exceptions import ListValueError
3435from cylc .flow .pathutil import get_workflow_run_pub_db_path
3536
@@ -488,6 +489,32 @@ def test_xtrig_signature_validation(
488489 validate (id_ )
489490
490491
492+ def test_xtrig_or_fails_validation (
493+ flow : "Fixture" ,
494+ validate : "Fixture" ,
495+ ):
496+ """Xtriggers cannot be chained with the 'or'
497+
498+ https://github.com/cylc/cylc-flow/issues/6771
499+ https://github.com/cylc/cylc-flow/issues/2712
500+ """
501+ id_ = flow (
502+ {
503+ "scheduling" : {
504+ "initial cycle point" : "2024" ,
505+ "xtriggers" : {
506+ "xrandom" : "xrandom(100)" ,
507+ "echo" : "echo(succeed=True)"
508+ },
509+ "graph" : {"R1" : "@xrandom | @echo => foo" },
510+ }
511+ }
512+ )
513+ expected_msg = "'|' operator is not supported between xtriggers."
514+ with pytest .raises (GraphParseError , match = expected_msg ):
515+ validate (id_ )
516+
517+
491518def test_special_task_non_word_names (flow : Fixture , validate : Fixture ):
492519 """Test validation of special tasks names with non-word characters"""
493520 wid = flow ({
You can’t perform that action at this time.
0 commit comments