fix: resolve direct path expressions on Any-typed variable as Any#98
fix: resolve direct path expressions on Any-typed variable as Any#98
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts Zeebe FEEL variable resolution so that unresolved path expressions (e.g. =agent.context) do not get typed as Null when their root variable is effectively unknown (Any), preserving the original FEEL expression in info for UI display.
Changes:
- Extend
resolveReferencesto convert certainnullevaluation results intoAny(atomicValueundefined) when the referenced root variable isAny-typed. - Preserve the original FEEL expression as
infofor these “unknown” results (aligning with #87 expectations).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| return entry instanceof EntriesContext && | ||
| getType(entry.value) === 'Any'; |
There was a problem hiding this comment.
@copilot Provide a test case that proves the suggestion
nikku
left a comment
There was a problem hiding this comment.
Makes sense.
We could add an additional test to verify nested behavior =agent.foo.bar with agent.foo being defined vs. agent being defined vs. agent not being defined - I am not sure how the current roots detection will handle such scenarios.
Research question: If agent = { bar: 10 } exists, what is the value of agentFooBar = agent.foo.bar?
We can also leave that for another day. Overall, good stuff. Good to start from solid test coverage ⭐
Related to #87 Path FEEL expressions like `=agent.context` on an `Any`-typed variable incorrectly resolve as `null` with `Null` type instead of `Any`.
The current root detection implementation is only providing top-level variables, not property accesses. So, when I think this pull request introduces a pragmatical iteration for variables like the third sample in the table above without introducing an irrecoverable complexity. So I plan to go ahead with this pull request (as it's a partial improvement) and create an issue to follow up on the other scenarios especially after #74 lands. |
Related to #87
Proposed Changes
This pull request aims to mark unresolved FEEL path expression variables as any preserving their FEEL expression as
info.Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool