Closed Bug 1059028 Opened 10 years ago Closed 10 years ago

[titanic] Update field datefinished when status=='done'

Categories

(Testing :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gakiwate, Assigned: harshjha2006, Mentored)

References

Details

(Whiteboard: [good first bug][lang=python])

Attachments

(1 file, 2 obsolete files)

Titanic (https://github.com/gakiwate/titanic/) is a tool to bisect test failures. Titanic takes revision under investigation - which can be supplied to it using the APIs or command line and then works by pulling data about the revision and revisions before it from TBPL(https://tbpl.mozilla.org/) to bisect the failure. Titanic, currently has a WebUI that can be used to submit jobs. The server is run using Flask. The code resides in server.py here. https://github.com/gakiwate/titanic/blob/master/server.py We use the function run_updatestatus_data ( https://github.com/gakiwate/titanic/blob/master/server.py#L128 ) to update the status of the data. However, when the status is set to done; currently we do not update the datefinished field. We'd like to update the datefinished field when we update the status as done so as to be able to keep track of the times needed and other such information.
Working on it. Hi Gautam, how should I submit the fix? Should I raise a pull request and add you as a reviewer for that, or I should submit the fix as a patch? Thanks!
Assignee: nobody → harshjha2006
Flags: needinfo?(gautam.akiwate)
Hi Gautam, Please also let me know how to run tests after making the fix? Thanks!
Hi Harsh, You can send me a pull request on Github! Alternatively, you can submit a patch here as well. So the way to test it would be 1. Fire up the server.py script 2. Add an entry using the WebUI. (You can use the values from the example given in the README) 3. Manually update the status to done. (You can do this using something similar to the updateStatus function in backfill.py) 4. Check if the datefinished has been updated. (For this you might need to add another function which displays jobs which are done) Let me know if you face any issues. You can post your questions here on the BUG or on IRC on channel #ateam Looking forward to see your pull request/patch! :)
Flags: needinfo?(gautam.akiwate)
Hi Gautam, I need your help here. I queued a job from Web UI and it looks as follows - {"jobs": [{"status": "new", "analyzerevs": null, "dateadded": "2014-08-27T16:45:05", "buildername": "Windows XP 32-bit mozilla-inbound pgo talos svgr", "buildrevs": null, "branch": "mozilla-inbound", "datefinished": null, "id": 1, "revision": ""}]} Now, I started a Python shell and did - import backfill backfill.updateStatus(1, "done") Now, when I see the job from Web UI, its status is still "new". What am I doing wrong here? Thanks, Harsh
If you look at the code. The code treats the id as a string. So try this. backfill.updateStatus('1', "done")
Attached patch Patch for the bug (obsolete) (deleted) — Splinter Review
Attachment #8480940 - Flags: review?(gautam.akiwate)
Comment on attachment 8480940 [details] [diff] [review] Patch for the bug Review of attachment 8480940 [details] [diff] [review]: ----------------------------------------------------------------- ::: server.py.orig @@ +127,5 @@ > @json_response > def run_updatestatus_data(): > data = request.get_json() > + ts = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S") > + sql = """update jobs set status='%s', datefinished='%s' where id=%s;""" % (data['status'], ts, data['id']) This code will update the datefinished no matter what the status is. The datefinsihed shouldn't be updated for example when I update the status to "building" or "running". One way to fix it would be to have a conditional check around it and use the update condition appropriately.
Attachment #8480940 - Flags: review?(gautam.akiwate) → review-
Attached file Patch for the bug (updated) (obsolete) (deleted) —
Attachment #8480958 - Flags: review?(gautam.akiwate)
Attached patch datefinished-patch (deleted) — Splinter Review
Attachment #8480940 - Attachment is obsolete: true
Attachment #8480958 - Attachment is obsolete: true
Attachment #8480958 - Flags: review?(gautam.akiwate)
Attachment #8480987 - Flags: review?(gautam.akiwate)
Comment on attachment 8480987 [details] [diff] [review] datefinished-patch Review of attachment 8480987 [details] [diff] [review]: ----------------------------------------------------------------- The patch looks good! :) Can you submit a patch using the 'git format-patch' command that way it will have your name on it. Also, make sure that the patch is created on server.py and server.py.orig.
Attachment #8480987 - Flags: review?(gautam.akiwate) → review+
Congrats on solving the BUG Harsh! Excellent work! :) https://github.com/gakiwate/titanic/pull/7 Also, if it would great if you could update the README regardging clarifications for the server IPs in backfill and also when or when not to use Apache config.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Blocks: 1060551
No longer blocks: 1044200
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: