amaannawab923 commented on code in PR #45522:
URL: https://github.com/apache/superset/pull/45522#discussion_r4401286971
##########
superset/initialization/__init__.py:
##########
@@ -667,6 +671,12 @@ def init_extensions(self) -> None:
return
for extension in extensions.values():
+ # Before the backend entrypoint runs: a page is declared in the
+ # manifest, so it does not depend on extension code importing
+ # cleanly, and a frontend-only extension contributes pages too.
+ register_extension_pages(self.superset_app, extension.manifest)
Review Comment:
Checked this, and the ordering is real and deliberate but the consequence
described does not follow.
The ordering is intentional: pages are registered from the manifest before
`eager_import(backend.entrypoint)` so that registering a page does not depend
on extension code importing cleanly, and so a frontend-only extension
contributes pages too. That reasoning is in the comment at the call site.
Where it comes apart is "both routes are installed", which is true but is
not a conflict. Werkzeug dispatches by specificity rather than registration
order, so an entrypoint route carrying more static segments wins over the
page's `/<path:rest>` catch-all regardless of which was added first -- which is
the outcome you would want anyway, since the entrypoint route is the more
specific declaration.
The honest gap is narrower: the boot-time conflict log reports collisions
with routes present at the time it runs, so it cannot mention a route the
entrypoint adds afterwards. That is a reporting limitation, not a routing one,
and the fix would be to move the log rather than the registration -- which
would reintroduce the dependency on the entrypoint importing cleanly.
Leaving it as-is for now, and flagging that this machinery goes away
entirely if pages move to a host-owned route under SIP-235.
--
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]