Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/extensions/bin/createNightlies.py

Issue 29538644: Issue 5642 - Fix Windows Store devbuild upload routine (Closed)
Patch Set: Created Sept. 7, 2017, 11:02 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # This file is part of the Adblock Plus web scripts, 1 # This file is part of the Adblock Plus web scripts,
2 # Copyright (C) 2006-present eyeo GmbH 2 # Copyright (C) 2006-present eyeo GmbH
3 # 3 #
4 # Adblock Plus is free software: you can redistribute it and/or modify 4 # Adblock Plus is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 3 as 5 # it under the terms of the GNU General Public License version 3 as
6 # published by the Free Software Foundation. 6 # published by the Free Software Foundation.
7 # 7 #
8 # Adblock Plus is distributed in the hope that it will be useful, 8 # Adblock Plus is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 # Create submission 611 # Create submission
612 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/create-an-app-su bmission 612 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/create-an-app-su bmission
613 request = urllib2.Request(submissions_path, '', headers) 613 request = urllib2.Request(submissions_path, '', headers)
614 request.get_method = lambda: 'POST' 614 request.get_method = lambda: 'POST'
615 with contextlib.closing(opener.open(request)) as response: 615 with contextlib.closing(opener.open(request)) as response:
616 submission = json.load(response) 616 submission = json.load(response)
617 617
618 submission_id = submission['id'] 618 submission_id = submission['id']
619 file_upload_url = submission['fileUploadUrl'] 619 file_upload_url = submission['fileUploadUrl']
620 620
Oleksandr 2017/09/07 23:09:26 NOTE: This code was part of the original review, b
621 # Update submission
622 old_submission = submission['applicationPackages'][0]
623 old_submission['fileStatus'] = 'PendingDelete'
624 submission['applicationPackages'].append(
625 {'fileStatus': 'PendingUpload'})
Sebastian Noack 2017/09/08 00:15:55 Please put closing parenthesis on a new line that
626 added_submission = submission['applicationPackages'][1]
627 added_submission['fileName'] = os.path.basename(self.path)
628 old_min_sys_ram = old_submission['minimumSystemRam']
Sebastian Noack 2017/09/08 00:15:55 It seems to be possible to avoid the temporary var
shoniko 2017/09/08 11:12:33 I was pretty sure I have tested minimal set of cha
629 added_submission['minimumSystemRam'] = old_min_sys_ram
630 old_directx_version = old_submission['minimumDirectXVersion']
631 added_submission['minimumDirectXVersion'] = old_directx_version
632
621 new_submission_path = '{}/{}'.format(submissions_path, 633 new_submission_path = '{}/{}'.format(submissions_path,
622 submission_id) 634 submission_id)
635 new_submission = json.dumps(submission)
623 636
624 request = urllib2.Request(new_submission_path, None, headers) 637 request = urllib2.Request(new_submission_path, new_submission, headers)
638 request.get_method = lambda: 'PUT'
625 opener.open(request).close() 639 opener.open(request).close()
626 640
627 self.upload_appx_file_to_windows_store(file_upload_url) 641 self.upload_appx_file_to_windows_store(file_upload_url)
628 642
629 # Commit submission 643 # Commit submission
630 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/commit-an-app-su bmission 644 # https://msdn.microsoft.com/en-us/windows/uwp/monetize/commit-an-app-su bmission
631 commit_path = '{}/commit'.format(new_submission_path) 645 commit_path = '{}/commit'.format(new_submission_path)
632 request = urllib2.Request(commit_path, '', headers) 646 request = urllib2.Request(commit_path, '', headers)
633 request.get_method = lambda: 'POST' 647 request.get_method = lambda: 'POST'
634 with contextlib.closing(opener.open(request)) as response: 648 with contextlib.closing(opener.open(request)) as response:
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 except Exception as ex: 738 except Exception as ex:
725 logging.error('The build for %s failed:', repo) 739 logging.error('The build for %s failed:', repo)
726 logging.exception(ex) 740 logging.exception(ex)
727 741
728 file = open(nightlyConfigFile, 'wb') 742 file = open(nightlyConfigFile, 'wb')
729 nightlyConfig.write(file) 743 nightlyConfig.write(file)
730 744
731 745
732 if __name__ == '__main__': 746 if __name__ == '__main__':
733 main() 747 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld