[Predator] clarify the API of Culprit wrt NullCulprit; or eliminate NullCulprit entirely. |
|||
Issue descriptionThe 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.
,
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.)
,
Oct 27 2016
I meant the code used NullCulprit, I am refatoring so we can get rid of the NullCulprit.
,
Oct 28 2016
,
Oct 28 2016
,
Oct 31 2016
The following revision refers to this bug: https://chromium.googlesource.com/infra/infra.git/+/85d7a301dd67ee340fb722f096276993f40636de commit 85d7a301dd67ee340fb722f096276993f40636de Author: wrengr <wrengr@chromium.org> Date: Mon Oct 31 17:37:26 2016 replacing the NullCulprit class by None BUG= 659359 TBR=stgao@chromium.org Review-Url: https://codereview.chromium.org/2457153002 [modify] https://crrev.com/85d7a301dd67ee340fb722f096276993f40636de/appengine/findit/crash/crash_pipeline.py [modify] https://crrev.com/85d7a301dd67ee340fb722f096276993f40636de/appengine/findit/crash/culprit.py [modify] https://crrev.com/85d7a301dd67ee340fb722f096276993f40636de/appengine/findit/crash/findit.py [modify] https://crrev.com/85d7a301dd67ee340fb722f096276993f40636de/appengine/findit/crash/test/crash_pipeline_test.py [modify] https://crrev.com/85d7a301dd67ee340fb722f096276993f40636de/appengine/findit/crash/test/findit_for_chromecrash_test.py
,
Oct 31 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by kateso...@chromium.org
, Oct 26 2016