rusackas opened a new pull request, #41130:
URL: https://github.com/apache/superset/pull/41130

   ### SUMMARY
   
   Adds a regression test for #36130. The FAB permission views 
(`PermissionModelView`, `PermissionViewModelView`) used a custom list widget 
pointing at `superset/fab_overrides/list.html`. That template was deleted in a 
Jinja cleanup (#34093) but the widget references were left behind, so when 
those security views are enabled (`FAB_ADD_SECURITY_PERMISSION_VIEW` / 
`FAB_ADD_SECURITY_PERMISSION_VIEWS_VIEW`) they 500'd with 
`jinja2.exceptions.TemplateNotFound`. Reported on `6.0.0rc2`.
   
   The actual fix already landed in #36058, which dropped the dangling widget 
classes so the views fall back to FAB's default list template. There was no 
test guarding that wiring, so this kind of "delete a template, forget the 
widget that points at it" regression sails straight through CI.
   
   The test asserts each view's `list_widget.template` resolves in the Jinja 
environment, which is exactly the call that blew up 
(`flask_appbuilder/widgets.py` → `jinja_env.get_template(self.template)`). It's 
deliberately a template-resolution check rather than an HTTP request: these 
views aren't registered under Superset's default config (the relevant 
`FAB_ADD_SECURITY_*` flags default to `False`), so a route-level test would 
need those flags enabled plus role-permission sync. The resolution check guards 
the exact failure with no flag/permission/DB-state dependencies.
   
   Verified it fails (`TemplateNotFound`) against the pre-#36058 widget wiring 
and passes on current `master`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A, test-only change.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   pytest 
"tests/integration_tests/core_tests.py::TestCore::test_security_fab_views_have_valid_list_template"
   ```
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #36130
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to