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

Expand documentation for "transaction.search"

Summary: Depends on D20209. Ref T13255. It would probably be nice to make this into a "real" `*.search` API method some day, but at least document the features for now.

Test Plan: Read documentation.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13255

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

+72 -28
+15
src/applications/conduit/method/ConduitAPIMethod.php
··· 409 409 $capability); 410 410 } 411 411 412 + final protected function newRemarkupDocumentationView($remarkup) { 413 + $viewer = $this->getViewer(); 414 + 415 + $view = new PHUIRemarkupView($viewer, $remarkup); 416 + 417 + $view->setRemarkupOptions( 418 + array( 419 + PHUIRemarkupView::OPTION_PRESERVE_LINEBREAKS => false, 420 + )); 421 + 422 + return id(new PHUIBoxView()) 423 + ->appendChild($view) 424 + ->addPadding(PHUI::PADDING_LARGE); 425 + } 426 + 412 427 }
+8 -22
src/applications/search/engine/PhabricatorSearchEngineAPIMethod.php
··· 144 144 ->setHeaderText(pht('Builtin and Saved Queries')) 145 145 ->setCollapsed(true) 146 146 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 147 - ->appendChild($this->buildRemarkup($info)) 147 + ->appendChild($this->newRemarkupDocumentationView($info)) 148 148 ->appendChild($table); 149 149 } 150 150 ··· 223 223 ); 224 224 225 225 if ($constants) { 226 - $constant_lists[] = $this->buildRemarkup( 226 + $constant_lists[] = $this->newRemarkupDocumentationView( 227 227 pht( 228 228 'Constants supported by the `%s` constraint:', 229 229 'statuses')); ··· 283 283 ->setHeaderText(pht('Custom Query Constraints')) 284 284 ->setCollapsed(true) 285 285 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 286 - ->appendChild($this->buildRemarkup($info)) 286 + ->appendChild($this->newRemarkupDocumentationView($info)) 287 287 ->appendChild($table) 288 288 ->appendChild($constant_lists); 289 289 } ··· 391 391 ->setHeaderText(pht('Result Ordering')) 392 392 ->setCollapsed(true) 393 393 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 394 - ->appendChild($this->buildRemarkup($orders_info)) 394 + ->appendChild($this->newRemarkupDocumentationView($orders_info)) 395 395 ->appendChild($orders_table) 396 - ->appendChild($this->buildRemarkup($columns_info)) 396 + ->appendChild($this->newRemarkupDocumentationView($columns_info)) 397 397 ->appendChild($columns_table); 398 398 } 399 399 ··· 472 472 ->setHeaderText(pht('Object Fields')) 473 473 ->setCollapsed(true) 474 474 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 475 - ->appendChild($this->buildRemarkup($info)) 475 + ->appendChild($this->newRemarkupDocumentationView($info)) 476 476 ->appendChild($table); 477 477 } 478 478 ··· 562 562 ->setHeaderText(pht('Attachments')) 563 563 ->setCollapsed(true) 564 564 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 565 - ->appendChild($this->buildRemarkup($info)) 565 + ->appendChild($this->newRemarkupDocumentationView($info)) 566 566 ->appendChild($table); 567 567 } 568 568 ··· 633 633 ->setHeaderText(pht('Paging and Limits')) 634 634 ->setCollapsed(true) 635 635 ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 636 - ->appendChild($this->buildRemarkup($info)); 636 + ->appendChild($this->newRemarkupDocumentationView($info)); 637 637 } 638 638 639 - private function buildRemarkup($remarkup) { 640 - $viewer = $this->getViewer(); 641 - 642 - $view = new PHUIRemarkupView($viewer, $remarkup); 643 - 644 - $view->setRemarkupOptions( 645 - array( 646 - PHUIRemarkupView::OPTION_PRESERVE_LINEBREAKS => false, 647 - )); 648 - 649 - return id(new PHUIBoxView()) 650 - ->appendChild($view) 651 - ->addPadding(PHUI::PADDING_LARGE); 652 - } 653 639 }
+49 -6
src/applications/transactions/conduit/TransactionSearchConduitAPIMethod.php
··· 8 8 } 9 9 10 10 public function getMethodDescription() { 11 - return pht('Read transactions for an object.'); 11 + return pht('Read transactions and comments for an object.'); 12 12 } 13 13 14 - public function getMethodStatus() { 15 - return self::METHOD_STATUS_UNSTABLE; 16 - } 14 + public function getMethodDocumentation() { 15 + $markup = pht(<<<EOREMARKUP 16 + When an object (like a task) is edited, Phabricator creates a "transaction" 17 + and applies it. This list of transactions on each object is the basis for 18 + essentially all edits and comments in Phabricator. Reviewing the transaction 19 + record allows you to see who edited an object, when, and how their edit changed 20 + things. 21 + 22 + One common reason to call this method is that you're implmenting a webhook and 23 + just received a notification that an object has changed. See the Webhooks 24 + documentation for more detailed discussion of this use case. 25 + 26 + Constraints 27 + =========== 28 + 29 + These constraints are supported: 30 + 31 + - `phids` //Optional list<phid>.// Find specific transactions by PHID. This 32 + is most likely to be useful if you're responding to a webhook notification 33 + and want to inspect only the related events. 34 + - `authorPHIDs` //Optional list<phid>.// Find transactions with particular 35 + authors. 36 + 37 + Transaction Format 38 + ================== 39 + 40 + Each transaction has custom data describing what the transaction did. The 41 + format varies from transaction to transaction. The easiest way to figure out 42 + exactly what a particular transaction looks like is to make the associated kind 43 + of edit to a test object, then query that object. 44 + 45 + Not all transactions have data: by default, transactions have a `null` "type" 46 + and no additional data. This API does not expose raw transaction data because 47 + some of it is internal, oddly named, misspelled, confusing, not useful, or 48 + could create security or policy problems to expose directly. 49 + 50 + New transactions are exposed (with correctly spelled, comprehensible types and 51 + useful, reasonable fields) as we become aware of use cases for them. 52 + 53 + EOREMARKUP 54 + ); 55 + 56 + $markup = $this->newRemarkupDocumentationView($markup); 17 57 18 - public function getMethodStatusDescription() { 19 - return pht('This method is new and experimental.'); 58 + return id(new PHUIObjectBoxView()) 59 + ->setCollapsed(true) 60 + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) 61 + ->setHeaderText(pht('Method Details')) 62 + ->appendChild($markup); 20 63 } 21 64 22 65 protected function defineParamTypes() {