Page MenuHomePhabricator

diffusion.commit.search requires repositories to be specified by PHID
Closed, WontfixPublic

Description

Although most other diffusion end points will accept any of id, PHID, callsign or shortname as a repository identifier now, the modern search API method diffusion.commit.search only works if PHIDs are specified as values to the "repositories" condition.

This was surprising to me, and not sufficiently clear from the documentation. It also means I'm going to need extra calls to diffusion.repository.search or phid.lookup, as PHIDs are not generally known externally by API users.

Reproduction Steps:

  1. Go to https://secure.phabricator.com/conduit/method/diffusion.commit.search/
  2. Enter {"repositories":["P","arcanist","rPHU","24"]} in the Constraints field, (and enter 5 into the Limit field just to be nice)
  3. Press Call Method, and see that no revisions are returned in the response.
phabricator 699ab153e3751e5389c69db4387d261e358de290 (Sat, Apr 8) (branched from 7707685733d26bf1c7278a2f338416a038c2709b on origin) 
arcanist 3512c4ab86d66a103a6733a0589177f93b6d6811 (Sat, Apr 8) (branched from a59cfca5f190c44403dfc7449c678a2aa1626bb4 on origin)
phutil f568eb7b9542259cd3c0dcb3405cc9a83c90a2f5 (Mon, Apr 3) (branched from c581e769f10c6d2b427900897edba74e01a572bd on origin)

Event Timeline

epriestley closed this task as Wontfix.EditedApr 8 2017, 3:07 PM
epriestley claimed this task.
epriestley added a subscriber: epriestley.

Use diffusion.repository.search or phid.lookup to map repository identifiers to PHIDs.

Although the API accepts human-readable names in some cases, they are provided primarily for convenience when debugging things or making ad-hoc calls via the web console. Programmatic API client should resolve PHIDs. Among other things, this makes them robust against callsign and short name changes, both of which are mutable.