Opened 11 years ago
Last modified 10 years ago
#11585 new enhancement
Backport Apache Bloodhound web bootstrap handlers
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | undecided |
Component: | web frontend | Version: | 1.1.1dev |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The immediate goal of this ticket is to propose web bootstrap handlers to be committed into Trac , also as a preamble of a probable candidate to the solution proposed in #8509 . Both tickets fit into a much broader vision consisting in incorporating a more flexible and efficient request dispatching solution at the core of Trac . Currently there are two steps : environment dispatching , request dispatching .
<ot> In order to mention one use case this could be the starting point to unify environment and request dispatching . Afterwards this it'd be possible to cache routing information in memory and still implement lazy loaders for request handlers (similar to webapp2 lazy handlers ) . Another use is to integrate it with other frameworks (e.g. Routes , webapp2 , Django dispatching , …) </ot>
Attachments (0)
Change History (8)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
A second run reveals that everything seems to be ok
$ python trac/tests/functional/__init__.py SKIP: versioncontrol/tests/functional.py (no svn bindings) ...................................................................................................................................................................................... ---------------------------------------------------------------------- Ran 182 tests in 292.829s OK
… see #11586
comment:3 by , 11 years ago
Could you please explain what "web bootstrap handlers" are and what problem they solve, for those of us who don't follow Bloodhound development closely?
comment:4 by , 11 years ago
Sorry , I just thought I had included a link to [bh:wiki:Proposals/BEP-0003#hooks BEP 3] in the description . So basically these are objects responsible for loading an environment and creating an instance of trac.web.api.Request
(or equivalent) based on data stored in WSGI environment representing an incoming HTTP request . In Bloodhound they are meant to support a number of [bh:wiki:Proposals/BEP-0003#hooks URL mappings] at deployment time . For instance if there is no filesystem handy (let's say Google App Engine or maybe other cloud environments , which is kind of a much long-term target) then maybe even custom environments have to be implemented to handle requests . All this flexibility is made possible by encapsulating these aspects inside bootstrap handlers and by making them replaceable (like shown in the patch)
comment:5 by , 11 years ago
OTOH , let's say that another component manager has been implemented ( see #11121 ) and there will be some URL routing involved under the hood so that it will process some requests too . Activating it will basically consist in implementing a custom web bootstrap handler and configuring it at deployment time . So this opens the Pandora box and expands the possibilities of using the Trac component architecture beyond the boundaries of environments .
This is exactly what we do in our BH servers . The other component managers are product environments and custom URL routing involves sub-domains . Our web bootstrap handlers are powered by Routes and generic/powerful enough to implement environment (#11585) & request (#8509) dispatching in a single step (which is another short-term goal for us) .
p.s. we plan to release that plugin few days after PyCon 2014 will be over , so a link to the source code is coming soon .
comment:6 by , 11 years ago
… and finally this will offer an approach to embed Trac (and also Bloodhound ;) web sites into other web apps (e.g. those built with Django , Flask , …) because the later will not need to dive into the details of the Trac framework to dispatch requests but instead expose the web bootstrap handlers (or lightweight adapters built on top of them) as a controller activated according to some external URL routing definition .
comment:7 by , 10 years ago
Milestone: | → undecided |
---|
milestone:undecided for now, but I'll look at it during milestone:1.1.3.
There is an initial patch . These are the test results .
I'm setting up my environment in order to touch skipped test cases .