4
163
Fork
You've already forked Gitte
16

Patchwork integration #145

Closed
opened 2026年06月17日 16:22:09 +02:00 by rossburton · 4 comments

When doing patch review on a project that uses patchwork, it's useful to be able to see the patchwork page easily for test results or discussion.

The configuration would just consist of the repository needing the right patchwork API URL (e.g. https://patchwork.yoctoproject.org/api).

Then for a specific commit, gitte would need to generate a patchwork hash of the commit using logic from https://github.com/getpatchwork/patchwork/blob/main/patchwork/hasher.py (which is basically the same logic as git but it doesn't look at the commit message). It can then send a request to the API:

GET https://patchwork.yoctoproject.org/api/patches/?hash=5c5c9ac2ca2f16896e7adcef1bc7d12dba0a73fe HTTP/1.1

And that will return a list of patches that match the hash:

 {
 "id": 90373,
 "url": "https://patchwork.yoctoproject.org/api/patches/90373/",
 "web_url": "https://patchwork.yoctoproject.org/project/oe-core/patch/20260617093224.56557-1-ross.burton@arm.com/",
 "project": {
 "id": 6,
 "url": "https://patchwork.yoctoproject.org/api/projects/6/",
 "name": "OpenEmbedded Core Layer",
 "link_name": "oe-core",
 "list_id": "openembedded-core.lists.openembedded.org",
 "list_email": "openembedded-core@lists.openembedded.org",
 "web_url": "http://www.openembedded.org/wiki/Main_Page",
 "scm_url": "git://git.openembedded.org/openembedded-core/",
 "webscm_url": "https://git.openembedded.org/openembedded-core/",
 "list_archive_url": "",
 "list_archive_url_format": "",
 "commit_url_format": ""
 },
 "msgid": "<20260617093224.56557-1-ross.burton@arm.com>",
 "list_archive_url": null,
 "date": "2026年06月17日T09:32:23",
 "name": "libaio: update SRC_URI",
 "commit_ref": null,
 "pull_url": null,
 "state": "under-review",
 "archived": false,
 "hash": "5c5c9ac2ca2f16896e7adcef1bc7d12dba0a73fe",
 "submitter": {
 "id": 1,
 "url": "https://patchwork.yoctoproject.org/api/people/1/",
 "name": "Ross Burton",
 "email": "ross.burton@arm.com"
 },
 ...

Now you can just open the web_url attribute of the first result in the default browser.

When doing patch review on a project that uses patchwork, it's useful to be able to see the patchwork page easily for test results or discussion. The configuration would just consist of the repository needing the right patchwork API URL (e.g. `https://patchwork.yoctoproject.org/api`). Then for a specific commit, gitte would need to generate a patchwork hash of the commit using logic from https://github.com/getpatchwork/patchwork/blob/main/patchwork/hasher.py (which is basically the same logic as git but it doesn't look at the commit message). It can then send a request to the API: ``` GET https://patchwork.yoctoproject.org/api/patches/?hash=5c5c9ac2ca2f16896e7adcef1bc7d12dba0a73fe HTTP/1.1 ``` And that will return a list of patches that match the hash: ``` { "id": 90373, "url": "https://patchwork.yoctoproject.org/api/patches/90373/", "web_url": "https://patchwork.yoctoproject.org/project/oe-core/patch/20260617093224.56557-1-ross.burton@arm.com/", "project": { "id": 6, "url": "https://patchwork.yoctoproject.org/api/projects/6/", "name": "OpenEmbedded Core Layer", "link_name": "oe-core", "list_id": "openembedded-core.lists.openembedded.org", "list_email": "openembedded-core@lists.openembedded.org", "web_url": "http://www.openembedded.org/wiki/Main_Page", "scm_url": "git://git.openembedded.org/openembedded-core/", "webscm_url": "https://git.openembedded.org/openembedded-core/", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260617093224.56557-1-ross.burton@arm.com>", "list_archive_url": null, "date": "2026年06月17日T09:32:23", "name": "libaio: update SRC_URI", "commit_ref": null, "pull_url": null, "state": "under-review", "archived": false, "hash": "5c5c9ac2ca2f16896e7adcef1bc7d12dba0a73fe", "submitter": { "id": 1, "url": "https://patchwork.yoctoproject.org/api/people/1/", "name": "Ross Burton", "email": "ross.burton@arm.com" }, ... ``` Now you can just open the `web_url` attribute of the first result in the default browser.

Setting per_page=1 should mean you only get one result or no results, which might save some processing if the same patch appears in lots of places.

Setting `per_page=1` should mean you only get one result or no results, which might save some processing if the same patch appears in lots of places.
Full API docs are at https://patchwork.readthedocs.io/en/latest/api/rest/schemas/v1.4/.

I'm not sure what you are expecting for such an integration. Since I don't use Patchwork anywhere (until your issue I didn't even know that it exists) I don't know how the workflow looks and I don't know what integration would make sense.

Can you elaborate?

I'm not sure what you are expecting for such an integration. Since I don't use Patchwork anywhere (until your issue I didn't even know that it exists) I don't know how the workflow looks and I don't know what integration would make sense. Can you elaborate?

Closing due to lack of response

Closing due to lack of response
Sign in to join this conversation.
No Branch/Tag specified
main
next
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.10
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ckruse/Gitte#145
Reference in a new issue
ckruse/Gitte
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?