Herald Branch Exists rule

I encountered a chicken and egg problem between a new repository I created, and a Herald rule blocking pushes to master of changes that have not been reviewed.

Arcanist was refusing to submit a diff against the empty repository, and the Herald rule was blocking the initial commit.

It looked to me like adding a “Branches Exist” condition to the Herald rule might work, allowing the initial commit to slip past the evil dragon bureaucrats, but it does not seem to be doing what I expected. Even after adding that rule, the Herald transcript shows it is matching, despite no master branch existing on the server.

I can’t find any documentation about what condition “Branches Exist” is supposed to be checking. Am I mistaken in my expectation that it is checking whether the branches being pushed to exist in the server repository, or is this a bug?

For doing the action you were trying to do:
If it is a git repo, I think you can just git push origin and work around arc and Herald that way? (They can’t stop you if they’re not involved.) YMMV and I’m not sure if this works for hg or for repos directly hosted by Phabricator. (It works on our repos that are observed by Phabricator.)

git push does not work when the repository is hosted by Phabricator - preventing pushes that are not reviewed is precisely what this Herald rule is doing. Since this is a one off problem, I got around it by disabling the Herald rule temporarily, but thought it would be good to raise here in case it is a bug, or there is a different way around it I can configure for future.

Generally, Herald usually shouldn’t care if something was pushed with arc land or git push, so I would expect git push to work. In particular, you should not need to use arc land to satisfy an “Accepted Differential revision exists” condition: this condition effectively has no idea what pathway a commit took into the repository.

Since it sounds like this didn’t work for you, there’s definitely something unexpected afoot here. Offhand:

  • Do you remember what error you encountered when you tried to git push?
  • Do you use history.immutable, so arc land normally generates merge commits?