Autoland should check job status using Treeherder

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
4 years ago
6 months ago

People

(Reporter: dminor, Assigned: dminor)

Tracking

Details

Attachments

(1 obsolete attachment)

(Assignee)

Description

4 years ago
At the moment the code in Autoland to monitor jobs relies upon the buildapi. We should switch to Treeherder so we have access to job status from non-buildbot jobs.
Treeherder gets its information from Treestatus, so presumably you should be using that.
(Assignee)

Comment 2

4 years ago
(In reply to Ryan VanderMeulen [:RyanVM UTC-4] from comment #1)
> Treeherder gets its information from Treestatus, so presumably you should be
> using that.

We want to ignore failures in jobs that are hidden on Treeherder when deciding whether to land something. As far as I know, Treeherder is the only source of information on what jobs are hidden, so we need to use it.
Sorry, ignore me. I read this bug as tree status rather than job status.
(Assignee)

Comment 4

4 years ago
Created attachment 8623649 [details]
MozReview Request: autoland: add code for interacting with treeherder (bug 1174124) r?mdoglio

autoland: add code for interacting with treeherder (bug 1174124) r?mdoglio

This adds some code for retrieving a resultset and determining whether or not
all jobs have completed and if the revision can be landed.
Attachment #8623649 - Flags: review?(mdoglio)
(Assignee)

Updated

4 years ago
Assignee: nobody → dminor
Status: NEW → ASSIGNED
Comment on attachment 8623649 [details]
MozReview Request: autoland: add code for interacting with treeherder (bug 1174124) r?mdoglio

https://reviewboard.mozilla.org/r/11577/#review10083

::: autoland/autoland/treeherder.py:80
(Diff revision 1)
> +            job_name = result[names['job_type_name']]

If you need an identifier for a particular class of jobs you can use the signature. This is a hash of all the properties of a job as listed [here](https://github.com/mozilla/treeherder/blob/bd8836e7e43f8d3ba1d5266c17fa03c9784cf77b/treeherder/model/sql/template_schema/treeherder_reference_1.sql.tmpl#L50-L62)

::: autoland/autoland/treeherder.py:20
(Diff revision 1)
> +    url = '%s/project/%s/jobs?return_type=list&count=%s&result_set_id=%s' % (
> +          TREEHERDER_URL, repo, COUNT, result_set_id)
> +    r = requests.get(url)
> +    if r.status_code == 200:
> +        try:
> +            return r.json()
> +        except KeyError:
> +            pass

Please note that you are retrieving a single page of jobs. You should add some logic to retrieve the next page until there are results.

::: autoland/autoland/treeherder.py:20
(Diff revision 1)
> +    url = '%s/project/%s/jobs?return_type=list&count=%s&result_set_id=%s' % (
> +          TREEHERDER_URL, repo, COUNT, result_set_id)

Using the data parameter of requests.get would make this more readable imho
Attachment #8623649 - Flags: review?(mdoglio)
Comment on attachment 8623649 [details]
MozReview Request: autoland: add code for interacting with treeherder (bug 1174124) r?mdoglio

https://reviewboard.mozilla.org/r/11577/#review10085

Ship It!
Attachment #8623649 - Flags: review+
(Assignee)

Comment 7

4 years ago
We have no immediate requirement for Autoland to check job status for autolanding to inbound, so I'm going to WONTFIX this.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX
(Assignee)

Updated

4 years ago
Attachment #8623649 - Attachment is obsolete: true
Product: Tree Management → MozReview

Updated

6 months ago
Product: MozReview → Conduit
You need to log in before you can comment on or make changes to this bug.