feat: expand SQL query filter "All" in dependent filters, disable loops #3896
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3896"
general
weight: 0.35
pulpdrew
Summary
"All" on a SQL query filter now gives other filters' options queries every option, the same as tiles get, matching Grafana.
1=1), so a dependent dropdown listed options for values outside that list.$__conditionalAlldon't wait, since it is1=1on "All".clickstack_save_dashboardwarns about such loops, andquery_tile/query_tilesfail when one of the looping filters is passed "All". They load "All" options in dependency order, running independent queries at the same time instead of one after another.getAllOptionsLoopErrors,getAllSelectionDependenciesandgetFilterValuesTemplate, shared by the app and MCP.Behaviour notes
$__conditionalAllstill wait for its options, as in #3861.Screenshots or video
<img width="711" height="301" alt="Screenshot 2026-12-03 at 12 35 43" src="https://github.com/user-attachments/assets/0b9df3d6-d80d-4f4f-8645-25fc378dbf39" />
<img width="775" height="626" alt="Screenshot 2026-12-03 at 12 06 00" src="https://github.com/user-attachments/assets/01330ce4-a741-49a6-bd0c-d43c56bf9b38" />
How to reproduce
Import the dashboard below. Pick "All" in Region, Zone and Cloud, and select
goldin Tier. Tier uses "SQL expression values" on the Logs source and does not offer "All". Zone's query keeps the zones whose region is in$region; Region returnseuandus, but there is also anap-1zone.<details>
<summary>Test dashboard</summary>
</details>
On #3862 (base):
1. Open the Zone dropdown. It lists
eu-1, eu-2, us-1, ap-1, and the Zones tile shows all four.On this branch:
1. Open the Zone dropdown. It lists only
eu-1, eu-2, us-1, and the Zones tile showsZones: eu-1, eu-2, us-1.2. Set Region to just
us. Zone lists onlyus-1. Set Region back to "All".3. Click the filter icon next to Refresh ("Edit filters and variables"), edit Region's query to
SELECT arrayJoin(['eu', 'us']) AS region WHERE sleep(3) = 0 AND $__fromTime_ms > 0and save. Close the modal and click Refresh: for about 3 s the Zones tile shows "Loading the options for Zone…" and the Zone dropdown loads, then both fill in.ap-1never appears.4. Edit Region's query to
SELECT throwIf(1, 'Region query failed') AS region. The Zone label and the Zones tile show "Couldn't load the options for Region: Region query failed…". Edit Zone and click "Preview values": it shows the same error instead of running. Restore Region's query.5. Edit Tier ("SQL expression values"). Set "Dropdown values filter" to SQL and enter
$__filter(ServiceName, $cloud), then click "Save filter". The editor refuses: "Cloud and Tier reference each other in their options queries, which "All" doesn't support. Remove one of the references." Clear the dropdown-values condition and save again; the save succeeds.References
<!-- CURSOR_SUMMARY -->
---
<!-- /CURSOR_SUMMARY -->