rosemarYuan commented on code in PR #821:
URL: https://github.com/apache/flink-agents/pull/821#discussion_r3541037655
##########
runtime/pom.xml:
##########
@@ -193,9 +193,22 @@ under the License.
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
+ <dependency>
+ <groupId>dev.cel</groupId>
+ <artifactId>cel</artifactId>
+ <version>${cel.version}</version>
+ </dependency>
</dependencies>
<build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+
<directory>${project.basedir}/../e2e-test/cel-fixtures</directory>
Review Comment:
Thanks for the review. I updated the trigger-entry contract to make the
type-name vs condition-expression behavior explicit.
The key issue is that the expression parser treats `.` as field selection
and `-` as subtraction. So event type names or attribute keys containing those
characters cannot be written as plain identifiers without ambiguity.
The updated contract is:
- For event type trigger entries:
- standard type names containing only letters, digits, and `_` can still
be used directly, e.g. `@Action("userEvent8")`;
- complex type names containing `.`, `-`, etc. should be quoted as a
string literal, e.g. `@Action("'com.ios.orderEvent'")`;
- in expressions, compare against the type string normally, e.g.
`@Action("type == 'com.ios.orderEvent' && score > 10")`;
- name-like entries such as `a.b.event` or `order-created` now fail at
registration time with guidance to quote them, instead of being parsed
incorrectly and silently never matching.
- For attribute access:
- normal nested keys can still use dot access, e.g. `a.b.c`;
- keys that themselves contain `.` or `-` should use index syntax, e.g.
`score_name['batch-3.12'].region > 10`;
- key existence for such names can use `in`, e.g. `'batch-3.12' in
score_name`.
I also reviewed the test coverage, filled the previously uncovered paths,
and added a simple end-to-end test for trigger conditions.
Besides that, I fixed several details raised in the comments, including
making the public naming/Javadocs use the user-facing “trigger condition”
terminology, centralizing failure handling under the new failure-policy config,
and updating the dist NOTICE/LICENSE entries for the bundled dependencies.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]