Changeset 263267 in webkit
- Timestamp:
- Jun 19, 2020, 8:31:10 AM (5 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/ews-build/steps.py
r262379 r263267 679 679 contributors = {} 680 680 681 def load_contributors(self): 681 def load_contributors_from_disk(self): 682 cwd = os.path.abspath(os.path.dirname(__file__)) 683 tools_dir_path = os.path.dirname(os.path.dirname(cwd)) 684 contributors_path = os.path.join(tools_dir_path, 'Scripts/webkitpy/common/config/contributors.json') 685 try: 686 return json.load(open(contributors_path)) 687 except Exception as e: 688 self._addToLog('stdio', 'Failed to load {}\n'.format(contributors_path)) 689 return {} 690 691 def load_contributors_from_trac(self): 682 692 try: 683 693 response = requests.get(self.url_text) … … 685 695 self._addToLog('stdio', 'Failed to access {} with status code: {}\n'.format(self.url_text, response.status_code)) 686 696 return {} 697 return response.json() 687 698 except Exception as e: 688 699 self._addToLog('stdio', 'Failed to access {url}\n'.format(url=self.url_text)) 689 700 return {} 690 701 691 contributors_json = response.json() 702 def load_contributors(self): 703 contributors_json = self.load_contributors_from_trac() 704 if not contributors_json: 705 contributors_json = self.load_contributors_from_disk() 706 692 707 contributors = {} 693 708 for key, value in contributors_json.iteritems(): -
trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py
r262379 r263267 25 25 import os 26 26 import shutil 27 import sys 27 28 import tempfile 28 29 … … 3426 3427 return self.runStep() 3427 3428 3429 def test_load_contributors_from_disk(self): 3430 ValidateCommiterAndReviewer._addToLog = lambda cls, logtype, log: sys.stdout.write(log) 3431 contributors = ValidateCommiterAndReviewer().load_contributors_from_disk() 3432 self.assertEqual(contributors['Aakash Jain']['nicks'], ['aakash_jain']) 3433 3428 3434 3429 3435 class TestCheckPatchStatusOnEWSQueues(BuildStepMixinAdditions, unittest.TestCase): -
trunk/Tools/ChangeLog
r263263 r263267 1 2020-06-19 Aakash Jain <aakash_jain@apple.com> 2 3 Improve handling of trac downtime by commit-queue 4 https://bugs.webkit.org/show_bug.cgi?id=213377 5 6 Reviewed by Jonathan Bedard. 7 8 * BuildSlaveSupport/ews-build/steps.py: Load contributors.json from disk when loading from trac fails. 9 (ValidateCommiterAndReviewer.load_contributors_from_disk): 10 (ValidateCommiterAndReviewer.load_contributors_from_trac): 11 (ValidateCommiterAndReviewer.load_contributors): 12 * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-test 13 1 14 2020-06-19 Lauro Moura <lmoura@igalia.com> 2 15
Note:
See TracChangeset
for help on using the changeset viewer.