diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php index 7eaf5ef52d..3e9fe2b99f 100644 --- a/src/applications/differential/editor/DifferentialTransactionEditor.php +++ b/src/applications/differential/editor/DifferentialTransactionEditor.php @@ -1511,13 +1511,6 @@ final class DifferentialTransactionEditor $packages = PhabricatorOwnersPackage::loadAffectedPackages( $repository, $this->affectedPaths); - - foreach ($packages as $key => $package) { - if ($package->isArchived()) { - unset($packages[$key]); - } - } - if (!$packages) { return array(); } diff --git a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php index c585f4022f..4fbd717a2a 100644 --- a/src/applications/owners/query/PhabricatorOwnersPackageQuery.php +++ b/src/applications/owners/query/PhabricatorOwnersPackageQuery.php @@ -358,6 +358,13 @@ final class PhabricatorOwnersPackageQuery $best_match = null; $include = false; + // If this package is archived, it's no longer a controlling package + // for the given path. In particular, it can not force active packages + // with weak dominion to give up control. + if ($package->isArchived()) { + continue; + } + foreach ($package->getPaths() as $package_path) { if ($package_path->getRepositoryPHID() != $repository_phid) { // If this path is for some other repository, skip it. diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php index 35f8ac58b5..f2290d2866 100644 --- a/src/applications/owners/storage/PhabricatorOwnersPackage.php +++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php @@ -211,10 +211,13 @@ final class PhabricatorOwnersPackage $conn, 'SELECT pkg.id, pkg.dominion, p.excluded, p.path FROM %T pkg JOIN %T p ON p.packageID = pkg.id - WHERE p.path IN (%Ls) %Q', + WHERE p.path IN (%Ls) AND pkg.status IN (%Ls) %Q', $package->getTableName(), $path->getTableName(), $chunk, + array( + self::STATUS_ACTIVE, + ), $repository_clause); } $rows = array_mergev($rows); diff --git a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php index 8f94df90be..20869ce273 100644 --- a/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php +++ b/src/applications/repository/worker/PhabricatorRepositoryCommitOwnersWorker.php @@ -77,11 +77,6 @@ final class PhabricatorRepositoryCommitOwnersWorker continue; } - if ($package->isArchived()) { - // Don't trigger audits if the package is archived. - continue; - } - if ($package->getAuditingEnabled()) { $reasons = $this->checkAuditReasons( $commit,