Fix GN auto-roller to handle results from buildbucket-initiated jobs.

It looks like we can get returned a try job state value of -1 now
when the try jobs are run through buildbucket instead of rietveld,
so this change updates the status mapping accordingly.

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1336713002

Cr-Original-Commit-Position: refs/heads/master@{#348266}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 84ffc7ef400da2351d559211bcdeeba20634df54
diff --git a/tools/gn/bin/roll_gn.py b/tools/gn/bin/roll_gn.py
index d71e209..59a240f 100644
--- a/tools/gn/bin/roll_gn.py
+++ b/tools/gn/bin/roll_gn.py
@@ -210,8 +210,6 @@
     except Exception as _e:
       raise
 
-    TRY_JOB_RESULT_STATES = ('success', 'warnings', 'failure', 'skipped',
-                             'exception', 'retry', 'pending')
     try_job_results = patchset_data['try_job_results']
     if not try_job_results:
       print('No try jobs found on most recent patchset')
@@ -230,7 +228,9 @@
         print('Unexpected builder: %s')
         continue
 
-      state = TRY_JOB_RESULT_STATES[int(job['result'])]
+      TRY_JOB_RESULT_STATES = ('started', 'success', 'warnings', 'failure',
+                               'skipped', 'exception', 'retry', 'pending')
+      state = TRY_JOB_RESULT_STATES[int(job['result']) + 1]
       url_str = ' %s' % job['url']
       build = url_str.split('/')[-1]