Topic on User talk:Rammanojpotla

re: API to find commits

7
MModell (WMF) (talkcontribs)

You asked me a question via IRC but now you aren't online, so I'm responding here:


Maybe this is what you need? https://phabricator.wikimedia.org/conduit/method/diffusion.commit.search/

It would also be valid to only query gerrit since phabricator is mostly just a mirror of gerrit repositories, there are very few repositories on phabricator which aren't also on gerrit.

Rammanojpotla (talkcontribs)

Thanks for the reply MModell. I have seen it just now. I regret for being offline, I won't repeat it again. I will try out the API and get back to you.

Rammanojpotla (talkcontribs)

Thanks again for the quick response, I just checked the API. It is not exactly what I need. I only need the count of the all the tasks a user subscribed to. I am basically querying for "user activity" rather than "user contributions". Of course most of the repo's present in phabricator are mirror of the gerrit ones. But there can be a case where a user subscribes for a task(on phabricator) that is owned and assigned to some other users. I want to get count of all those tasks (including the ones which he owned, solved) in form of "user activity". If I only query gerrit, there is a chance that I could not get all the above information. So can you please let met know if there is any API available to get the count of user contributions like here ?


Thanks!

MModell (WMF) (talkcontribs)

I think the maniphest.search api can do most of what you need for task related activity.

To find all the tasks that a given user has subscribed to, including their own assigned and resolved tasks, just use the subscribers constraint, like this:

{
  "constraints": {
    "subscribers": [ "mmodell" ]
  }
}


Rammanojpotla (talkcontribs)

Okay Thanks, So is it possible to get the union of "authors" and "assigner" using that API ? I tried this out

{

"constraints": {

"authorPHIDs": [ "PHID-USER-utkozuokiv4qi3otfgny"],

"assigned": ["PHID-USER-utkozuokiv4qi3otfgny"]

}

}


For the above result, I am getting an output that is intersection of the results that I got with only "authorPHIDs" and only "assigned". Is there way to perform the union of above two results ?

Thanks!

Rammanojpotla (talkcontribs)

The response to maniphest.search is paginated. Is there any way possible to get the of subsequent pages without getting the previous ones. i.e suppose I am making a request to page 1, I receive a "cursor" parameter, which has a "after" and "before" values to represent the next and previous pages. So, to get the details of page 10 I need to request till 9 pages and find the "after" value for the 10th page. Is there any other alternate way to get the 10th page directly? by putting something like (?page=10 i.e as most apis follow it).

MModell (WMF) (talkcontribs)

Unfortunately I think the answer is no and no.

  1. I don't think you can get the union of those two sets directly. You'd need to get the two sets and do the union on the client.
  2. I don't think there is a way to jump to page 10 without fetching the previous pages.
Reply to "re: API to find commits"