From d1223ac577e8082c7239009cd102ea5893ca2418 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 15 Apr 2019 09:59:08 -0700 Subject: [PATCH] When a commit appears as an ancestor of a permanent ref for the first time, run all import steps Summary: Depends on D20427. Ref T13277. As an optimization, when we discover that a commit which was previously only on a non-permanent ref ("tmp-epriestley-123") is now reachable from a permanent ref ("master"), we currently queue only a new "message" parse step. This is an optimization because these commits previously got the full treatment (feed, publish, audit, etc) as soon as they were discovered. Now, those steps only happen once a commit is reachable from a permanent ref, so we need to run everything. Test Plan: - Pushed local "tmp-123" branch to remote tag "tmp-123". - Updated repository with "bin/repository update", saw commit import as a "not on any permanent ref" commit, with no herald/audit/etc. - Merged "tmp-123" tag into "master". - Pushed new "master". - Updated repository with "bin/repository refs ... --trace --verbose", saw commit detected as now reachable from a permament ref. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13277 Differential Revision: https://secure.phabricator.com/D20428 --- .../engine/PhabricatorRepositoryRefEngine.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php index 4b1cd829d5..858c15907d 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php @@ -455,7 +455,7 @@ final class PhabricatorRepositoryRefEngine $all_commits = queryfx_all( $conn_w, - 'SELECT id, commitIdentifier, importStatus FROM %T + 'SELECT id, phid, commitIdentifier, importStatus FROM %T WHERE repositoryID = %d AND commitIdentifier IN (%Ls)', $commit_table->getTableName(), $repository->getID(), @@ -485,10 +485,15 @@ final class PhabricatorRepositoryRefEngine $data = array( 'commitID' => $row['id'], - 'only' => true, ); - PhabricatorWorker::scheduleTask($class, $data); + PhabricatorWorker::scheduleTask( + $class, + $data, + array( + 'priority' => PhabricatorWorker::PRIORITY_COMMIT, + 'objectPHID' => $row['phid'], + )); } }