Page MenuHomePhabricator

Audit - add ability to query by repositories
ClosedPublic

Authored by btrahan on Aug 12 2014, 9:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 6:04 PM
Unknown Object (File)
Thu, Jan 9, 2:17 PM
Unknown Object (File)
Tue, Jan 7, 1:28 PM
Unknown Object (File)
Sat, Dec 28, 8:40 PM
Unknown Object (File)
Thu, Dec 26, 1:30 PM
Unknown Object (File)
Dec 11 2024, 4:06 AM
Unknown Object (File)
Dec 3 2024, 9:09 PM
Unknown Object (File)
Dec 3 2024, 9:09 PM
Subscribers

Details

Summary

Fixes T5862. The Diffusion table uses id but all the other infrastructure uses phid so just do a quick load of the repositories to get the ids. Long term, we should re-key the table by phid I think.

Test Plan

made a query with a repository and got a proper result set

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

btrahan retitled this revision from to Audit - add ability to query by repositories.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
epriestley edited edge metadata.

One weird mess inline that I don't have a clean answer for.

src/applications/audit/query/PhabricatorCommitSearchEngine.php
70

We should make sure $repositories is not empty, and automatically fail the query if it is. I don't think there's an easy way to do that right now. You could do something silly/hacky like pass array(-1) I guess, or maybe make some dummy Query subclass like PhabricatorNeverAnyResultsQuery, and return that? Or add some flag to Query like setMatchNoResults(true)? Or expose withRepositoryPHIDs() on the Query, and have it do this lookup internally, so it can throw PhabricatorEmptyQueryException immediately? Maybe that's cleanest?

This revision is now accepted and ready to land.Aug 13 2014, 12:31 AM
btrahan edited edge metadata.

add withRepositoryPHIds; add comment to say to prefer withRepositoryIDs and why

re-tested and it still works

btrahan updated this revision to Diff 24724.

Closed by commit rP644e950ea3f1 (authored by @btrahan).

One possible inline, looks solid otherwise.

src/applications/diffusion/query/DiffusionCommitQuery.php
70–77

I think this miiight have to happen at query time for the exception to be dealt with properly? i.e., move the actual lookup to the buildWhereClause() part? That should fix the setViewer() thing too.

okay i'll shoot you another diff