Page MenuHomePhabricator

[releeph] Conduit failure with bad IDs
ClosedPublic

Authored by scottmac on Oct 14 2013, 7:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 29, 8:15 AM
Unknown Object (File)
Tue, Dec 24, 4:22 PM
Unknown Object (File)
Tue, Dec 24, 2:39 AM
Unknown Object (File)
Tue, Dec 17, 8:22 AM
Unknown Object (File)
Sat, Dec 14, 3:49 PM
Unknown Object (File)
Thu, Dec 12, 2:13 PM
Unknown Object (File)
Mon, Dec 9, 4:39 PM
Unknown Object (File)
Mon, Dec 9, 4:12 AM

Details

Summary

Instead of returning a blank result it throws exceptions. Fix this up a
little so we get some consistency with differential

Test Plan

Loaded a bad phid for releeph, returns empty list.
Try a good phid and get 2 releeph merges.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

scottmac updated this revision to Unknown Object (????).Oct 14 2013, 8:37 AM

redo lint with the correct arc

The more consistent approach is to not return results which don't match parameters. differential.query, which is the parallel to this method, works the same way, as do all other modern query methods.

In particular, if you have 30 PHIDs and one of them is bad, "return nothing for nonmatching results" lets you handle that reasonably, while "throw an exception and return no results at all" doesn't.

This will return the 29/30 correctly, I only set the bad flag when all are bad. Without it you end up with a full table scan since there is no where filtering applied.

Ohhhh, sorry! I was misunderstanding what's going on here.

The most standard way to approach this would be to remove the logic from withRevisionPHIDs() and just store $this->revisionPHIDs = ..., then do the subquery and Empty check inside buildWhereClause(). This would remove the need for the badRevisionsRequested flag.

For most types of subquery logic, the check must be performed in this way because the subqueries require a viewer. This logic will eventually need to be adjusted to account for that, because it skips policy checks on the revisions right now. Once policies roll out fully, you should not be allowed to query requests for a revision you don't have permission to see. This is fine for the moment, though, as we're kind of ignoring releeph for policy purposes for the moment and it has a bunch of other stuff that needs cleanup.

scottmac updated this revision to Unknown Object (????).Oct 14 2013, 4:27 PM

clarify this only happens when all revision filter fails

scottmac updated this revision to Unknown Object (????).Oct 14 2013, 4:42 PM

Do it the correct way