Closed Bug 1408671 Opened 7 years ago Closed 7 years ago

Make Filter-by-job-field classification filters, display their name not their id

Categories

(Tree Management :: Treeherder: Frontend, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jfrench, Assigned: jfrench)

Details

Attachments

(2 files, 1 obsolete file)

When using Filter by job field, an active filter using 'failure classification' appears to display its object id number, not its name.

To reproduce:
o click Navbar > Filter by job field 
o Select Filter Field > failure classification
o Select Value > (any classification value, eg. intermittent)
o click Add

Expected:
An active filter "failure_classification_id: intermittent"

Observed:
An active filter "failure_classification_id: 4"
I have a UI side fix so far, which changes the URl bar searchStr from eg. "filter-failure_classification_id=4" to a human readable "filter-failure_classification_id=intermittent" - which then also renders the value correctly in the filter bar. Still to figure out is how to get the main jobs table to present correctly on that change.
Component: Treeherder → Treeherder: Frontend
I put up a WIP branch filterbar-classification-display on my own GitHub which roughly mocks what I want to do:

(done) applying the name not the id number to the URL searchStr and filter bar
(tbd) applying the name to the job object, so it is filtered in the job table

Plus lots of other areas of interest marked during investigation, which may or may not be involved in the change.
Talking w/camd on IRC we agree it's more pain than gain to migrate the failure_classification_id from int to string on the backend, to support job filtering everywhere(URL, job table, filter bar) by string, per comment#3.

So the plan is instead to just convert the value to its string in our little light blue job filter bar. The URL filter will remain an int, as will the failure_classification_id on each job object.
Assignee: nobody → tojonmz
Status: NEW → ASSIGNED
Comment on attachment 8926242 [details] [review]
[treeherder] tojon:filterbar-classification-display > mozilla:master

At your leisure :) I've annotated the PR with hopefully some helpful info for the review.
Attachment #8926242 - Flags: review?(cdawson)
Comment on attachment 8926242 [details] [review]
[treeherder] tojon:filterbar-classification-display > mozilla:master

Just a couple nit-picks for now.  Awesome fix though!  :)
Attachment #8926242 - Flags: review?(cdawson) → review-
Comment on attachment 8926242 [details] [review]
[treeherder] tojon:filterbar-classification-display > mozilla:master

Nits done, let me know if there's anything else and I will squash before merge.
Attachment #8926242 - Flags: review- → review?(cdawson)
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/94739118f9f746ee7fd2c47af22896539d71cf17
Bug 1408671 - Display job field filter classification by name not id (#2922)
Comment on attachment 8926242 [details] [review]
[treeherder] tojon:filterbar-classification-display > mozilla:master

I went ahead and squashed it for you.  Thanks for doing this!  :)
Attachment #8926242 - Flags: review?(cdawson) → review+
Cool, thank you sir :)
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Sigh. With existing classification_type filter(s) we lose the filter text after the reload. I am sure I tested this but perhaps related to the bs4 update or my own yarn update I just had to do locally to sync to master. Re-opening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Adding a needinfo just as a reminder for camd for the revert.
Flags: needinfo?(cdawson)
Comment on attachment 8928836 [details] [review]
[treeherder] tojon:revert-filterbar-classification-display > mozilla:master

Revert ahoy.
Attachment #8928836 - Flags: review?(cdawson)
Attachment #8928836 - Flags: review?(cdawson) → review+
Flags: needinfo?(cdawson)
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/ec10d3364dec58ef5be1bb4995d827dcf7dda2e4
Revert "Bug 1408671 - Display job field filter classification by name not id (#2922)" (#2955)

This reverts commit 94739118f9f746ee7fd2c47af22896539d71cf17.
Thank you so much Ed. I'm working on a fix for the problem behavior now.
Attachment #8926242 - Attachment is obsolete: true
Comment on attachment 8929219 [details] [review]
[treeherder] tojon:field-filters-classification > mozilla:master

Ok, here's a more minimalist approach. It seems to behave properly in all my test cases.
Attachment #8929219 - Flags: review?(cdawson)
Comment on attachment 8929219 [details] [review]
[treeherder] tojon:field-filters-classification > mozilla:master

Looks great!
Attachment #8929219 - Flags: review?(cdawson) → review+
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: