aminghadersohi opened a new pull request, #44732:
URL: https://github.com/apache/superset/pull/44732
### SUMMARY
Remove the redundant `LogRestApi` registration from
`SupersetAppInitializer.init_views()`, eliminating the "View already exists
LogRestApi ignoring" startup warning. The first registration stays in place;
log API routes, permissions, and implementation are unchanged.
Add a cheap AST-based unit guard requiring exactly one log API registration
and rejecting duplicate API class expressions throughout `init_views()`,
including feature-flagged blocks. This deliberately checks source structure
without bootstrapping every view or requiring a database.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable; no UI changes.
### TESTING INSTRUCTIONS
- Regression guard: confirmed **1 failed** before removing the duplicate,
then **1 passed** after:
`uvx --from pytest pytest --confcutdir=tests/unit_tests/initialization
tests/unit_tests/initialization/init_views_test.py -q`
- Standard unit-test invocation with the local Python environment and
`superset-core/src` on `PYTHONPATH`: **1 passed**.
- `uvx pre-commit run --files superset/initialization/__init__.py
tests/unit_tests/initialization/init_views_test.py`: **11 hooks passed, 13
skipped**, including mypy, ruff, and pylint.
- Existing `tests/integration_tests/log_api_tests.py`: **6 passed, 4
failed**. The four recent-activity tests encountered a stale local SQLite
schema (missing `report_schedule.execution_owner`); Redis on localhost:6379 was
also unavailable. This suite needs rerunning in a fully configured test
environment.
- Manual verification: start Superset, confirm the duplicate-view warning is
absent, and exercise `/api/v1/log/` with the same permissions as before.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] 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
--
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]