Skip to content

Improve the trigger/complete expression handling ECFLOW-2112#397

Merged
marcosbento merged 3 commits into
developfrom
task/expression_spec
Jul 22, 2026
Merged

Improve the trigger/complete expression handling ECFLOW-2112#397
marcosbento merged 3 commits into
developfrom
task/expression_spec

Conversation

@marcosbento

@marcosbento marcosbento commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Add a proper trigger/complete expression specification
  • Detect and reject invalid expressions (e.g. /p/n1 == completeand /p/n2 == complete)

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

🌦️ >> Documentation << 🌦️
https://sites.ecmwf.int/docs/dev-section/ecflow/pull-requests/PR-397

@codecov-commenter

codecov-commenter commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.43165% with 55 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.10%. Comparing base (92302ff) to head (75bfde6).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
...e/test/expressions/TestExpressionsGoldenCorpus.cpp 50.00% 55 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #397      +/-   ##
===========================================
+ Coverage    52.08%   52.10%   +0.01%     
===========================================
  Files         1247     1248       +1     
  Lines       101710   101827     +117     
  Branches     15135    15155      +20     
===========================================
+ Hits         52974    53052      +78     
- Misses       48736    48775      +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcosbento
marcosbento force-pushed the task/expression_spec branch from 0c1a176 to db62862 Compare July 22, 2026 18:44
@marcosbento
marcosbento marked this pull request as ready for review July 22, 2026 20:29
Document the expression language used by the trigger and complete
attributes as a dedicated, reference-level page in the User Manual.
The specification is derived from the expression lexer/parser and the
abstract syntax tree it produces, and covers the operands and
operators, a two-layer (lexical and syntactic) EBNF grammar, operator
precedence and associativity, and worked examples showing the
fully-bracketed parse of representative expressions.

Re ECFLOW-2112
Define each expression's fully-bracketed AST rendering and assert it
byte-for-byte, to lock parser behaviour.

Defines also invalid_expressions, for which parser refusal is asserted.

Also adds test for expressions with attached tokens for keyword/operand
glue cases.

Re ECFLOW-2112
Keywords (word operators, states, event states, flags, integers,
datetimes) matched via bare prefix rules, so glued tokens like
"completeand" or "515and" were silently split in two and misparsed
instead of rejected.

Require a trailing word boundary on each, via an inlined zero-width
lookahead kept inside the lexeme scope; the boundary also counts '.'
so a keyword glued to a relative path ("and./12") is rejected.
Also make variable paths contiguous (no space around ':').

Re ECFLOW-2112
@marcosbento
marcosbento force-pushed the task/expression_spec branch from db62862 to 75bfde6 Compare July 22, 2026 20:31
@marcosbento
marcosbento merged commit 2420c7a into develop Jul 22, 2026
136 checks passed
@marcosbento
marcosbento deleted the task/expression_spec branch July 22, 2026 20:34
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 this pull request may close these issues.

2 participants