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
F14076109: D20962.diff
Thu, Nov 21, 2:45 PM
Unknown Object (File)
Mon, Nov 18, 1:43 PM
Unknown Object (File)
Sun, Nov 17, 2:20 PM
Unknown Object (File)
Thu, Oct 24, 12:50 AM
Unknown Object (File)
Oct 16 2024, 9:43 PM
Unknown Object (File)
Oct 11 2024, 7:13 AM
Unknown Object (File)
Oct 9 2024, 12:51 PM
Unknown Object (File)
Oct 2 2024, 5:42 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]