Skip to content

Commit 4c58fc5

Browse files
loudonlunestephenfin
authored andcommitted
docs: Add feature info and increment API version
The following patch will add the generated schema files as they are very large. * Increment the API version from v1.3 to v1.4. * Update schema documentation to reflect the version change. * Add blurb documenting the "Depends-on" tag to the usage overview. Signed-off-by: Adam Hassick <[email protected]> Acked-by: Aaron Conole <[email protected]> [stephenfin: Tweak docs] Signed-off-by: Stephen Finucane <[email protected]>
1 parent 8fb05af commit 4c58fc5

File tree

7 files changed

+77
-27
lines changed

7 files changed

+77
-27
lines changed

docs/api/rest/index.rst

+22-20
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide provides an overview of how one can interact with the REST API. For
88
detailed information on type and response format of the various resources
99
exposed by the API, refer to the web browsable API. This can be found at:
1010

11-
https://patchwork.example.com/api/1.3/
11+
https://patchwork.example.com/api/1.4/
1212

1313
where `patchwork.example.com` refers to the URL of your Patchwork instance.
1414

@@ -57,16 +57,16 @@ Patchwork instance hosted at `patchwork.example.com`, run:
5757

5858
.. code-block:: shell
5959
60-
$ curl -s 'https://patchwork.example.com/api/1.3/' | python -m json.tool
60+
$ curl -s 'https://patchwork.example.com/api/1.4/' | python -m json.tool
6161
{
62-
"bundles": "https://patchwork.example.com/api/1.3/bundles/",
63-
"covers": "https://patchwork.example.com/api/1.3/covers/",
64-
"events": "https://patchwork.example.com/api/1.3/events/",
65-
"patches": "https://patchwork.example.com/api/1.3/patches/",
66-
"people": "https://patchwork.example.com/api/1.3/people/",
67-
"projects": "https://patchwork.example.com/api/1.3/projects/",
68-
"series": "https://patchwork.example.com/api/1.3/series/",
69-
"users": "https://patchwork.example.com/api/1.3/users/"
62+
"bundles": "https://patchwork.example.com/api/1.4/bundles/",
63+
"covers": "https://patchwork.example.com/api/1.4/covers/",
64+
"events": "https://patchwork.example.com/api/1.4/events/",
65+
"patches": "https://patchwork.example.com/api/1.4/patches/",
66+
"people": "https://patchwork.example.com/api/1.4/people/",
67+
"projects": "https://patchwork.example.com/api/1.4/projects/",
68+
"series": "https://patchwork.example.com/api/1.4/series/",
69+
"users": "https://patchwork.example.com/api/1.4/users/"
7070
}
7171
7272
@@ -82,14 +82,14 @@ well-supported. To repeat the above example using `requests`:, run
8282
>>> r = requests.get('https://patchwork.example.com/api/1.3/')
8383
>>> print(json.dumps(r.json(), indent=2))
8484
{
85-
"bundles": "https://patchwork.example.com/api/1.3/bundles/",
86-
"covers": "https://patchwork.example.com/api/1.3/covers/",
87-
"events": "https://patchwork.example.com/api/1.3/events/",
88-
"patches": "https://patchwork.example.com/api/1.3/patches/",
89-
"people": "https://patchwork.example.com/api/1.3/people/",
90-
"projects": "https://patchwork.example.com/api/1.3/projects/",
91-
"series": "https://patchwork.example.com/api/1.3/series/",
92-
"users": "https://patchwork.example.com/api/1.3/users/"
85+
"bundles": "https://patchwork.example.com/api/1.4/bundles/",
86+
"covers": "https://patchwork.example.com/api/1.4/covers/",
87+
"events": "https://patchwork.example.com/api/1.4/events/",
88+
"patches": "https://patchwork.example.com/api/1.4/patches/",
89+
"people": "https://patchwork.example.com/api/1.4/people/",
90+
"projects": "https://patchwork.example.com/api/1.4/projects/",
91+
"series": "https://patchwork.example.com/api/1.4/series/",
92+
"users": "https://patchwork.example.com/api/1.4/users/"
9393
}
9494
9595
Tools like `curl` and libraries like `requests` can be used to build anything
@@ -108,7 +108,7 @@ Versioning
108108
----------
109109

110110
By default, all requests will receive the latest version of the API: currently
111-
``1.3``:
111+
``1.4``:
112112

113113
.. code-block:: http
114114
@@ -119,7 +119,7 @@ changes breaking your application:
119119

