Repository navigation
Throw when the rows under a #[DependsOn] key hold none of its variables - #331
Conversation
A declaration with `key` whose rows hold none of the template's variables now throws
DependsOnNotExpandable ("no row under '<key>' holds '<variable>'"). Such a variable was
read from the body's top level or an argument of the same name, so a column named apart
from the template (`article_id` for `{id}`) expanded from the argument and the rows'
dependencies were lost without an error. A variable no row holds is still read from
outside when the rows hold another variable of the template.
|
@coderabbitai review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #331 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 878 887 +9
===========================================
Files 121 121
Lines 1965 1978 +13
===========================================
+ Hits 1965 1978 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Action not completed
|
…ot expand Rows that hold a template variable, but only as an array or a non-Stringable object, now fail with "'<variable>' is <type>" instead of "no row under '<key>' holds '<variable>'", and a variable repeated in the template is named once in the reason. Covered by two new notExpandableProvider cases; docs say the new rule only for rows holding none of the variables.
|
@coderabbitai review 3adb035 was merged without your review because of the review limit. It names the type in |
|
Tip For best results, initiate chat on the files or code changes. Analysis chain
Test gap: I inspected the source but could not run the tests in this sandbox. You are interacting with an AI system. |
#[DependsOn(uri: ..., key: ...)]now throwsDependsOnNotExpandablewhen the rows underkeyhold none of the template's variables. The reason isno row under '<key>' holds '<variable>'.Until now such a variable was read from the body's top level or the
onGet()arguments. A row column named apart from the template, such asarticle_idfor#[DependsOn(uri: 'app://self/item?id={id}', key: 'articles')]ononGet(int $id), expanded from the argument: the list depended onitem?id=<the argument>instead of its rows, with no error. Without a value of the same name outside, the same mistake already threw.Unchanged:
article?ulid={channelId}-{id}, still reads the outside one.key.keyis new in 1.21, so this changes no released behaviour. No public type is added. CHANGELOG[Unreleased], theDependsOn/DependsOnNotExpandabledocblocks anddocs/llms-full.txtare updated. Tests:DependsOnTest::testADeclarationThatCannotExpandThrowsAndStoresNothing(newrows/renamed-columncase) andtestAVariableTheRowLacksIsReadFromTheTopLevelThenTheArguments.Summary by CodeRabbit