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

Skip some repository checks in cluster enviornments

Summary:
Ref T2783. Currently, the repository edit page does some checks agaisnt the local system to look for binaries and files on disk. These checks don't make sense in a cluster environment.

Ideally, we could make a Conduit call to the host (e.g., add something like `diffusion.querysetupstatus`) to do these checks, but since they're pretty basic config things and cluster installs are advanced, it doesn't seem super worthwhile for now.

Test Plan: Saw fewer checks in a cluster repo.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T2783

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

+66 -47
+65 -46
src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
··· 683 683 PhabricatorRepository $repository) { 684 684 685 685 $viewer = $this->getRequest()->getUser(); 686 + $is_cluster = $repository->getAlmanacServicePHID(); 686 687 687 688 $view = new PHUIStatusListView(); 688 689 ··· 756 757 } 757 758 758 759 $binaries = array_unique($binaries); 759 - foreach ($binaries as $binary) { 760 - $where = Filesystem::resolveBinary($binary); 761 - if (!$where) { 762 - $view->addItem( 763 - id(new PHUIStatusItemView()) 764 - ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red') 765 - ->setTarget( 766 - pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) 767 - ->setNote(pht( 768 - "Unable to find this binary in the webserver's PATH. You may ". 769 - "need to configure %s.", 770 - $this->getEnvConfigLink()))); 771 - } else { 772 - $view->addItem( 773 - id(new PHUIStatusItemView()) 774 - ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green') 775 - ->setTarget( 776 - pht('Found Binary %s', phutil_tag('tt', array(), $binary))) 777 - ->setNote(phutil_tag('tt', array(), $where))); 760 + if (!$is_cluster) { 761 + // We're only checking for binaries if we aren't running with a cluster 762 + // configuration. In theory, we could check for binaries on the 763 + // repository host machine, but we'd need to make this more complicated 764 + // to do that. 765 + 766 + foreach ($binaries as $binary) { 767 + $where = Filesystem::resolveBinary($binary); 768 + if (!$where) { 769 + $view->addItem( 770 + id(new PHUIStatusItemView()) 771 + ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red') 772 + ->setTarget( 773 + pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) 774 + ->setNote(pht( 775 + "Unable to find this binary in the webserver's PATH. You may ". 776 + "need to configure %s.", 777 + $this->getEnvConfigLink()))); 778 + } else { 779 + $view->addItem( 780 + id(new PHUIStatusItemView()) 781 + ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green') 782 + ->setTarget( 783 + pht('Found Binary %s', phutil_tag('tt', array(), $binary))) 784 + ->setNote(phutil_tag('tt', array(), $where))); 785 + } 778 786 } 779 - } 780 787 781 - // This gets checked generically above. However, for svn commit hooks, we 782 - // need this to be in environment.append-paths because subversion strips 783 - // PATH. 784 - if ($svnlook_check) { 785 - $where = Filesystem::resolveBinary('svnlook'); 786 - if ($where) { 787 - $path = substr($where, 0, strlen($where) - strlen('svnlook')); 788 - $dirs = PhabricatorEnv::getEnvConfig('environment.append-paths'); 789 - $in_path = false; 790 - foreach ($dirs as $dir) { 791 - if (Filesystem::isDescendant($path, $dir)) { 792 - $in_path = true; 793 - break; 788 + // This gets checked generically above. However, for svn commit hooks, we 789 + // need this to be in environment.append-paths because subversion strips 790 + // PATH. 791 + if ($svnlook_check) { 792 + $where = Filesystem::resolveBinary('svnlook'); 793 + if ($where) { 794 + $path = substr($where, 0, strlen($where) - strlen('svnlook')); 795 + $dirs = PhabricatorEnv::getEnvConfig('environment.append-paths'); 796 + $in_path = false; 797 + foreach ($dirs as $dir) { 798 + if (Filesystem::isDescendant($path, $dir)) { 799 + $in_path = true; 800 + break; 801 + } 802 + } 803 + if (!$in_path) { 804 + $view->addItem( 805 + id(new PHUIStatusItemView()) 806 + ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red') 807 + ->setTarget( 808 + pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) 809 + ->setNote(pht( 810 + 'Unable to find this binary in `environment.append-paths`. '. 811 + 'You need to configure %s and include %s.', 812 + $this->getEnvConfigLink(), 813 + $path))); 794 814 } 795 - } 796 - if (!$in_path) { 797 - $view->addItem( 798 - id(new PHUIStatusItemView()) 799 - ->setIcon(PHUIStatusItemView::ICON_WARNING, 'red') 800 - ->setTarget( 801 - pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) 802 - ->setNote(pht( 803 - 'Unable to find this binary in `environment.append-paths`. '. 804 - 'You need to configure %s and include %s.', 805 - $this->getEnvConfigLink(), 806 - $path))); 807 815 } 808 816 } 809 817 } ··· 829 837 ->execute(); 830 838 831 839 if ($pull_daemon) { 840 + 841 + // TODO: In a cluster environment, we need a daemon on this repository's 842 + // host, specifically, and we aren't checking for that right now. This 843 + // is a reasonable proxy for things being more-or-less correctly set up, 844 + // though. 845 + 832 846 $view->addItem( 833 847 id(new PHUIStatusItemView()) 834 848 ->setIcon(PHUIStatusItemView::ICON_ACCEPT, 'green') ··· 861 875 ->setNote($daemon_instructions)); 862 876 } 863 877 864 - if ($repository->usesLocalWorkingCopy()) { 878 + 879 + if ($is_cluster) { 880 + // Just omit this status check for now in cluster environments. We 881 + // could make a service call and pull it from the repository host 882 + // eventually. 883 + } else if ($repository->usesLocalWorkingCopy()) { 865 884 $local_parent = dirname($repository->getLocalPath()); 866 885 if (Filesystem::pathExists($local_parent)) { 867 886 $view->addItem(
+1 -1
src/infrastructure/daemon/workers/query/PhabricatorWorkerArchiveTaskQuery.php
··· 55 55 if ($this->ids !== null) { 56 56 $where[] = qsprintf( 57 57 $conn_r, 58 - 'ids in (%Ld)', 58 + 'id in (%Ld)', 59 59 $this->ids); 60 60 } 61 61