[openstack-dev] [api] [heat] microversion_parse.middleware.MicroversionMiddleware

Chris Dent cdent+os at anticdent.org
Tue Mar 6 21:56:18 UTC 2018


Last week at the PTG, during the API-SIG session, there was
discussion of extracting the microversion handling middleware that
is used in the placement service into the relatively small
microversion-parse library. This is so people who want to adopt
microversions (or change their implementation) can share some code.

This evening I've got a working version of that, and would like some
feedback (and a few other things as well).

The code is in a stack starting with https://review.openstack.org/#/c/495356/

In total that stack of patches moves most of the microversion
handling code out of placement and adapts it (with some caveats) to
general use.

As a sort of proof, there's also a nova patchset which shows the
removed code. If you install the above stack into the checked out
nova patchset, it works as expected. That nova change is at
https://review.openstack.org/#/c/550265/

Right now the microversion-parse changes are pretty rough but I
don't want to go too far down the road of cleaning them up if the
approach is not going to work for people. Looking at the two
different patchsets will make some of the current limitations more
clear, but some that I'm aware of:

* It wants to use webob, because that's how it started out. This is
   pretty easy to fix with one challenge being managing error
   formatting.

* At the moment it is not yet set up to align with deployment
   strategies such as paste (it uses old school wsgi initialization
   and wrapping). Also pretty easy to fix.

There are some weird boundaries between version info used by the
application, and version info used by the middleware. In the case of
placement, there's some code left in placement for managing
different methods for different versions of requests to the same
URL. This kind of thing would be pretty nice to have in a library,
but the current implementation is very tied to the way placement
does dispatch. For services that already have their own routing
dispatch system, that's kind of a non-starter.

Anyway, if this is a topic of interest to you the code linked above
is available for review and experimentation. If it turns out to be
something people like I'll start the process of making a new release
and getting that release into global requirements.

The other things I'm thinking about are:

* microversion-parse needs more cores. Right now there are only
   three and two of those are unable to be super active in the
   community any more. If you are someone who has knowledge of
   microversions and WSGI middleware, look at the code, and let me
   know.

* If this code is going to be used outside of placement, it may make
   sense for it to go under the umbrella of oslo. I think we may have
   discussed that when the microversion-parse library was initially
   created and at the time I took a wait and see attitude. Is now the
   time? I don't know.

Thanks for your attention and feedback.

-- 
Chris Dent                      (⊙_⊙')         https://anticdent.org/
freenode: cdent                                         tw: @anticdent


More information about the OpenStack-dev mailing list