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

Use ApplicationTransactions when indexing commit/audit comments

Summary:
Ref T4896. Depends on D10056. Moves search indexing to standard infrastructure.

Also, fixes a bug where inline comments would not be indexed.

Test Plan: Used `bin/search index ... --trace` to view index construction of a commit, saw all the comments and inlines get indexed.

Reviewers: btrahan, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T4896

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

+4 -22
+4 -21
src/applications/repository/search/PhabricatorRepositoryCommitSearchIndexer.php
··· 66 66 PhabricatorRepositoryRepositoryPHIDType::TYPECONST, 67 67 $date_created); 68 68 69 - $comments = PhabricatorAuditComment::loadComments( 70 - $this->getViewer(), 71 - $commit->getPHID()); 72 - foreach ($comments as $comment) { 73 - if (strlen($comment->getContent())) { 74 - $doc->addField( 75 - PhabricatorSearchField::FIELD_COMMENT, 76 - $comment->getContent()); 77 - } 78 - } 79 - 80 - $inlines = PhabricatorAuditInlineComment::loadPublishedComments( 81 - $this->getViewer(), 82 - $commit->getPHID()); 83 - foreach ($inlines as $inline) { 84 - if (strlen($inline->getContent())) { 85 - $doc->addField( 86 - PhabricatorSearchField::FIELD_COMMENT, 87 - $inline->getContent()); 88 - } 89 - } 69 + $this->indexTransactions( 70 + $doc, 71 + new PhabricatorAuditTransactionQuery(), 72 + array($commit->getPHID())); 90 73 91 74 return $doc; 92 75 }
-1
src/applications/search/index/PhabricatorSearchDocumentIndexer.php
··· 101 101 $xactions = id(clone $query) 102 102 ->setViewer($this->getViewer()) 103 103 ->withObjectPHIDs($phids) 104 - ->withTransactionTypes(array(PhabricatorTransactions::TYPE_COMMENT)) 105 104 ->execute(); 106 105 107 106 foreach ($xactions as $xaction) {