Re: Patchwork API

2017-09-20 Thread Stephen Finucane
On Wed, 2017-09-20 at 14:04 +0300, Stijn Tintel wrote:
> On 20-09-17 13:27, Stephen Finucane wrote:
> > On Mon, 2017-09-18 at 16:10 +0800, Jeremy Kerr wrote:
> > > 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=&deleg
> > > > ate=
> > > > &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:
> > 
> > Not quite. We support filtering by both ID and project name, however, there
> > was
> > a bug in 2.0 [1] that broke the latter. The patch [2] has been backported
> > to
> > 'stable/2.0' [3] and should probably be cherry-picked into whatever branch
> > ozlabs.org is using.
> 
> Thanks for the replies guys, I switched to ID for now and this works
> fine. Already merged my first series with git-pw.

Good to hear. Do let me know if you have any questions/comments on the tool:
I've been using it for months now without issue but everyone works differently
:)

> @Jeremy: can you let me know when the patch is in, so I can retest with
> project name?

Stephen
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


Re: Patchwork API

2017-09-20 Thread Stephen Finucane
On Mon, 2017-09-18 at 16:10 +0800, Jeremy Kerr wrote:
> 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:

Not quite. We support filtering by both ID and project name, however, there was
a bug in 2.0 [1] that broke the latter. The patch [2] has been backported to
'stable/2.0' [3] and should probably be cherry-picked into whatever branch
ozlabs.org is using.

JK - could you drag this patch in?

Cheers,
Stephen

[1] https://github.com/getpatchwork/patchwork/issues/117
[2] https://github.com/getpatchwork/patchwork/commit/174de19d41d76f8387027e789e
5975fc078f2d08 (the version on Patchwork was modified before merging)
[3] https://github.com/getpatchwork/patchwork/commit/b23f206b941694a03bf3d0a94f
cbdb4f3d146f85
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork


Re: Patchwork API

2017-09-18 Thread Jeremy Kerr
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@pudge ~]$ wget -qO - 
'https://patchwork.ozlabs.org/api/patches/?project=lede' | json_pp
  []
  [jk@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-...@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-ldpin...@gmail.com>",
"check" : "pending",
"submitter" : {
   "name" : "L. D. Pinney",
   "url" : "https://patchwork.ozlabs.org/api/people/65512/";,
   "id" : 65512,
   "email" : "ldpin...@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
___
Patchwork mailing list
Patchwork@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/patchwork