Failed arc patch does not return non-zero exit code


We use arc patch in a CI job as part of a merge queue of sorts. If the patch fails against master (for example, due to merge conflicts) then we want the build to fail.

This used to work until a few weeks ago, when we upgraded Arcanist. It looks like it’s due to the arc patch command returning an exit code 0 even on error. /scripts/arcanist.php returns an exit code 1, but this seems to be swallowed up by ArcanistRuntime or somewhere else up the stack.

My hunch is that it stopped working after

Reproduction Instructions

  • Try to patch an unpatchable diff against a repository (e.g. an outdated diff, one that has been closed, or one that was created for a different repository).
  • An error message should be shown, but the exit code will be 0.

Phabricator/Arcanist Version
arcanist 1b97f8b4086dba6ce52b11d8601e03987581e3f7 (26 Feb 2020)

Thanks, see

I have an issue when I apply arc patch it waits for user to resolve conflicts, but I am running arc patch as part of automated script. IF there are any conflicts I just need to exit the process. I didn’t find any non-intractive option for this. Any solution for this?