-
Notifications
You must be signed in to change notification settings - Fork 87
tooltool.py client uploading is broken #2272
Description
Few issues:
I think our docs are very out of date for uploading. They still talk about tooltool tokens which do not exist anymore: https://wiki.mozilla.org/ReleaseEngineering/Applications/Tooltool#How_To_Upload_To_Tooltool
Next, I poked the client and saw that we did add support for accepting tc creds if the format was in json: https://github.com/mozilla/release-services/blob/master/src/tooltool/client/tooltool.py#L1019
So I tried this with after running add:
python2.7 tooltool.py upload --authentication-file=~/.tc_config.json --message "Bug 1589242 - Please upload Tesseract 4.0 zip to tooltool"
but, at least with python3, there seem to be a few bugs:
λ python tooltool.py upload --authentication-file=~/.tc_config.json --message "Bug 1589242 - Please upload Tesseract 4.0 zip to tooltool"
Traceback (most recent call last):
File "tooltool.py", line 1378, in <module>
sys.exit(main(sys.argv))
File "tooltool.py", line 1374, in main
return 0 if process_command(options, args) else 1
File "tooltool.py", line 1260, in process_command
options.get('region'))
File "tooltool.py", line 1137, in upload
resp = _send_batch(base_urls[0], auth_file, batch, region)
File "tooltool.py", line 1042, in _send_batch
_authorize(req, auth_file)
File "tooltool.py", line 1025, in _authorize
taskcluster_header = make_taskcluster_header(auth_file_content, req)
File "tooltool.py", line 297, in make_taskcluster_header
req.get_data(),
AttributeError: 'Request' object has no attribute 'get_data'
urllib dropped support for [get_data()](https://github.com/mozilla/release-services/blob/master/src/tooltool/client/tooltool.py#L297) so I tried with direct: data attr. Then I hit:
λ python tooltool.py upload --authentication-file=~/.tc_config.json --message "Bug 1589242 - Please upload Tesseract 4.0 zip to tooltool"
Traceback (most recent call last):
File "tooltool.py", line 1378, in <module>
sys.exit(main(sys.argv))
File "tooltool.py", line 1374, in main
return 0 if process_command(options, args) else 1
File "tooltool.py", line 1260, in process_command
options.get('region'))
File "tooltool.py", line 1137, in upload
resp = _send_batch(base_urls[0], auth_file, batch, region)
File "tooltool.py", line 1042, in _send_batch
_authorize(req, auth_file)
File "tooltool.py", line 1025, in _authorize
taskcluster_header = make_taskcluster_header(auth_file_content, req)
File "tooltool.py", line 299, in make_taskcluster_header
content_type='application/json',
File "tooltool.py", line 201, in calculate_payload_hash
p_hash.update(''.join(parts))
TypeError: sequence item 0: expected str instance, bytes found
For fear of going down the encoding py 2/3 rabbit hole, I'll pause here in case rok tested this elsewhere or has a better solution. I'm currently installing python2 to see if that works as the client suggests it supports both 2 and 3.
@garbas - any ideas?