Page MenuHomePhabricator

[releeph] Conduit failure with bad IDs
ClosedPublic

Authored by scottmac on Oct 14 2013, 7:58 AM.
Tags
None
Referenced Files
F14058592: D7302.diff
Sun, Nov 17, 1:13 PM
F14056881: D7302.id16436.diff
Sat, Nov 16, 11:05 PM
Unknown Object (File)
Mon, Nov 4, 12:00 AM
Unknown Object (File)
Sat, Oct 26, 9:30 PM
Unknown Object (File)
Oct 19 2024, 11:47 PM
Unknown Object (File)
Oct 19 2024, 4:19 AM
Unknown Object (File)
Oct 19 2024, 1:00 AM
Unknown Object (File)
Oct 18 2024, 3:20 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