• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla-services / cliquet / 2320
100%
master: %

Build:
Build:
LAST BUILD BRANCH: 186-215-add-sqlachemy-pooling
DEFAULT BRANCH: master
Ran 20 Oct 2015 09:28AM UTC
Jobs 6
Files 68
Run time 7min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2320

push

travis-ci

leplatrem
Pass current request along every backends methods.

**Rationale*:

This small refactor paves the way for:

* persisting backend connections on current request (instead of pull/push from queue for each operation performed with one request, e.g batched requests)
* having one transaction per request (with a tween to connect / commit). Particularly interesting for batched requests. (see https://github.com/Kinto/kinto/issues/194)
* have one event per request, with every created/updated/deleted records of a batch

Of course, it may seem ugly to pass the request, but it is advocated [in Pyramid docs](http://pyramid.readthedocs.org/en/1.5-branch/narr/threadlocals.html#why-you-shouldn-t-abuse-thread-locals):

> get_current_request function should never be called because it’s “easier” or “more elegant” to think about calling it **than to pass a request through a series of function calls when creating some API design**. Your application should instead almost certainly pass data derived from the request around rather than relying on being able to call this function to obtain the request in places that actually have no business knowing about it.

We could pass a derived info like `request.bound_data`, but I like the fact to pass the request object.

Especially because it gives a lot of freedom in possible backend implementation (*imagine a box.com storage backend where original request headers are manipulated before being sent to third party service...*)

75 of 75 new or added lines in 13 files covered. (100.0%)

7170 of 7193 relevant lines covered (99.68%)

2.99 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2320.1 (TOX_ENV=py27) 20 Oct 2015 09:29AM UTC 0
99.65
Travis Job 2320.1
2 2320.2 (TOX_ENV=py34) 20 Oct 2015 09:30AM UTC 0
99.65
Travis Job 2320.2
3 2320.3 (TOX_ENV=pypy) 20 Oct 2015 09:36AM UTC 0
99.68
Travis Job 2320.3
4 2320.4 (TOX_ENV=py27-raw) 20 Oct 2015 09:29AM UTC 0
Travis Job 2320.4
5 2320.5 (TOX_ENV=flake8) 20 Oct 2015 09:28AM UTC 0
Travis Job 2320.5
6 2320.6 (TOX_ENV=docs) 20 Oct 2015 09:30AM UTC 0
Travis Job 2320.6
Source Files on build 2320
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2320
  • 543643fb on github
  • Prev Build on refactor-backends-with-request (#2316)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc