#114 API work
Closed: Fixed Opened by pingou.

We want to make an API available (behind token based authentication) for a number of actions:

  • Create issue
  • Add comment to issue
  • Change status of an issue
  • Create pull-request
  • Add comment to pull-request
  • Add flag to pull-request
  • Change status of pull-request

Ok so for now we have the API for:

  • View a specific issue
  • Comment on an issue
  • Change status of an issue
  • Comment on a pull-request
  • Close a pull-request
  • Merge a pull-request
  • View a specific pull-request

Listing issues and their comments will be useful to me (for bugwarrior).

With github, I rely on the 'organizations' or 'users' to list lots of issues. I.e., show me all pull requests on all "fedora-infra" repos.. but pagure doesn't have that kind of ownership under an organization afaik. Can you advise on a way to approach that with pagure?

Perhaps, use an authenticated listing. I.e., let me list pull requests on all repos to which I have the commit ACL.

Couple of options for this use case:

1) Multiple queries:

I have been adding the /api/0/user/ endpoint in https://pagure.io/pagure/69ed2ce7189765e4a94df3f9d3cc7e72e846628c that returns the list of project the user has commit on

 TODO: fix this list for groups

So you could query for this list and then query each project for the open pull-requests and tickets

2) we could make a dedicated API endpoint along the lines of /api/0/user/<username>/tickets and /api/0/user/<username>/requests

What do you think?

I like option #1 the most :)

Ok so we're partly there with option #1 then, the API listing the projects of an user is there, I just fixed the search_projects to include projects that the user has commit on via groups.

What's needed now is the API to lists the tickets and PRs of a project, something to do this week-end :)

Ok API output reworked a bit in https://pagure.io/pagure/pull-request/193

So let's close this for now :)

Metadata