Page MenuHomePhabricator

Fix an issue where Herald rules could fail to evaluate at post-commit time
ClosedPublic

Authored by epriestley on Feb 3 2020, 1:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 4:06 PM
Unknown Object (File)
Mon, Dec 16, 4:51 AM
Unknown Object (File)
Thu, Dec 5, 7:59 PM
Unknown Object (File)
Thu, Dec 5, 7:08 AM
Unknown Object (File)
Sat, Nov 30, 11:27 PM
Unknown Object (File)
Tue, Nov 26, 10:56 PM
Unknown Object (File)
Mon, Nov 25, 9:21 AM
Unknown Object (File)
Nov 23 2024, 5:23 AM
Subscribers
None

Details

Summary

Ref T13480. Some Herald fields need audit information, which recent changes to Herald adapters discarded. For now, just load it unconditionally.

Test Plan

Triggered an Audit-related rule locally.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

For posterity, here's the trace I hit:

$ ./bin/repository reparse --publish 787d68fd3e83
[2020-02-03 05:03:16] EXCEPTION: (Error) Call to undefined method DiffusionCommitQuery::needAudits() at [<phabricator>/src/applications/diffusion/herald/HeraldCommitAdapter.php:55]
arcanist(head=experimental, ref.master=21a1828ea06c, ref.experimental=e19fe12f7ecd), corgi(head=master, ref.master=72dc914db4d4), instances(head=stable, ref.master=08c916007a31, ref.stable=1a9e426d237c), libcore(), phabricator(head=stable, ref.master=ccf28a81121e, ref.stable=cc11dff7d317, custom=10), phutil(head=stable, ref.master=cc2a3dbf5903, ref.stable=034cf7cc3994), services(head=master, ref.master=c4bd119b358e)
  #0 HeraldCommitAdapter::setObject(PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/audit/editor/PhabricatorAuditEditor.php:723]
  #1 PhabricatorAuditEditor::buildHeraldAdapter(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:3896]
  #2 PhabricatorApplicationTransactionEditor::applyHeraldRules(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php:1286]
  #3 PhabricatorApplicationTransactionEditor::applyTransactions(PhabricatorRepositoryCommit, array) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:92]
  #4 PhabricatorRepositoryCommitPublishWorker::publishCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitPublishWorker.php:20]
  #5 PhabricatorRepositoryCommitPublishWorker::parseCommit(PhabricatorRepository, PhabricatorRepositoryCommit) called at [<phabricator>/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:51]
  #6 PhabricatorRepositoryCommitParserWorker::doWork() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:124]
  #7 PhabricatorWorker::executeTask() called at [<phabricator>/src/infrastructure/daemon/workers/PhabricatorWorker.php:163]
  #8 PhabricatorWorker::scheduleTask(string, array, array) called at [<phabricator>/src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php:260]
  #9 PhabricatorRepositoryManagementReparseWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:457]
  #10 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:349]
  #11 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/repository/manage_repositories.php:22]