Skip to content

[Issue #506] Allow linking between series #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/.DS_Store
Binary file not shown.
7 changes: 6 additions & 1 deletion docs/api/rest/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ If all you want is reference guides, skip straight to :ref:`rest-api-schemas`.
The API version was bumped to v1.3 in Patchwork v3.1. The older APIs are
still supported. For more information, refer to :ref:`rest-api-versions`.

.. versionchanged:: 3.2

The API version was bumped to v1.4 in Patchwork v3.2. The older APIs are
still supported. For more information, refer to :ref:`rest-api-versions`.

Getting Started
---------------

Expand Down Expand Up @@ -79,7 +84,7 @@ well-supported. To repeat the above example using `requests`:, run
$ python
>>> import json
>>> import requests
>>> r = requests.get('https://patchwork.example.com/api/1.3/')
>>> r = requests.get('https://patchwork.example.com/api/1.4/')
>>> print(json.dumps(r.json(), indent=2))
{
"bundles": "https://patchwork.example.com/api/1.4/bundles/",
Expand Down
169 changes: 166 additions & 3 deletions docs/api/schemas/latest/patchwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ paths:
title: ID
type: integer
get:
summary: Show a series.
summary: Return the details of a series.
description: |
Retrieve a series by its ID.
A series is a collection of patches with an optional cover letter.
Expand All @@ -1223,6 +1223,128 @@ paths:
$ref: '#/components/schemas/Error'
tags:
- series
patch:
summary: Partially update a series.
description: |
Only updates the 'supersedes' field of a series. Replaces the whole set
of superseded series.

::

Instance:
instance.supersedes = [
'http://example.com/api/series/1/',
'http://example.com/api/series/2/',
'http://example.com/api/series/5/'
]

Request:
PATCH {
"supersedes": [
'http://example.com/api/series/1/',
'http://example.com/api/series/8/'
]
}

Result:
instance.supersedes = [
'http://example.com/api/series/1/',
'http://example.com/api/series/8/'
]
security:
- basicAuth: []
- apiKeyAuth: []
requestBody:
$ref: '#/components/requestBodies/SeriesUpdate'
operationId: series_partial_update
responses:
'200':
description: 'Updated series'
content:
application/json:
schema:
$ref: '#/components/schemas/Series'
'400':
description: 'Bad request'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Forbidden'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Not found'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- series
put:
summary: Update a series.
description: |
Only updates the 'supersedes' field of a series. Replaces the whole set
of superseded series.

::

Instance:
instance.supersedes = [
'http://example.com/api/series/1/',
'http://example.com/api/series/2/',
'http://example.com/api/series/5/'
]

Request:
PUT {
"supersedes": [
'http://example.com/api/series/1/',
'http://example.com/api/series/8/'
]
}

Result:
instance.supersedes = [
'http://example.com/api/series/1/',
'http://example.com/api/series/8/'
]
security:
- basicAuth: []
- apiKeyAuth: []
requestBody:
$ref: '#/components/requestBodies/SeriesUpdate'
operationId: series_update
responses:
'200':
description: 'Updated series'
content:
application/json:
schema:
$ref: '#/components/schemas/Series'
'400':
description: 'Bad request'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: 'Forbidden'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: 'Not found'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
tags:
- series
/api/users:
get:
summary: List users.
Expand Down Expand Up @@ -1506,6 +1628,14 @@ components:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Project'
SeriesUpdate:
required: true
description: |
A series.
content:
application/json:
schema:
$ref: '#/components/schemas/SeriesUpdate'
User:
required: true
description: |
Expand Down Expand Up @@ -2528,6 +2658,24 @@ components:
show_dependencies:
title: Whether the parse dependencies feature is enabled.
type: boolean
show_series_versions:
title: Whether series versioning is enabled.
type: boolean
SeriesUpdate:
type: object
title: SeriesUpdate
description: |
Updatable fields af a series.
properties:
supersedes:
type: array
items:
oneOf:
- type: string
format: uri
- type: string
format: uri-reference
description: Series deprecated by the current series
Series:
type: object
title: Series
Expand Down Expand Up @@ -2613,15 +2761,30 @@ components:
type: array
items:
type: string
format: url
format: uri
readOnly: true
uniqueItems: true
dependents:
title: Dependents
type: array
items:
type: string
format: url
format: uri
readOnly: true
uniqueItems: true
supersedes:
title: Series deprecated by this series
type: array
items:
type: string
format: uri
uniqueItems: true
superseded:
title: Series that superseded this series
type: array
items:
type: string
format: uri
readOnly: true
uniqueItems: true
User:
Expand Down
Loading