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

alphagov / backdrop / 2207
92%
master: 89%

Build:
Build:
LAST BUILD BRANCH: upgrade_paas_stack
DEFAULT BRANCH: master
Ran 13 Jan 2015 12:21PM UTC
Jobs 1
Files 63
Run time 27s
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
2207

push

travis-ci

annapowellsmith
Add filter_by_regex parameter for regex support

Add new filter_by_regex parameter. This is similar to the existing
filter_by parameter, except that it will pass a regular expression
query through to Mongo.

The Mongo query is also constructed using 'find', but passed through
as { 'pagePath': /housing-benefit/ } rather than { 'pagePath':
'/housing-benefit' }. Mongo will parse this as a regular expression
query.

We validate and compile the regular expressions using Python's
re module, and pass them to Mongo using pymongo - this should
handle the Python regex -> PCRE conversion for us.

The justification for this parameter is to support multi-part formats in
the info-frontend application - e.g. we would like to serve aggregate
statistics for the number of tickets submitted across all pages in multi-part
guides and smart answers. To do this with the existing filter_by
parameter would require a call to Backdrop for each page in the guide
or smart answer, and some of these formats have 30+ pages. This query
will make these calls a lot faster.

I have done some benchmarking on the speed of regex queries against
the page-statistics and page-contacts datasets, and it seems to be
acceptable. It is faster when regexes are anchored to the start of the
string. I haven't enforced anchoring here (we will do this in the
info-frontend query) but we could do this later if it becomes an issue.

2003 of 2180 relevant lines covered (91.88%)

0.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2207.1 (SKIP_VIRUS_SCAN=1 SKIP_SPLINTER_TESTS=1 MONGO_REPLICA_SET='' NO_AUTOPEP8=1) 13 Jan 2015 12:21PM UTC 0
91.88
Travis Job 2207.1
Source Files on build 2207
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2207
  • b63da713 on github
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