This module helps with the buildjson data generated by the Release Engineering systems:


Helper method to download a buildjson file by providing a date.

mozci.sources.buildjson.query_job_data(complete_at, request_id)

Look for a job identified by request_id inside of a buildjson file under the “builds” entry.

Through complete_at, we can determine on which day we can find the metadata about this job.

WARNING: “request_ids” and the ones from “properties” can differ. Issue filed.

If found, the returning entry will look like this (only important values are referenced):

    "builder_id": int, # It is a unique identifier of a builder
    "starttime": int,
    "endtime": int,
    "properties": {
        "blobber_files": json, # Mainly applicable to test jobs
        "buildername": string,
        "buildid": string,
        "log_url", string,
        "packageUrl": string, # It only applies for build jobs
        "revision": string,
        "repo_path": string, # e.g. projects/cedar
        "request_ids": list of ints, # Scheduling ID
        "slavename": string, # e.g. t-w864-ix-120
        "symbolsUrl": string, # It only applies for build jobs
        "testsUrl": string,   # It only applies for build jobs
    "request_ids": list of ints, # Scheduling ID
    "requesttime": int,
    "result": int, # Job's exit code
    "slave_id": int, # Unique identifier for the machine that run it

NOTE: Remove this block once is fixed.

There is so funkiness in here. A buildjson file for a day is produced every 15 minutes all the way until midnight pacific time. After that, a new _UTC_ day commences. However, we will only contain all jobs ending within the UTC day and not the PT day. If you run any of this code in the last 4 hours of the pacific day, you will have a gap of 4 hours for which you won’t have buildjson data (between 4-8pm PT). The gap starts appearing after 8pm PT when builds-4hr cannot cover it.

If we look all endtime values on a day and we print the minimum and maximum values, this is what we get:

1424649600 Mon, 23 Feb 2015 00:00:00  () Sun, 22 Feb 2015 16:00:00 -0800 (PST)
1424736000 Tue, 24 Feb 2015 00:00:00  () Mon, 23 Feb 2015 16:00:00 -0800 (PST)

This means that since 4pm to midnight we generate the same file again and again without adding any new data.