Linting fails due to two different hacking rules: H214 and H216. We fix
H214 by using assertNotIn and assertIn over assertFalse(foo in bar) and
assertTrue(foo in bar). We ignore H216 as it says don't use the mock
library but storyboard actually does use mock and updating to use
unittest.mock appears to be a fair bit of work.
In the sqlaclhemy models we move some classes around to address this
error:
sqlalchemy.exc.InvalidRequestError: When initializing mapper mapped
class Story->stories, expression 'TimeLineEvent' failed to locate a
name ('TimeLineEvent'). If this is a class name, consider adding this
relationship() to the <class 'storyboard.db.models.Story'> class after
both dependent classes have been defined.
In the project loader we switch to using yaml.safe_load() to avoid the
missing Loader argument to yaml.load().
We pin jinja2 to < 3.0.0 as the old sphinx we've pinned to uses
contextfunction which appears to have been replaced in jinja2 3.0.0.
We should probably attempt to update the doc toolchain for storyboard
when we have time.
We pin MarkupSafe for similar reasons to the jinja2 pin. Version 2.1.0
of MarkupSafe removed the soft_unicode name which is used by sphinx.
Finally we run the python 3.6 and 3.7 jobs on ubuntu-bionic.
Change-Id: Ifcb6660ce2c89c21ba867aa88d942461bcff125d
Currently there is no easy way to find the set of Project Groups that a
specific Project belongs to. This commit adds a parameter to the Project
Groups browse endpoint to enable filtering by Project ID to add this
functionality.
Change-Id: I7b09665bb554c19e8cc4074ce0d1813f3adc4218
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
The pinned versions of webob and hacking weren't functioning properly
with modern Python, so they are unpinned.
Unpinning hacking brought a number of extra rules into use, so this
commit also contains a number of code style fixes.
There was also an incompatibility in the test_setup.sh script, which
meant it doesn't work with MySQL 8.0 (which is in Ubuntu 20.04). This
is also fixed in this commit.
Change-Id: I0889bc35f8babfeec42f6f577d302bb5fbce1c95
Add a boolean representing whether or not attachments are enabled (and
therefore the API endpoints are available) to the /v1/systeminfo
endpoint. This allows clients to check whether attachments can be used
without having to have separate backend-specific configuration
themselves.
Change-Id: I949200d35e8591d1d670fd987ae7be7911aab983
This commit adds a method to the attachments endpoint to handle POST
requests for creating a record of an attachment on a particular story.
Change-Id: Id0c653d15b18644a05daa1aaf881982eb594f18e
Story: 2000679
Task: 29122
This commit adds support for getting details about a specific
attachment, and for getting a list of attachments related to a
specific story, to the attachments endpoint.
Change-Id: Ic4c945167fad77c304f46efc677eaec04426d49b
Story: 2000679
Task: 29116
This commit adds a model and migration for storing links to and metadata
about attachments in the StoryBoard database.
Change-Id: Ib2e291f5cc80222b226627d076ba3e1f5b88a454
Story: 2000679
Task: 3146
This endpoint currently supports returning an upload URL
for the configured storage backend.
Change-Id: I637cf5897f281a4e6b66be6495938aa999a8d3ac
Story: 2000679
Task: 29115
This implements the storage backend interface added in the previous
commit using Swift. It also adds some example configuration to the
sample config file, and some setup to initialise a storage backend
if one is configured.
Change-Id: I8467486ed42f8674e2b1db635789e88bf4113850
Currently the /v1/systeminfo endpoint is largely useless and just
returns the version of the API as specified in setup.cfg. This commit
adds functionality to also return information about which features are
enabled in a specific backend's configuration.
Change-Id: I9934f656643bb764edc986231b198d92ddc66934
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
Some OpenID providers make a POST request to the `return_to` URL if the
query string would be too long. This commit adds support for POST
requests to this endpoint.
The change in notification_hook.py is to stop attempting to parse the
empty string as JSON when receiving this POST request.
Change-Id: I34d7032d795a5d36799bffc51864e63e585c6eb1
Boards were also iterating over lists of User IDs to populate the team
permissions. This commit fixes them to use the correct variables too.
Change-Id: I2c9bc645a5e02a307f3ff3549adf00a72b5d2f26
The team_get() method needs to iterate over our list of team owners
and team users, so pass in elements from the correct list names.
Change-Id: I7b18378577e818989fc89118d6b1d947cc7a5682
In order to be able to upload to PyPI we need to avoid the name
clash with another existing "storyboard" project which is still
active there, in use and is understandably disinclined consider
renaming (they were there first). We can eventually consider
renaming our project fully to storyboard-api along with its Git
repository and all, but for now simply publishing under an
alternative distribution name will suffice.
While we're in there, add some additional Python package metadata,
correct some more, and remove an invalid trove classifier which
would have prevented uploading. Also mark the resulting wheel as
"universal" (supporting both Python 2 and 3). Bump the minimum PBR
version to accommodate the project_urls and description-content-type
options.
Change-Id: I365ad340ec875f8603e088fa114e7de8aff191c9
Having to update the whole Story in order to add/remove a single
permission entry is quite limiting. This commit addresses this
flaw by adding subcontrollers to retrieve and modify the lists of
Users and Teams who have access to a Story, without having to
modify the whole Story.
This allows much simpler use for clients in situations where
only the ACL needs modification.
Change-Id: I2ecee2c38456c5a23ae1dc7bdecb94efb2daac04
This is more specific than "private" and can therefore be sensibly used
for automating ACLs based on projects/teams affected by the story.
Change-Id: Ib8ff53d11ba3977b15d735cef420ac44fd9aa288
Story: 2000568
Task: 29891
This adds a subcontroller under teams, to expose the mapping of Teams to
Projects. It also provides methods to add and remove Projects from a
Team.
Change-Id: I064082001a2a2d3080c35a1e937d420fd473d96c
This will be used to determine whether or not a Team is responsible
for (and therefore should be automatically subscribed to) security
issues.
Change-Id: I0869e9acc366f3a5546b4e39d736a229762999c2
Updating the updated_at time of a story when creating a new task seems to be prone to deadlocks, which results in the task not getting created. This patch retries the update thrice.
Change-Id: I1e657d9eb64717f1dfbaf53d843675ee686c774d
Task: 4141
Signed-off-by: Riju19 <19.riju@gmail.com>
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.
This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.
This update should result in no functional change.
For more information see the thread at
http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html
Change-Id: Icbbdd5b70854fe740de1b0ebc9de203a2b501500