Page MenuHomePhabricator

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

Authored by epriestley on Mon, Feb 3, 1:05 PM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Mon, Feb 3, 1:05 PM
epriestley requested review of this revision.Mon, Feb 3, 1:07 PM

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]
This revision was not accepted when it landed; it landed in state Needs Review.Mon, Feb 3, 1:09 PM
This revision was automatically updated to reflect the committed changes.