@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.

Remove an unused method in Audit for building comment actions

Summary: Ref T2393. This has been obsoleted by stacked actions and is no longer used.

Test Plan: Grepped for callsites, viwed commits.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2393

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

-79
-79
src/applications/diffusion/controller/DiffusionCommitController.php
··· 739 739 return $comment_view; 740 740 } 741 741 742 - /** 743 - * Return a map of available audit actions for rendering into a <select />. 744 - * This shows the user valid actions, and does not show nonsense/invalid 745 - * actions (like closing an already-closed commit, or resigning from a commit 746 - * you have no association with). 747 - */ 748 - private function getAuditActions( 749 - PhabricatorRepositoryCommit $commit, 750 - array $audit_requests) { 751 - assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); 752 - $viewer = $this->getViewer(); 753 - 754 - $user_is_author = ($commit->getAuthorPHID() == $viewer->getPHID()); 755 - 756 - $user_request = null; 757 - foreach ($audit_requests as $audit_request) { 758 - if ($audit_request->getAuditorPHID() == $viewer->getPHID()) { 759 - $user_request = $audit_request; 760 - break; 761 - } 762 - } 763 - 764 - $actions = array(); 765 - $actions[PhabricatorAuditActionConstants::COMMENT] = true; 766 - 767 - // We allow you to accept your own commits. A use case here is that you 768 - // notice an issue with your own commit and "Raise Concern" as an indicator 769 - // to other auditors that you're on top of the issue, then later resolve it 770 - // and "Accept". You can not accept on behalf of projects or packages, 771 - // however. 772 - $actions[PhabricatorAuditActionConstants::ACCEPT] = true; 773 - $actions[PhabricatorAuditActionConstants::CONCERN] = true; 774 - 775 - // To resign, a user must have authority on some request and not be the 776 - // commit's author. 777 - if (!$user_is_author) { 778 - $may_resign = false; 779 - 780 - $authority_map = array_fill_keys($this->auditAuthorityPHIDs, true); 781 - foreach ($audit_requests as $request) { 782 - if (empty($authority_map[$request->getAuditorPHID()])) { 783 - continue; 784 - } 785 - $may_resign = true; 786 - break; 787 - } 788 - 789 - // If the user has already resigned, don't show "Resign...". 790 - $status_resigned = PhabricatorAuditStatusConstants::RESIGNED; 791 - if ($user_request) { 792 - if ($user_request->getAuditStatus() == $status_resigned) { 793 - $may_resign = false; 794 - } 795 - } 796 - 797 - if ($may_resign) { 798 - $actions[PhabricatorAuditActionConstants::RESIGN] = true; 799 - } 800 - } 801 - 802 - $status_concern = PhabricatorAuditCommitStatusConstants::CONCERN_RAISED; 803 - $concern_raised = ($commit->getAuditStatus() == $status_concern); 804 - $can_close_option = PhabricatorEnv::getEnvConfig( 805 - 'audit.can-author-close-audit'); 806 - if ($can_close_option && $user_is_author && $concern_raised) { 807 - $actions[PhabricatorAuditActionConstants::CLOSE] = true; 808 - } 809 - 810 - $actions[PhabricatorAuditActionConstants::ADD_AUDITORS] = true; 811 - $actions[PhabricatorAuditActionConstants::ADD_CCS] = true; 812 - 813 - foreach ($actions as $constant => $ignored) { 814 - $actions[$constant] = 815 - PhabricatorAuditActionConstants::getActionName($constant); 816 - } 817 - 818 - return $actions; 819 - } 820 - 821 742 private function buildMergesTable(PhabricatorRepositoryCommit $commit) { 822 743 $viewer = $this->getViewer(); 823 744 $drequest = $this->getDiffusionRequest();