New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 659359 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Oct 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 644372



Sign in to add a comment

[Predator] clarify the API of Culprit wrt NullCulprit; or eliminate NullCulprit entirely.

Project Member Reported by wrengr@chromium.org, Oct 25 2016

Issue description

The Culprit class has two fields whose semantics are underspecified when undefined. The regression_range field could be either None or (None,None). And the algorithm field could be None or ''. These are mainly a problem for the NullCulprit class, which we'd like to be able to get rid of somehow. We need to clarify the API here and make sure everything adheres to it consistently.

For regression_range: if we use None, that has the nice effect of being able to check whether we have a regression range or not by checking the truthiness of the regression_range field. On the other hand, if we use (None,None), then we don't have to check for whether we have a regression range prior to being able to unpack it into its first and second parts. (N.B., except for NullCulprit, a Culprit should *always* have a defined regression_range).

For algorithm: If we use the empty string, then we don't need to check for None-ness before printing things out. However, error messages and such aren't really intelligible if we just slot in the empty string where something is expected. (N.B., again, except for NullCulprit, this will always be a defined string, since by definition a try Culprit always has some algorithm that generated it.)

Another option is to get rid of the NullCulprit class entirely. This would be ideal, since it makes the above problems go away. To do this, we'd need to make everyone who calls FindCulprit (or similar) check for None before calling ToDicts or otherwise accessing the Culprit.
 
I am working on an cl which needs the NullCulprit, I can take care of this issue in that cl.

Comment 2 by wrengr@chromium.org, Oct 27 2016

Why is NullCulprit needed? The best approach would be to refactor things so FindCulprit can return None whenever it fails. (thereby getting rid of the conceptual NullCulprit, in addition to the class as such.)
I meant the code used NullCulprit, I am refatoring so we can get rid of the NullCulprit.

Comment 4 by wrengr@chromium.org, Oct 28 2016

Owner: kateso...@chromium.org
Status: Started (was: Assigned)

Comment 5 by wrengr@chromium.org, Oct 28 2016

Owner: wrengr@chromium.org
The CL I was working on is live: http://crrev.com/2457153002

Comment 7 by wrengr@chromium.org, Oct 31 2016

Status: Fixed (was: Started)

Sign in to add a comment