You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/06/16 19:23:23 UTC

[PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #41130:
URL: https://github.com/apache/superset/pull/41130#issuecomment-4722642140

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41130?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 55.61%. Comparing base ([`1f95a6c`](https://app.codecov.io/gh/apache/superset/commit/1f95a6c48652d002a33224f896a20a4c1705c84c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4d3086e`](https://app.codecov.io/gh/apache/superset/commit/4d3086ed15faaa9cf35604c3dfa86b3c6ebe2906?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   > :exclamation:  There is a different number of reports uploaded between BASE (1f95a6c) and HEAD (4d3086e). Click for more details.
   > 
   > <details><summary>HEAD has 39 uploads less than BASE</summary>
   >
   >| Flag | BASE (1f95a6c) | HEAD (4d3086e) |
   >|------|------|------|
   >|python|33|2|
   >|presto|5|1|
   >|hive|5|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #41130      +/-   ##
   ==========================================
   - Coverage   64.31%   55.61%   -8.70%     
   ==========================================
     Files        2652     2652              
     Lines      144799   144799              
     Branches    33415    33415              
   ==========================================
   - Hits        93122    80537   -12585     
   - Misses      50016    63535   +13519     
   + Partials     1661      727     -934     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ” | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.33% <ΓΈ> (ΓΈ)` | |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.90% <ΓΈ> (ΓΈ)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.97% <ΓΈ> (-18.59%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/41130/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/41130?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #41130:
URL: https://github.com/apache/superset/pull/41130#issuecomment-4733672277

   ### <span aria-hidden="true">βœ…</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">πŸ”¨</span> Latest commit | 474ed35dbb308344f8c74b9213f91e994131ce44 |
   |<span aria-hidden="true">πŸ”</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a32df3928afdf000813d3fc |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-41130--superset-docs-preview.netlify.app](https://deploy-preview-41130--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">πŸ“±</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQxMTMwLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.HrtWXEH91YT-RyDDLwC66xO_lbN-tKtvRHnJ0ZebVzg)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">πŸ€–</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcpRDoMgDADQu_R7RCaJcbvBjgG0dSQTSMs0xnh3-Xsf74QqZa0N3gAPCOJz_HY30jYoxb-kdhj2wWyJdjVCi5BqKrlvpPorxwf7n7wbkd1rnD0jW2vnp0PHEa4b) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-41130--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41130:
URL: https://github.com/apache/superset/pull/41130#issuecomment-4725889294

   <!-- Bito Reply -->
   The flagged issue is correct. The new test method `test_security_fab_views_have_valid_list_template` lacks type hints for `self` and the return value, which is required by the project's custom rule for new code. 
   
   You can resolve this by updating the method signature as follows:
   
   ```python
       def test_security_fab_views_have_valid_list_template(self) -> None:
   ```
   
   There are no other comments on this pull request to address.
   
   **tests/integration_tests/core_tests.py**
   ```
   def test_security_fab_views_have_valid_list_template(self) -> None:
   ```


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41130:
URL: https://github.com/apache/superset/pull/41130#issuecomment-4735337951

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41130:
URL: https://github.com/apache/superset/pull/41130#issuecomment-4722605886

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #41130:
URL: https://github.com/apache/superset/pull/41130


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #41130:
URL: https://github.com/apache/superset/pull/41130#discussion_r3430371129


##########
tests/integration_tests/core_tests.py:
##########
@@ -333,6 +334,21 @@ def test_gamma(self):
         assert "Charts" in self.get_resp("/chart/list/")
         assert "Dashboards" in self.get_resp("/dashboard/list/")
 
+    def test_security_fab_views_have_valid_list_template(self):

Review Comment:
   Good catch, added the `-> None` return hint.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] test(security): regression coverage for #36130 FAB permission view templates [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41130:
URL: https://github.com/apache/superset/pull/41130#discussion_r3425507598


##########
tests/integration_tests/core_tests.py:
##########
@@ -333,6 +334,21 @@ def test_gamma(self):
         assert "Charts" in self.get_resp("/chart/list/")
         assert "Dashboards" in self.get_resp("/dashboard/list/")
 
+    def test_security_fab_views_have_valid_list_template(self):

Review Comment:
   **Suggestion:** Add full type hints to the new test method signature, including annotating `self` and the return type. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? πŸ€” </b></summary>
   
   This is a newly added Python test method and it omits type hints for both
   the `self` parameter and the return value. The rule requires new Python
   code to be fully typed, so this is a real violation.
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=39f40bac1f0f4263a1b5a0f407ed39c2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=39f40bac1f0f4263a1b5a0f407ed39c2&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent πŸ€– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** tests/integration_tests/core_tests.py
   **Line:** 337:337
   **Comment:**
   	*Custom Rule: Add full type hints to the new test method signature, including annotating `self` and the return type.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41130&comment_hash=ec790925297344d9d3b3cdad71296ea1a6e6a90187a4502ba782ccef23dcbeb5&reaction=like'>πŸ‘</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41130&comment_hash=ec790925297344d9d3b3cdad71296ea1a6e6a90187a4502ba782ccef23dcbeb5&reaction=dislike'>πŸ‘Ž</a>



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org