Page MenuHomePhabricator

T7651: Created herald.queryrules Conduit API method.
Needs RevisionPublic

Authored by Pawka on Mar 24 2015, 9:31 AM.

Details

Summary

Created herald.queryrules Conduit API method to search Herald rules.

Test Plan

Open yourphabricator.com/conduit/method/herald.queryrules/ and perform search with different parameters.

Diff Detail

Repository
rP Phabricator
Branch
herald_queryrules
Lint
Lint OK
Unit
Unit Tests OK
Build Status
Buildable 4955
Build 4973: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

Pawka updated this revision to Diff 29182.Mar 24 2015, 9:31 AM
Pawka retitled this revision from to T7651: Created herald.queryrules Conduit API method..
Pawka updated this object.
Pawka edited the test plan for this revision. (Show Details)
Pawka added a reviewer: epriestley.
Pawka edited the test plan for this revision. (Show Details)Mar 25 2015, 7:23 AM
Pawka edited edge metadata.
protected function buildConditionsInfoDictionaries(array $conditions) {
  assert_instances_of($conditions, 'HeraldCondition');

  $result = array();

  if (!empty($conditions)) {
    foreach ($conditions as $cond) {
      $result[$cond->getID()] = array(
        'id'             => $cond->getID(),
        'fieldName'      => $cond->getFieldName(),
        'fieldCondition' => $cond->getFieldCondition(),
        'value'          => $cond->getValue(),
      );
    }
  }

  return $result;
}

protected function buildActionsInfoDictionaries(array $actions) {
  assert_instances_of($actions, 'HeraldAction');

  $result = array();

  if (!empty($actions)) {
    foreach ($actions as $action) {
      $result[$action->getID()] = array(
        'id'     => $action->getID(),
        'action' => $action->getAction(),
        'target' => $action->getTarget(),
      );
    }
  }

  return $result;
}

}

epriestley requested changes to this revision.May 19 2015, 3:20 PM
epriestley edited edge metadata.

Per T7651, I don't want to bring this upstream now. Particularly, it should wait for T7715 and rebuild on top of that, and it seems questionable even then.

This revision now requires changes to proceed.May 19 2015, 3:20 PM