fix(permalink): accept null entries in activeTabs for v5-imported dashboards#40969
Conversation
Code Review Agent Run #69bcedActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #40969 +/- ##
==========================================
+ Coverage 64.23% 64.30% +0.06%
==========================================
Files 2657 2657
Lines 144028 144028
Branches 33208 33208
==========================================
+ Hits 92521 92612 +91
+ Misses 49885 49794 -91
Partials 1622 1622
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
SUMMARY
Fixes #40934.
`DashboardPermalinkStateSchema.activeTabs` is a Marshmallow `fields.List(fields.String(), allow_none=True)`. The list itself accepts `None`, but each element inside the list is a `fields.String()` without `allow_none`, so a list containing a `None` (e.g. `["TAB-abc", null, "TAB-xyz"]`) fails validation with:
```json
{ "message": "{'activeTabs': {N: ['Field may not be null.']}}" }
```
That is exactly the shape v5-exported dashboards persist when one or more tab levels has no active child. Importing such a dashboard into v6 and generating a permalink fails systematically.
This PR adds `allow_none=True` to the inner `fields.String` so `None` entries are accepted while the outer list and the per-entry string typing are otherwise preserved.
BEFORE / AFTER
TESTING INSTRUCTIONS
```bash
pytest tests/unit_tests/dashboards/schema_tests.py -v
```
Three new tests assert:
Manual verification:
ADDITIONAL INFORMATION