1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Audit - allow queries for "partial" and "accepted" audits

Summary: Fixes T5871. These queries get to use the actual column on the commit table since they are about the "aggregate" state of different audits.

Test Plan: issues queries and got sensible results.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5871

Differential Revision: https://secure.phabricator.com/D10271
This commit is contained in:
Bob Trahan 2014-08-19 10:43:52 -07:00
parent df361470c1
commit 59b626d2c1
2 changed files with 18 additions and 0 deletions

View file

@ -181,6 +181,8 @@ final class PhabricatorCommitSearchEngine
DiffusionCommitQuery::AUDIT_STATUS_ANY => pht('Any'),
DiffusionCommitQuery::AUDIT_STATUS_OPEN => pht('Open'),
DiffusionCommitQuery::AUDIT_STATUS_CONCERN => pht('Concern Raised'),
DiffusionCommitQuery::AUDIT_STATUS_ACCEPTED => pht('Accepted'),
DiffusionCommitQuery::AUDIT_STATUS_PARTIAL => pht('Partially Audited'),
);
}

View file

@ -21,6 +21,8 @@ final class DiffusionCommitQuery
const AUDIT_STATUS_ANY = 'audit-status-any';
const AUDIT_STATUS_OPEN = 'audit-status-open';
const AUDIT_STATUS_CONCERN = 'audit-status-concern';
const AUDIT_STATUS_ACCEPTED = 'audit-status-accepted';
const AUDIT_STATUS_PARTIAL = 'audit-status-partial';
private $needCommitData;
@ -437,6 +439,18 @@ final class DiffusionCommitQuery
$status = $this->auditStatus;
if ($status !== null) {
switch ($status) {
case self::AUDIT_STATUS_PARTIAL:
$where[] = qsprintf(
$conn_r,
'commit.auditStatus = %d',
PhabricatorAuditCommitStatusConstants::PARTIALLY_AUDITED);
break;
case self::AUDIT_STATUS_ACCEPTED:
$where[] = qsprintf(
$conn_r,
'commit.auditStatus = %d',
PhabricatorAuditCommitStatusConstants::FULLY_AUDITED);
break;
case self::AUDIT_STATUS_CONCERN:
$where[] = qsprintf(
$conn_r,
@ -462,6 +476,8 @@ final class DiffusionCommitQuery
self::AUDIT_STATUS_ANY,
self::AUDIT_STATUS_OPEN,
self::AUDIT_STATUS_CONCERN,
self::AUDIT_STATUS_ACCEPTED,
self::AUDIT_STATUS_PARTIAL,
);
throw new Exception(
"Unknown audit status '{$status}'! Valid statuses are: ".