| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """URL endpoint containing server-side functionality for bisect try jobs.""" | 5 """URL endpoint containing server-side functionality for bisect try jobs.""" |
| 6 | 6 |
| 7 import difflib | 7 import difflib |
| 8 import hashlib | 8 import hashlib |
| 9 import json | 9 import json |
| 10 import logging | 10 import logging |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 if not bisect_job.key: | 617 if not bisect_job.key: |
| 618 bisect_job.put() | 618 bisect_job.put() |
| 619 | 619 |
| 620 if bisect_job.use_buildbucket: | 620 if bisect_job.use_buildbucket: |
| 621 result = _PerformBuildbucketBisect(bisect_job) | 621 result = _PerformBuildbucketBisect(bisect_job) |
| 622 else: | 622 else: |
| 623 result = _PerformLegacyBisect(bisect_job) | 623 result = _PerformLegacyBisect(bisect_job) |
| 624 if 'error' in result: | 624 if 'error' in result: |
| 625 bisect_job.run_count += 1 | 625 bisect_job.run_count += 1 |
| 626 bisect_job.SetFailed() | 626 bisect_job.SetFailed() |
| 627 comment = 'Bisect job failed to kick off' |
| 628 elif result.get('issue_url'): |
| 629 comment = 'Started bisect job %s' % result['issue_url'] |
| 630 else: |
| 631 comment = 'Started bisect job: %s' % result |
| 632 if bisect_job.bug_id: |
| 633 issue_tracker = issue_tracker_service.IssueTrackerService( |
| 634 additional_credentials=utils.ServiceAccountCredentials()) |
| 635 issue_tracker.AddBugComment(bisect_job.bug_id, comment, send_email=False) |
| 627 return result | 636 return result |
| 628 | 637 |
| 629 | 638 |
| 630 def _PerformLegacyBisect(bisect_job): | 639 def _PerformLegacyBisect(bisect_job): |
| 631 bot = bisect_job.bot | 640 bot = bisect_job.bot |
| 632 email = bisect_job.email | 641 email = bisect_job.email |
| 633 bug_id = bisect_job.bug_id | 642 bug_id = bisect_job.bug_id |
| 634 | 643 |
| 635 config_dict = bisect_job.GetConfigDict() | 644 config_dict = bisect_job.GetConfigDict() |
| 636 config_dict['try_job_id'] = bisect_job.key.id() | 645 config_dict['try_job_id'] = bisect_job.key.id() |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 | 877 |
| 869 def _GetTryServerBucket(bisect_job): | 878 def _GetTryServerBucket(bisect_job): |
| 870 """Returns the bucket name to be used by buildbucket.""" | 879 """Returns the bucket name to be used by buildbucket.""" |
| 871 master_bucket_map = namespaced_stored_object.Get(_MASTER_BUILDBUCKET_MAP_KEY) | 880 master_bucket_map = namespaced_stored_object.Get(_MASTER_BUILDBUCKET_MAP_KEY) |
| 872 default = 'master.tryserver.chromium.perf' | 881 default = 'master.tryserver.chromium.perf' |
| 873 if not master_bucket_map: | 882 if not master_bucket_map: |
| 874 logging.warning( | 883 logging.warning( |
| 875 'Could not get bucket to be used by buildbucket, using default.') | 884 'Could not get bucket to be used by buildbucket, using default.') |
| 876 return default | 885 return default |
| 877 return master_bucket_map.get(bisect_job.master_name, default) | 886 return master_bucket_map.get(bisect_job.master_name, default) |
| OLD | NEW |