Page MenuHomePhorge

patch workflow can't download revisions/diffs from Differential if anonymous access is forbidden
Closed, ResolvedPublic

Description

Arcanist's patch workflow communicates with Phorge via Conduit when either the --revision or --diff options are used, and initially sends an unauthenticated request to download the revision/diff, only sending an authenticated request if Conduit responds with ERR-INVALID-SESSION. On Phorge installations that forbid anonymous access to Differential, Conduit responds to this initial request with ERR-INVALID-AUTH. Because an ERR-INVALID-SESSION response is not treated as a signal to authenticate, Arcanist's patch workflow cannot download the revision/diff.

Reproduction steps:

  1. Forbid anonymous access to Differential (e.g. by setting the Phorge installation to private - this is the circumstance in which this bug was discovered).
  2. Ensure a Conduit token for the Phorge installation is present in ~/.arcrc.
  3. Attempt to download a revision from the Phorge installation with arc patch --revision, or a diff with arc patch --diff.

Actual behaviour: Arcanist exits unsuccessfully, reporting the ERR-INVALID-AUTH error returned by Conduit.

Expected behaviour: Arcanist resends the original request to Conduit with credentials, and correctly downloads and applies the revision/diff locally.