Edgewall Software
Modify

Opened 11 years ago

Last modified 10 years ago

#11585 new enhancement

Backport Apache Bloodhound web bootstrap handlers

Reported by: Olemis Lang <olemis+trac@…> 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 Olemis Lang <olemis+trac@…>, 11 years ago

There is an initial patch . These are the test results .

$ python trac/tests/functional/__init__.py
SKIP: fine-grained permission tests (ConfigObj not installed)
SKIP: fine-grained permission tests (ConfigObj not installed)
SKIP: versioncontrol/tests/functional.py (no svn bindings)
SKIP: RegressionTestTicket11176 (ConfigObj not installed)
SKIP: reST wiki tests (no docutils)
SKIP: RegressionTestTicket8976 (ConfigObj not installed)

.................................................................................................................................................................................
----------------------------------------------------------------------
Ran 178 tests in 483.517s

OK

I'm setting up my environment in order to touch skipped test cases .

comment:2 by Olemis Lang <olemis+trac@…>, 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 Remy Blank, 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 Olemis Lang <olemis+trac@…>, 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 Olemis Lang <olemis+trac@…>, 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 Olemis Lang <olemis+trac@…>, 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 Ryan J Ollos, 10 years ago

Milestone: undecided

milestone:undecided for now, but I'll look at it during milestone:1.1.3.

comment:8 by Ryan J Ollos, 10 years ago

Rather, milestone:1.1.4, along with #11588.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.