@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 more status checks for binaries

Summary:
Expands on D7488, which looks way better than the config checks. I'm leaving the config checks for now, but maybe we should just get rid of them? This advice is delivered in a far more timely way.

- Check for normal VCS binaries too.
- Link to `environment.append-paths`.
- Get rid of untranslated names (I think they're probably not too useful?)

Test Plan: See screenshots.

Reviewers: hach-que, btrahan

Reviewed By: hach-que

CC: aran

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

+52 -34
+52 -34
src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
··· 597 597 return $view; 598 598 } 599 599 600 + $binaries = array(); 601 + switch ($repository->getVersionControlSystem()) { 602 + case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 603 + $binaries[] = 'git'; 604 + break; 605 + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 606 + $binaries[] = 'svn'; 607 + break; 608 + case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 609 + $binaries[] = 'hg'; 610 + break; 611 + } 612 + 600 613 if ($repository->isHosted()) { 601 - $binaries = array(); 602 614 if ($repository->getServeOverHTTP() != PhabricatorRepository::SERVE_OFF) { 603 615 switch ($repository->getVersionControlSystem()) { 604 616 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 605 - $binaries['Git HTTP serve'] = 'git-http-backend'; 617 + $binaries[] = 'git-http-backend'; 606 618 break; 607 619 case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 608 - $binaries['SVN serve'] = 'svnserve'; 609 - $binaries['SVN admin'] = 'svnadmin'; 620 + $binaries[] = 'svnserve'; 621 + $binaries[] = 'svnadmin'; 610 622 break; 611 623 case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 612 - $binaries['Mercurial'] = 'hg'; 624 + $binaries[] = 'hg'; 613 625 break; 614 626 } 615 627 } 616 628 if ($repository->getServeOverSSH() != PhabricatorRepository::SERVE_OFF) { 617 629 switch ($repository->getVersionControlSystem()) { 618 630 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 619 - $binaries['Git SSH receive'] = 'git-receive-pack'; 620 - $binaries['Git SSH upload'] = 'git-upload-pack'; 631 + $binaries[] = 'git-receive-pack'; 632 + $binaries[] = 'git-upload-pack'; 621 633 break; 622 634 case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 623 - $binaries['SVN serve'] = 'svnserve'; 624 - $binaries['SVN admin'] = 'svnadmin'; 635 + $binaries[] = 'svnserve'; 636 + $binaries[] = 'svnadmin'; 625 637 break; 626 638 case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL: 627 - $binaries['Mercurial'] = 'hg'; 639 + $binaries[] = 'hg'; 628 640 break; 629 641 } 630 642 } 631 - $binaries = array_unique($binaries); 632 - foreach ($binaries as $name => $binary) { 633 - if (!Filesystem::binaryExists($binary)) { 634 - $view->addItem( 635 - id(new PHUIStatusItemView()) 636 - ->setIcon('warning-red') 637 - ->setTarget(pht( 638 - '%s tool not found in PATH', 639 - $name)) 640 - ->setNote(pht( 641 - 'You may need to configure %s.', 642 - phutil_tag('tt', array(), 'environment.append-paths')))); 643 - } else { 644 - $view->addItem( 645 - id(new PHUIStatusItemView()) 646 - ->setIcon('accept-green') 647 - ->setTarget(pht( 648 - '%s tool found', 649 - $name)) 650 - ->setNote(phutil_tag( 651 - 'tt', 652 - array(), 653 - Filesystem::resolveBinary($binary)))); 654 - } 643 + } 644 + 645 + $binaries = array_unique($binaries); 646 + foreach ($binaries as $binary) { 647 + $where = Filesystem::resolveBinary($binary); 648 + if (!$where) { 649 + $config_href = '/config/edit/environment.append-paths/'; 650 + $config_link = phutil_tag( 651 + 'a', 652 + array( 653 + 'href' => $config_href, 654 + ), 655 + 'environment.append-paths'); 656 + 657 + $view->addItem( 658 + id(new PHUIStatusItemView()) 659 + ->setIcon('warning-red') 660 + ->setTarget( 661 + pht('Missing Binary %s', phutil_tag('tt', array(), $binary))) 662 + ->setNote(pht( 663 + "Unable to find this binary in the webserver's PATH. You may ". 664 + "need to configure %s.", 665 + $config_link))); 666 + } else { 667 + $view->addItem( 668 + id(new PHUIStatusItemView()) 669 + ->setIcon('accept-green') 670 + ->setTarget( 671 + pht('Found Binary %s', phutil_tag('tt', array(), $binary))) 672 + ->setNote(phutil_tag('tt', array(), $where))); 655 673 } 656 674 } 657 675