Bors batch crashed / cancelled after passing `staging` build (branch protection?)

Seems like an issue with branch protection, but bear with me :slight_smile:

Our first two builds with bors failed in the following way:

12/10/2018, 8:10:33 PM	Batch	Canceled	#1978
12/10/2018, 8:10:33 PM	Crash	batch	
{{:badmatch, {:error, :push, 422}},
 [
   {BorsNG.Worker.Batcher, :complete_batch, 3,
    [file: 'lib/worker/batcher.ex', line: 386]},
   {BorsNG.Worker.Batcher, :maybe_complete_batch, 1,
    [file: 'lib/worker/batcher.ex', line: 373]},
   {BorsNG.Worker.Batcher, :handle_cast, 2,
    [file: 'lib/worker/batcher.ex', line: 81]},
   {:gen_server, :try_dispatch, 4,
    [file: 'gen_server.erl', line: 637]},
   {:gen_server, :handle_msg, 6,
    [file: 'gen_server.erl', line: 711]},
   {:proc_lib, :init_p_do_apply, 3,
    [file: 'proc_lib.erl', line: 249]}
 ]}
12/10/2018, 5:47:52 PM	Batch	Canceled	#1974
12/10/2018, 5:47:52 PM	Crash	batch	
{{:badmatch, {:error, :push, 422}},
 [
   {BorsNG.Worker.Batcher, :complete_batch, 3,
    [file: 'lib/worker/batcher.ex', line: 386]},
   {BorsNG.Worker.Batcher, :maybe_complete_batch, 1,
    [file: 'lib/worker/batcher.ex', line: 373]},
   {BorsNG.Worker.Batcher, :handle_cast, 2,
    [file: 'lib/worker/batcher.ex', line: 81]},
   {:gen_server, :try_dispatch, 4,
    [file: 'gen_server.erl', line: 637]},
   {:gen_server, :handle_msg, 6,
    [file: 'gen_server.erl', line: 711]},
   {:proc_lib, :init_p_do_apply, 3,
    [file: 'proc_lib.erl', line: 249]}
 ]}

We're using the public instance, Build: bb36325.

The code pointed to by the stack trace is:

    {:ok, _} = push_with_retry(
      repo_conn,
      batch.commit,
      batch.into_branch)

(bors-ng/batcher.ex at bb363255c33dfc3fb9bcf0e48d8daf62e2d8c83b · bors-ng/bors-ng · GitHub)

Our branch protection settings are as follows:

My hunch is that the reason is three-fold:

  1. we require all commits to be signed
  2. we require a status check from drone, while Failed build due to a misconfigured protected branch suggests it should only be from bors
  3. we require at least 1 PR review

First of all - please confirm that all those are likely causes before I do at least 3 experiments each 1.5h long :slight_smile:

While bors provides config options for enforcing 2. and 3. (pr_status and required_approvals respectively), how do I enforce 1? Ideally, bors would be signing all its commits and then I can leave this setting on. Is there such a feature?

Thanks!
Artur

Update: setting branch protection to just ‘required status checks = bors’ allowed us to merge first 3 PRs.

Is there a feature allowing bors to sign the merge commit though? If not, can I add commit signing to the staging build somehow (in a way compatible with bors)?

  • Bors doesn’t support signed commits. Because of the way the commit API works on GitHub, I don’t think I can add support for it without requiring a lot more disk space on the bors server, which I’d rather not do.

  • The status check should just be set to bors, yes.

  • The best way to do required PR reviews would be to add the required_approvals option to the bors.toml file, instead of trying to enforce the requirement at the GitHub level.