SmartJoin incorrectly treats relative paths containing special variable names as special paths - #3022
Conversation
|
Um, AI wrote the code, correct? |
|
Yes, Codex helped with part of the implementation and tests. I worked through the issue and the scope of the fix myself, and went over the implementation a few times before opening the PR. I also changed some parts manually after reviewing the generated code. I'm familiar with the behavior this is trying to preserve — in particular, I ran the tests and lint locally and checked the regression cases before submitting. Happy to explain any part of the change or adjust it based on feedback. |
|
Why wouldn't you just do this? |
Fixes #3021
Description
SmartJoinincorrectly treats ordinary relative paths containing special variable names such as.ROOT_DIRas absolute/special paths, causing them to bypass the base-directory join.The path should be treated as a normal relative path and joined with
base.From looking at the implementation, this may be caused by
isSpecialDirusingstrings.Containsto detect special variables. As a result, an ordinary directory name containing one of these strings can be matched even when the variable is not actually part of a{{ ... }}template expression.A small portion of the code and tests was generated with assistance from Codex.
Checklist