5 Commits

Author SHA1 Message Date
Adam Coldrick
63a003af7f Optimise the Story browsing query
The `story_get_all` function currently constructs a query which perfoms
very poorly, making search in StoryBoard painful to the point of being
almost unusable with only ~30000 stories in the database. There are a
number of reasons for the poor performance, but the most impactful is
the fact that we join two subqueries, one of which contains the entire
stories table, and the other which contains a filtered list of story
IDs to implement most of the filtering.

This commit removes all of the subquerying, and just does simple
filtering in a single WHERE clause. Basic comparison of the two queries
shows around an 85% - 90% speedup in the execution time using the new
approach, from ~100ms for the current query, and ~10-15ms for the new
query (using a test dataset containing 10000 stories).

This approach adds a bit of code complexity around filtering stories by
story status, but this is a cost worth paying for the performance
improvement. The new approach will also allow extra flexibility in the
meaning of the story statuses, making it easier to have per-project
statuses for example.

Story: 2005845
Task: 33627
Change-Id: I7c19372506017726e4fc61ffb09d3cfb9c6b36d3
2020-09-11 12:27:55 +01:00
Adam Coldrick
04d086132d Use the official Swift docker image for testing
This switches out the docker image used for Swift in our docker-compose
setup. It also adds a small script to modify the default config in that
image to allow it to be used with a StoryBoard development instance.

Change-Id: I6371eef0b54df16a8855f8cbcfcead4dd4234d10
2019-11-16 20:59:38 +00:00
Jeremy Stanley
3e4e956ff8 Regular expression support for CORS and OAuth ACLs
Make it possible for allowed_origins and valid_oauth_clients to
include regular expressions, for cases where part or all of the
domain/URL cannot be predicted or easily enumerated.

Change-Id: I9cfc729547560438e0fa1e47cc90cd5579168c73
2019-10-25 22:22:51 +00:00
James E. Blair
e2f5c24c2c Use version 2 in docker-compose.yml
Version 3 is not actually required, so let's specify a lower version
to make it easier for folks running older distros.

Change-Id: I62df1f2add273f82a3818206b07a1ed125664654
2019-04-29 18:09:58 -06:00
Adam Coldrick
56b0233ffe Add docker-compose based dev setup instructions
This adds a docker-compose.yml file which runs the various services
required for a working development instance of StoryBoard (and also
Swift, which technically isn't needed yet). It also provides a config
file which is pre-configured to work out of the box with the services
in the docker-compose.yml file.

It also updates the development installation instructions to recommend
using docker-compose to run the services, rather than installing them
on a machine and configuring everything manually.

Change-Id: I405e2e46f6ab7d8ef2c1ddd43b3e2e8cb8e3a808
2019-03-25 13:06:06 +00:00