Patchwork API

Jeremy Kerr jk at ozlabs.org
Mon Sep 18 18:10:50 AEST 2017


Hi Stijn,

> I am trying to use git-pw, which uses the new API in patchwork 2.0, but
> as soon as add a project to the filter, the list of patches is empty.
> Any idea what might be wrong here?
> https://patchwork.ozlabs.org/api/patches/ vs
> https://patchwork.ozlabs.org/api/patches/?project=lede&submitter=&delegate=&state=&archived=1&before=&since=

I'm no expert on the API (I wasn't involved in writing it), but it looks
like you need to reference the project by id, not shortname:

  [jk at pudge ~]$ wget -qO - 'https://patchwork.ozlabs.org/api/patches/?project=lede' | json_pp
  []
  [jk at pudge ~]$ wget -qO - 'https://patchwork.ozlabs.org/api/patches/?project=54' | json_pp
  [
     {
        "url" : "https://patchwork.ozlabs.org/api/patches/618204/",
        "name" : "generic: Colorize the command line prompt",
        "hash" : "917cfbb306fe87f84ad1acccb0e9797d798d13e1",
        "commit_ref" : null,
        "archived" : false,
        "state" : "changes-requested",
        "checks" : "https://patchwork.ozlabs.org/api/patches/618204/checks/",
        "tags" : {},
        "project" : {
           "web_url" : "http://lede-project.org/",
           "scm_url" : "",
           "list_email" : "lede-dev at lists.infradead.org",
           "id" : 54,
           "webscm_url" : "http://git.lede-project.org/",
           "link_name" : "lede",
           "url" : "https://patchwork.ozlabs.org/api/projects/54/",
           "name" : "LEDE development",
           "list_id" : "lede-dev.lists.infradead.org"
        },
        "date" : "2016-05-04T01:33:50",
        "pull_url" : null,
        "mbox" : "https://patchwork.ozlabs.org/patch/618204/mbox/",
        "id" : 618204,
        "series" : [],
        "delegate" : null,
        "msgid" : "<1462325630-18332-1-git-send-email-ldpinney at gmail.com>",
        "check" : "pending",
        "submitter" : {
           "name" : "L. D. Pinney",
           "url" : "https://patchwork.ozlabs.org/api/people/65512/",
           "id" : 65512,
           "email" : "ldpinney at gmail.com"
        }
     },
     [...]

The /api/projects/ interface gives you the project IDs.

I've CCed the patchwork list in case I've completely missed something :)

Cheers,


Jeremy


More information about the Patchwork mailing list