]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/arcanist_util/config/FacebookOldArcanistConfiguration.php
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / arcanist_util / config / FacebookOldArcanistConfiguration.php
1 <?php
2 // Copyright 2004-present Facebook. All Rights Reserved.
3 // This source code is licensed under the BSD-style license found in the
4 // LICENSE file in the root directory of this source tree. An additional grant
5 // of patent rights can be found in the PATENTS file in the same directory.
6
7 require('RocksDBCommonHelper.php');
8
9 define("DIFF_COMMAND", "diff");
10
11 class FacebookArcanistConfiguration extends ArcanistConfiguration {
12 public function getCustomArgumentsForCommand($command) {
13 if ($command == "land") {
14 return array(
15 'async' => array('help' => 'Just to make tools happy'));
16 }
17 return array();
18 }
19
20 public function didRunWorkflow($command,
21 ArcanistBaseWorkflow $workflow,
22 $error_code) {
23 // Default options don't terminate on failure, but that's what we want. In
24 // the current case we use assertions intentionally as "terminate on failure
25 // invariants".
26 assert_options(ASSERT_BAIL, true);
27
28 assert($workflow);
29 assert(strlen($command) > 0);
30
31 if ($command == DIFF_COMMAND && !$workflow->isRawDiffSource()) {
32 $diffID = $workflow->getDiffId();
33
34 // When submitting a diff this code path gets executed multiple times in
35 // a row. We only care about the case when ID for the diff is provided
36 // because that's what we need to apply the diff and trigger the tests.
37 if (strlen($diffID) > 0) {
38 assert(is_numeric($diffID));
39 startTestsInSandcastle(true /* $applyDiff */, $workflow, $diffID);
40 }
41 }
42 }
43 }