Building a user-friendly CLI becomes difficult when project-ids are
required. It also makes it almost impossible to work with the current
format of the .pwclientrc file.
Signed-off-by: Andy Doan
---
patchwork/tests/test_rest_api.py | 5 +
patchwork/views/rest_api.py | 16 ++
This adds generic filtering support to the PatchworkViewSet as well as
useful filtering options for listing patches.
DRF has some filter capabilities, but they can really slow down the web
interface for large data sets and are a little complex. This approach is
pretty simple and works efficiently.
Provide a URL to the raw patch. This removes previous functionality
added to create_model_serializer thats no longer needed.
Signed-off-by: Andy Doan
---
patchwork/models.py | 4
patchwork/rest_serializers.py| 7 ++-
patchwork/tests/test_rest_api.py | 1 +
3 files chang
The int value isn't very useful and the goal is to move this to an enum
over time.
Signed-off-by: Andy Doan
---
patchwork/rest_serializers.py| 21 -
patchwork/tests/test_rest_api.py | 8 +---
2 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/patchwork/r
This exports patch checks via the REST API.
The drf-nested-routers package is used to handle the fact Checks are
nested under a Patch.
Security Constraints:
* Anyone (logged in or not) can read all objects.
* No one can update/delete objects.
* Project maintainers and patch owners may create o
This exports patches via the REST API.
Security Constraints:
* Anyone (logged in or not) can read all objects.
* No one can create/delete objects.
* Project maintainers are allowed to update (ie "patch"
attributes)
NOTE: Patch.save was overridden incorrectly and had to be
fixed to work with
This exports projects via the REST API.
Security Constraints:
* Anyone (logged in or not) can read all objects.
* No one can create/delete objects.
* Project maintainers are allowed to update (ie "patch"
attributes)
Signed-off-by: Andy Doan
Inspired-by: Damien Lespiau
---
patchwork/rest_
This exports person objects via the REST API.
Security Constraints:
* The API is read-only to authenticated users
Signed-off-by: Andy Doan
---
patchwork/rest_serializers.py| 7 ++-
patchwork/tests/test_rest_api.py | 41
patchwork/views/rest_api
This adds the ability to expose a REST API based on the Django REST
framework project. Since this project isn't packaged in most current
distributions, we ensure that its both installed and enabled before
trying to use it.
Signed-off-by: Andy Doan
Inspired-by: Damien Lespiau
---
patchwork/setti
From: Stephen Finucane
Add specification for a REST API. It documents a number of endpoints
for the following objects/models:
* Projects
* People
* Patches
* Checks
The specification is provided in OpenAPI format [1]. This specification
can be used to automatically generate REST client librarie
This patchset is inspired by the work done by Damien Lespiau. It creates
a REST API based on the original spec RFC'd by Stephen Finucane. The
only thing I know of that's missing from the patch set are bundles. I
think over time the Series support will make them less important, but we
could always t
On 05/09/2016 08:45 AM, Finucane, Stephen wrote:
-def create_model_serializer(model_class):
>+def create_model_serializer(model_class, read_only=None):
> class PatchworkSerializer(ModelSerializer):
> class Meta:
> model = model_class
>+read_only_fields = rea
On 05/09/2016 08:27 AM, Finucane, Stephen wrote:
On 15 Apr 13:24, Andy Doan wrote:
>DRF lends its self to a lot of repetitive code like:
>
> Serializer:
>Meta:
> model = Foo
>
> ViewSet:
> queryset = Foo.objects
>
>
>This reduces the amount of boiler plate code needed for most of
On 05/09/2016 09:10 AM, Finucane, Stephen wrote:
I'd like to drop the whole customisable states feature in favour of an
enum [1]. Unless you've a good reason to include this, can we avoid
putting it into the API?
I included this because Patch.state is returned as a numeric ID. We need
the stri
On 05/09/2016 09:09 AM, Finucane, Stephen wrote:
diff --git a/patchwork/views/rest_api.py b/patchwork/views/rest_api.py
>index ae86627..e2ec616 100644
>--- a/patchwork/views/rest_api.py
>+++ b/patchwork/views/rest_api.py
>@@ -127,6 +127,22 @@ class ProjectViewSet(PatchworkViewSet):
> permiss
On 05/09/2016 08:25 AM, Finucane, Stephen wrote:
+++ b/patchwork/tests/test_rest_api.py
+def test_list_simple(self):
+"""Validate we can list the default test project."""
+defaults.project.save()
+resp = self.client.get('/api/1.0/projects/')
Q: Do we want to hard
On 05/09/2016 09:16 AM, Finucane, Stephen wrote:
On 15 Apr 13:23, Andy Doan wrote:
This patchset is inspired by the work done by Damien Lespiau. It creates
a REST API based on the original spec RFC'd by Stephen Finucane. The
only thing I know of that's missing from the patch set are bundles. I
t
On 05/09/2016 09:06 AM, Finucane, Stephen wrote:
On 15 Apr 13:24, Andy Doan wrote:
+def test_query_filters(self):
+"""Test out our filtering support."""
+patches = create_patches(4)
+project = Project.objects.create(
+linkname='foo', name='Foo', listid='
On 05/09/2016 09:03 AM, Finucane, Stephen wrote:
I don't know what the spec says, but I don't think this endpoint
is necessary. We already have a way to get diffs and mboxes, so we
can just provide links to that in our original 'patch' response.
GitHub do something similar with their 'raw_url' pa
On 05/09/2016 08:58 AM, Finucane, Stephen wrote:
On 15 Apr 13:24, Andy Doan wrote:
+
+def test_create(self):
+"""Ensure creations can be performed by user of patch."""
+check = {
+'state': Check.STATE_SUCCESS,
I think we should expose the string value here, ra
On 05/09/2016 08:39 AM, Finucane, Stephen wrote:
+class PeopleViewSet(PatchworkViewSet):
>+permission_classes = (AuthenticatedReadOnly,)
>+serializer_class = create_model_serializer(Person)
>+
>+
As pointed out in the previous patch, this exposes every attribute of
the object including s
On 05/09/2016 08:15 AM, Finucane, Stephen wrote:
On 15 Apr 13:23, Andy Doan wrote:
This adds the ability to expose a REST API based on the Django REST
framework project. Since this project isn't packaged in most current
distributions, we ensure that its both installed and enabled before
trying t
22 matches
Mail list logo