iron-io / issues

For Iron.io services issue tracking. Public facing issue tracking for behind the scenes issues.
5 stars 0 forks source link

successful /projects/{Project ID}/codes [POST] doesnt always create a new revision #72

Open drmaples opened 11 years ago

drmaples commented 11 years ago

It seems when uploading a new code package containing a zipfile with the same checksum as the last revision that a new revision will not be created. Tweaking something so the checksum is different and uploading again will create a new revision.

This behavior seems ok, but it is a little misleading that the response is always http 200 and {"msg": "Upload successful.", "id": "...."} even though a new revision was not created.

I expected one of the following:

start revision: 8
[DEV] task_scheduler-dev.zip@scheduled/task_scheduler/main.py => task_scheduler (3.59MB)
>>>>>>>>>>MD5: 37ad1c43d73aec8897d84ab1c35dfa87
url: https://worker-aws-us-east-1.iron.io/2/projects/4fbbee7a68a0190f6f002d13/codes?oauth=XXXXXXXX
resp code: 200
resp headers: {'date': 'Wed, 08 May 2013 23:10:23 GMT', 'content-length': '60', 'content-type': 'application/json', 'connection': 'keep-alive'}
{u'msg': u'Upload successful.', u'id': u'5187080cca2a0566902def16'}
end revision: 9

start revision: 9
[DEV] task_scheduler-dev.zip@scheduled/task_scheduler/main.py => task_scheduler (3.59MB)
>>>>>>>>>>MD5: d2c02ad793894c1dae80cef7664dcfa0
url: https://worker-aws-us-east-1.iron.io/2/projects/4fbbee7a68a0190f6f002d13/codes?oauth=XXXXXXXX
resp code: 200
resp headers: {'date': 'Wed, 08 May 2013 23:12:21 GMT', 'content-length': '60', 'content-type': 'application/json', 'connection': 'keep-alive'}
{u'msg': u'Upload successful.', u'id': u'5187080cca2a0566902def16'}
end revision: 10

start revision: 10
[DEV] task_scheduler-dev.zip@scheduled/task_scheduler/main.py => task_scheduler (3.59MB)
>>>>>>>>>>MD5: d2c02ad793894c1dae80cef7664dcfa0
url: https://worker-aws-us-east-1.iron.io/2/projects/4fbbee7a68a0190f6f002d13/codes?oauth=XXXXXXXX
resp code: 200
resp headers: {'date': 'Wed, 08 May 2013 23:30:56 GMT', 'content-length': '60', 'content-type': 'application/json', 'connection': 'keep-alive'}
{u'msg': u'Upload successful.', u'id': u'5187080cca2a0566902def16'}
end revision: 10
carimura commented 11 years ago

In my experience the CLI creates a new revision every time - but that's probably because while packaging the files the checksum changes.

Sounds like you are programmatically uploading the code package so that might be the case.

To me your feedback on API response is valid and we should indicate when revision isn't updated (especially since concurrency/timeout/etc settings might be intentionally changed)

@iced can you confirm that a new revision is not being created on same checksum code packages?

Chad

treeder commented 11 years ago

@drmaples I see what's going on now and you are correct, it won't accept new code with the same checksum. You're right that the response should be different, thanks for letting us know.