Closed Bug 1457492 Opened 5 years ago Closed 5 years ago

FailuresByBug and FailureCount use differing criteria to determine orange count


(Tree Management :: Treeherder, enhancement, P1)



(Not tracked)



(Reporter: emorley, Assigned: sclements)




(1 file)

47 bytes, text/x-github-pull-request
: review+
Details | Review
In bug 1453759 it was noticed that the Intermittent counts in the Treeherder IFV UI were different from what the Treeherder /api/failurecount/ API was returning, resulting in:

I think this is happening because:
* The intermittent failures view UI uses the stats from /api/failuresbybug/ to determine the overall count in the UI
* Those stats come from here:
* Whereas the /api/failurecount/ (which is the right one for them to be using for their graph - and is presumably what the IFV uses for it's own graph too) comes from here:
* ...and the latter has an additional filter on `job__failure_classification__id=4`

Having a different filter on each endpoint seems unintentional? Or if it's required, we should add a code comment explaining why.

We should probably also refactor to reduce duplication, which would help avoid deviations between filter criteria in the future.
The `job__failure_classification__id=4` on the query for failurecount (for bug_id) is indeed a mistake; removing it shows the correct results (with minor variations in a few days' counts due to IFV using UTC, not localizing aggregations). I'll refactor and submit a patch.
Assignee: nobody → sclements313
Attached file patch
Attachment #8972066 - Flags: review?(emorley)
Comment on attachment 8972066 [details] [review]

George, don't suppose you could take a look at this? You're probably more familiar with Django model managers than I am at this point (has been a while).
Attachment #8972066 - Flags: review?(emorley) → review?(ghickman)
This looks great, it's nice having those longer queries wrapped up in a manager too.
Attachment #8972066 - Flags: review?(ghickman) → review+
Commit pushed to master at
Bug 1457492 - Fix FailureCount endpoint (#3495)

* remove `job__failure_classification__id=4` in `FailureCount` & `Failures` endpoint
* create `QuerySet` to remove duplicate code for filters
Closed: 5 years ago
Resolution: --- → FIXED
Component: Intermittent Failures View → TreeHerder
You need to log in before you can comment on or make changes to this bug.