catapult-project / catapult

Deprecated Catapult GitHub. Please instead use http://crbug.com "Speed>Benchmarks" component for bugs and https://chromium.googlesource.com/catapult for downloading and editing source code..
https://chromium.googlesource.com/catapult
BSD 3-Clause "New" or "Revised" License
1.92k stars 564 forks source link

Anomaly's pinpoint_bisects list doesn't ever seem to be set. #4450

Closed anniesullie closed 6 years ago

anniesullie commented 6 years ago

I'm working on generating action items for sheriffs based on bisect statuses. My plan is to get the list of bisects from the open bugs. Sample code:

from dashboard.common import utils
from dashboard.models import anomaly
from dashboard.services import issue_tracker_service

from google.appengine.ext import ndb

# Query for all open bugs with sheriff label.
issue_tracker = issue_tracker_service.IssueTrackerService(
    utils.ServiceAccountHttp())
bugs = issue_tracker.List(
    can='open',
    q='Performance=Sheriff',
    maxResults=1000)['items']
bug_ids = [bug['id'] for bug in bugs]

# For each bug, query to get all alerts associated with it.
futures = []
bisects = []
for bug_id in bug_ids:
  futures.append(anomaly.Anomaly.query(anomaly.Anomaly.bug_id == bug_id).fetch_async())
while futures:
  future = ndb.Future.wait_any(futures)
  futures.remove(future)
  alerts = future.get_result()
  for alert in alerts:
    bisects = bisects + alert.pinpoint_bisects
print bisects

This finds 420 bugs, and all the associated alerts, but all the pinpoint_bisects lists on the alerts are empty, and the last line prints out [].

Then I went to check a specific bug (crbug.com/843272), and pulled out the alert that was bisected:

from google.appengine.ext import ndb

id = 'agxzfmNocm9tZXBlcmZyFAsSB0Fub21hbHkYgICQwdPjrQsM'

alert = ndb.Key(urlsafe=id).get()
print alert.pinpoint_bisects

Again, no pinpoint_bisects saved for the alerts. Any ideas?

@simonhatch @dave-2

simonhatch commented 6 years ago

Hmm looking at the code, I think that we might only be saving it for manually started jobs (pinpoint_request.py around line 50 or so). I don't see any indication that it's saved for automatically started jobs though. I think we have the alerts in /file_bug but it's not plumbed through.

anniesullie commented 6 years ago

Thanks, CL: https://chromium-review.googlesource.com/#/c/catapult/+/1060295

anniesullie commented 6 years ago

Same code yields several bisects now!