120120
.. code-block:: http
121121
122-
GET /api/1.3 HTTP/1.1
122+
GET /api/1.4 HTTP/1.1
123123
124124
Older API versions will be deprecated and removed over time. For more
125125
information, refer to :ref:`rest-api-versions`.
@@ -275,6 +275,7 @@ Supported Versions
275275
1.1, 2.1, ✓
276276
1.2, 2.2, ✓
277277
1.3, 3.1, ✓
278+
1.4, unreleased, ✓
278279

279280
Further information about this and more can typically be found in
280281
:doc:`the release notes </releases/index>`.
@@ -292,6 +293,7 @@ Auto-generated schema documentation is provided below.
292293
/api/rest/schemas/v1.1
293294
/api/rest/schemas/v1.2
294295
/api/rest/schemas/v1.3
296+
/api/rest/schemas/v1.4
295297

296298
.. Links
297299

docs/api/rest/schemas/v1.3.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
API v1.3 (latest)
2-
=================
1+
API v1.3
2+
========
33

44
.. openapi:: ../../schemas/v1.3/patchwork.yaml
55
:examples:

docs/api/rest/schemas/v1.4.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
API v1.4 (latest)
2+
=================
3+
4+
.. openapi:: ../../schemas/v1.4/patchwork.yaml
5+
:examples:

docs/api/schemas/generate-schemas.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
yaml = None
1515

1616
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
17-
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), None]
18-
LATEST_VERSION = (1, 3)
17+
VERSIONS = [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), None]
18+
LATEST_VERSION = (1, 4)
1919

2020

2121
def generate_schemas():

docs/api/schemas/patchwork.j2

+23
Original file line numberDiff line numberDiff line change
@@ -2616,6 +2616,11 @@ components:
26162616
commit_url_format:
26172617
title: Web SCM URL format for a particular commit
26182618
type: string
2619+
{% endif %}
2620+
{% if version >= (1, 4) %}
2621+
show_dependencies:
2622+
title: Whether the parse dependencies feature is enabled.
2623+
type: boolean
26192624
{% endif %}
26202625
Series:
26212626
type: object
@@ -2699,6 +2704,24 @@ components:
26992704
$ref: '#/components/schemas/PatchEmbedded'
27002705
readOnly: true
27012706
uniqueItems: true
2707+
{% if version >= (1, 4) %}
2708+
dependencies:
2709+
title: Dependencies
2710+
type: array
2711+
items:
2712+
type: string
2713+
format: url
2714+
readOnly: true
2715+
uniqueItems: true
2716+
dependents:
2717+
title: Dependents
2718+
type: array
2719+
items:
2720+
type: string
2721+
format: url
2722+
readOnly: true
2723+
uniqueItems: true
2724+
{% endif %}
27022725
User:
27032726
type: object
27042727
title: User

docs/usage/overview.rst

+16
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,22 @@ project to project and Patchwork instance to Patchwork instance. The `kernel
144144
project documentation`__ provides an overview of the supported tags for the
145145
Linux kernel project.
146146

147+
Patchwork also includes support for an additional, Patchwork-specific tag for
148+
declaring dependencies between series. The tag may be included in the cover
149+
letter or any patch of a series and should reference the message ID of a patch
150+
or a cover letter or the web URL to a patch or a series:
151+
152+
``Depends-on:``
153+
For example::
154+
155+
Depends-on: <[email protected]>
156+
Depends-on: https://pw.example.com/project/myproject/list?series=1234
157+
158+
.. note::
159+
160+
Series dependencies are not shown by default. This can be changed by
161+
enabling the ``show_dependencies`` flag for each project.
162+
147163
__ https://www.kernel.org/doc/html/latest/process/submitting-patches.html
148164

149165
Checks

patchwork/urls.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,16 @@
347347

348348
urlpatterns += [
349349
re_path(
350-
r'^api/(?:(?P<version>(1.0|1.1|1.2|1.3))/)?', include(api_patterns)
350+
r'^api/(?:(?P<version>(1.0|1.1|1.2|1.3|1.4))/)?',
351+
include(api_patterns),
351352
),
352353
re_path(
353-
r'^api/(?:(?P<version>(1.1|1.2|1.3))/)?', include(api_1_1_patterns)
354+
r'^api/(?:(?P<version>(1.1|1.2|1.3|1.4))/)?',
355+
include(api_1_1_patterns),
356+
),
357+
re_path(
358+
r'^api/(?:(?P<version>(1.3|1.4))/)?', include(api_1_3_patterns)
354359
),
355-
re_path(r'^api/(?:(?P<version>(1.3))/)?', include(api_1_3_patterns)),
356360
# token change
357361
path(
358362
'user/generate-token/',

0 commit comments

Comments
 (0)