From d08b6c72964898c9997a62e4ab6a721f166a56ca Mon Sep 17 00:00:00 2001
From: Daniel Axtens <dja@axtens.net>
Date: Tue, 14 Apr 2020 15:34:40 +1000
Subject: api: allow filtering patches and covers by msgid

In the process of fixing the previous bug, I realised that:

 a) /api/patches/msgid is a perfectly reasonable thing to attempt
 b) We have no way of finding a patch by message id in the API

We can't actualy make /api/patches/msgid work because it may not
be unique, but we can add a filter.

I'm shoehorning this into stable/2.2, even though it's technically
an API change: it's minor, not incompatible and in hindsight a
glaring hole.

Cc: Michael Ellerman <mpe@ellerman.id.au>
Tested-by: Jeremy Kerr <jk@ozlabs.org>
Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
---
 docs/api/schemas/latest/patchwork.yaml | 16 ++++++++++++++++
 docs/api/schemas/patchwork.j2          | 18 ++++++++++++++++++
 docs/api/schemas/v1.2/patchwork.yaml   | 16 ++++++++++++++++
 3 files changed, 50 insertions(+)

(limited to 'docs')

diff --git a/docs/api/schemas/latest/patchwork.yaml b/docs/api/schemas/latest/patchwork.yaml
index 13cdc9c..cc0d97e 100644
--- a/docs/api/schemas/latest/patchwork.yaml
+++ b/docs/api/schemas/latest/patchwork.yaml
@@ -246,6 +246,14 @@ paths:
           schema:
             title: ''
             type: string
+        - in: query
+          name: msgid
+          description: >
+            The cover message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
       responses:
         '200':
           description: ''
@@ -474,6 +482,14 @@ paths:
           schema:
             title: ''
             type: string
+        - in: query
+          name: msgid
+          description: >
+            The patch message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
       responses:
         '200':
           description: ''
diff --git a/docs/api/schemas/patchwork.j2 b/docs/api/schemas/patchwork.j2
index bd714d5..f5618d4 100644
--- a/docs/api/schemas/patchwork.j2
+++ b/docs/api/schemas/patchwork.j2
@@ -251,6 +251,16 @@ paths:
           schema:
             title: ''
             type: string
+{% if version >= (1, 2) %}
+        - in: query
+          name: msgid
+          description: >
+            The cover message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
+{% endif %}
       responses:
         '200':
           description: ''
@@ -488,6 +498,14 @@ paths:
           schema:
             title: ''
             type: string
+        - in: query
+          name: msgid
+          description: >
+            The patch message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
 {% endif %}
       responses:
         '200':
diff --git a/docs/api/schemas/v1.2/patchwork.yaml b/docs/api/schemas/v1.2/patchwork.yaml
index db2ed12..7bdbe66 100644
--- a/docs/api/schemas/v1.2/patchwork.yaml
+++ b/docs/api/schemas/v1.2/patchwork.yaml
@@ -246,6 +246,14 @@ paths:
           schema:
             title: ''
             type: string
+        - in: query
+          name: msgid
+          description: >
+            The cover message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
       responses:
         '200':
           description: ''
@@ -474,6 +482,14 @@ paths:
           schema:
             title: ''
             type: string
+        - in: query
+          name: msgid
+          description: >
+            The patch message-id as a case-sensitive string, without leading or
+            trailing angle brackets, to filter by.
+          schema:
+            title: ''
+            type: string
       responses:
         '200':
           description: ''
-- 
cgit v1.2.3