fix(expressions): prefer exact placeholders over exprs#7397
fix(expressions): prefer exact placeholders over exprs#7397dwisiswant0 wants to merge 2 commits into
Conversation
Signed-off-by: Dwi Siswanto <git@dw1.io>
`FindExpressions` checks marker contents with govaluate before doing normal placeholder replacement. That breaks valid hyphenated names like `request-id`: govaluate reads them as subtraction lol, and the lookup fails with a missing request parameter. If a marker exactly matches a key in the replacement map, treat it as a plain placeholder and let normal replacement handle it. Authored expressions should still be evaluated, and malformed helper calls should still return errors. Fixes #7395 Signed-off-by: Dwi Siswanto <git@dw1.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR fixes template variable resolution for names containing hyphens. The ChangesHyphenated Template Variable Resolution
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Neo — Command Did Not CompleteWarning Your To retry: Comment your command again. Comment |
Neo - PR Security ReviewNo security issues found Comment |
Proposed changes
FindExpressionschecks marker contents withgovaluate before doing normal placeholder
replacement. That breaks valid hyphenated names
like
request-id: govaluate reads them assubtraction lol, and the lookup fails with a
missing request parameter.
If a marker exactly matches a key in the
replacement map, treat it as a plain placeholder
and let normal replacement handle it. Authored
expressions should still be evaluated, and
malformed helper calls should still return errors.
Fixes #7395
Proof
patch:
dev:
Checklist
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
{{foo-bar}}) are now properly resolved from variable mappings