@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add audit, review, and dominion information to "owners.search" API method

Summary:
See PHI439. This fills in additional information about Owners packages.

Also removes dead `primaryOwnerPHID`.

Test Plan: Called `owners.search` and reviewed the results. Grepped for `primaryOwnerPHID`.

Differential Revision: https://secure.phabricator.com/D19207

+43 -2
+2
resources/sql/autopatches/20180309.owners.01.primaryowner.sql
··· 1 + ALTER TABLE {$NAMESPACE}_owners.owners_package 2 + DROP primaryOwnerPHID;
+41 -2
src/applications/owners/storage/PhabricatorOwnersPackage.php
··· 16 16 protected $auditingEnabled; 17 17 protected $autoReview; 18 18 protected $description; 19 - protected $primaryOwnerPHID; 20 19 protected $mailKey; 21 20 protected $status; 22 21 protected $viewPolicy; ··· 122 121 self::CONFIG_COLUMN_SCHEMA => array( 123 122 'name' => 'sort', 124 123 'description' => 'text', 125 - 'primaryOwnerPHID' => 'phid?', 126 124 'auditingEnabled' => 'bool', 127 125 'mailKey' => 'bytes20', 128 126 'status' => 'text32', ··· 601 599 ->setKey('owners') 602 600 ->setType('list<map<string, wild>>') 603 601 ->setDescription(pht('List of package owners.')), 602 + id(new PhabricatorConduitSearchFieldSpecification()) 603 + ->setKey('review') 604 + ->setType('map<string, wild>') 605 + ->setDescription(pht('Auto review information.')), 606 + id(new PhabricatorConduitSearchFieldSpecification()) 607 + ->setKey('audit') 608 + ->setType('map<string, wild>') 609 + ->setDescription(pht('Auto audit information.')), 610 + id(new PhabricatorConduitSearchFieldSpecification()) 611 + ->setKey('dominion') 612 + ->setType('string') 613 + ->setDescription(pht('Dominion setting.')), 604 614 ); 605 615 } 606 616 ··· 612 622 ); 613 623 } 614 624 625 + $review_map = self::getAutoreviewOptionsMap(); 626 + $review_value = $this->getAutoReview(); 627 + if (isset($review_map[$review_value])) { 628 + $review_label = $review_map[$review_value]['name']; 629 + } else { 630 + $review_label = pht('Unknown ("%s")', $review_value); 631 + } 632 + 633 + $review = array( 634 + 'value' => $review_value, 635 + 'label' => $review_label, 636 + ); 637 + 638 + if ($this->getAuditingEnabled()) { 639 + $audit_value = 'audit'; 640 + $audit_label = pht('Auditing Enabled'); 641 + } else { 642 + $audit_value = 'none'; 643 + $audit_label = pht('No Auditing'); 644 + } 645 + 646 + $audit = array( 647 + 'value' => $audit_value, 648 + 'label' => $audit_label, 649 + ); 650 + 615 651 return array( 616 652 'name' => $this->getName(), 617 653 'description' => $this->getDescription(), 618 654 'status' => $this->getStatus(), 619 655 'owners' => $owner_list, 656 + 'review' => $review, 657 + 'audit' => $audit, 658 + 'dominion' => $this->getDominion(), 620 659 ); 621 660 } 622 661