Closed Bug 1654043 Opened 5 years ago Closed 5 years ago

Create centralized list of jobs that can be referenced throughout

Categories

(Tree Management :: Push Health, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: camd, Assigned: suyash546)

Details

Attachments

(1 file)

Currently, Push Health has a list of jobs for each test. The jobs in this list can be repeated since there are multiple tests in each job that might have failed.

It would be better to have a list of jobs(tasks) keyed off the job_type.name which also happens to be the task label we will be getting from mozci.

So this could be a top-level object we get from the push/health endpoint. That would be passed around as needed and each test element would just have a list of job_type_name values. Those would be used to get the job details from the top-level jobs object.

I think this would be best as a peer of the metrics field in the push/health endpoint.
It would be possible to have the linting and builds metrics use that list as well, but not a requirement for this bug.

Assignee: nobody → suyash546
Status: NEW → ASSIGNED
Priority: -- → P2

All I could get from this bug was that inside the metrics field of push/health api, a field has to be added which is an array of job_type_name
And the list of jobs are all jobs within "failJobs" of tests of every failed type
It would be great if you could tell if i can right in understanding the bug and good to go on it or not

Flags: needinfo?(cdawson)

Now that Bug 1653419 - Push Health remove unused fields from API (https://github.com/mozilla/treeherder/pull/6635) is merged, this should make more sense. My apologies, I wrote this bug after submitting that PR, but before it was merged, so my mind was ahead of master. :)

So, at this point, we want to create a mapping object of jobs by the key of its task label which is stored in job.job_type.name:

{
    "browser/base/content/test/fullscreen/browser_fullscreen_enterInUrlbar.js": [
        {
            "id":310091456,
            "machine_platform_id":722,
            "option_collection_hash":"32faaecac742100f7753f0c1d0aa0add01b4046b",
            "job_type_id":214657,
            "job_group_id":448,
            "result":"testfailed","state":"completed",
            "failure_classification_id":1,
            "push_id":754690,
            "start_time":"2020-07-21T17:37:14",
            "job_type_name":"test-linux1804-64/debug-mochitest-browser-chrome-e10s-9",
            "job_type_symbol":"bc9",
            "platform":"linux1804-64",
            "task_id":"fJp9LnVvTqKTihhLFHDolQ",
            "run_id":0
        },
        { <next job of same type here> },
        { <next job of same type here> },
    ]
}

Then for each individual test in needsInvestigation, you would simply have an array of the test keys: "browser/base/content/test/fullscreen/browser_fullscreen_enterInUrlbar.js". In the UI, we would lookup by that test key to get the job data to display each task entry for the test.

If a task has been retriggered to see if it is intermittent, you may have several jobs for the same task label. Some might be passing, some failing. Here's an example of a push with multiple jobs for the same test: https://treeherder.mozilla.org/pushhealth.html?repo=try&revision=dd3536539a1c8b1978706ad4045f3a65734d92f2

Expand the first one and you'll see. That list of jobs is listed for each test. What we want to do is to have the UI use the testName to lookup the jobs in this new map and get that list to print out. The list of jobs can be repeated for several failures if the job ran multiple tests that failed.

The intent here is to save memory and payload size when downloading to the browser.

Flags: needinfo?(cdawson)

I have to apologize, comment 2 is wrong. I say the list should be keyed by the job_type.name but I SHOW it as keyed by the test name of browser/base/content/test/fullscreen/browser_fullscreen_enterInUrlbar.js. So that was incorrect. It SHOULD have been keyed by test-linux1804-64/debug-mochitest-browser-chrome-e10s-9

The approach I have in mind is:

  1. Get all the jobs with result=='testfailed' excluding linting jobs.
  2. Gather the list of unique job.job_type.name values into failed_job_types list
  3. Get all Job.objects.filter(job_type__name__in=failed_job_types
  4. Take the job list in #3 and create a dict keyed by job_type.name
  5. For each dict entry, order the jobs by start_time so that they show chronologically.

I believe that should do it. Then for each test in the UI, you can just do a lookup for the jobs that match the job_type_name.

Status: ASSIGNED → RESOLVED
Closed: 5 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: