Bug 8054

Summary: libtoaster build AJAX POST request returns HTML instead of JSON
Product: [Build System, Metadata & Runtime] Toaster Reporter: Alexandru Damian <alexandru.damian>
Component: toasterAssignee: Elliot Smith <elliot.smith>
Status: VERIFIED OBSOLETE QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: Medium CC: alexandru.damian, belen.barros.pena, bogdanx.a.voiculescu, cristiana.voicu, jessica.zhang
Version: 1.9   
Target Milestone: 1.9   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Alexandru Damian 2015-07-27 13:44:27 UTC
The libtoaster build post request needs to get JSON data instead of the HTML, but the POST to build/ issues a redirect to a GET that returns HTML.

The AJAX calls need to specify "format=json" URL parameter as to make sure that the data is returned in a format that is understood by the javascript code.
Comment 1 Alexandru Damian 2015-07-27 13:45:25 UTC
Patch submitted for review:

https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=adamian/20150727_bug_fixes_review
Comment 2 Elliot Smith 2015-09-02 10:34:16 UTC
I don't think this patch or bug are relevant any more, as the button for starting a build ignores the return value anyway. It doesn't make any difference if you change the parameter to "format=json" or not.

I suggest closing this (though I'm not sure what status to assign; "RESOLVED"?).

However, there are parts of the original branch (adamian/20150727_bug_fixes_review) which don't relate to this bug, which I've separated into two other branches:

1. elliot/submit/adamian/hide_builds-8236 - This hides "in progress" builds on the "all builds" and "project builds" pages; I'll submit it separately.

2. elliot/toaster/alex-leftovers - Bits and pieces of refactoring and lint cleanup. I think we should raise separate issues for this kind of work, rather than mixing it into a branch which fixes bugs. I will just park this for now, as I'm not sure how valuable it is.
Comment 3 Elliot Smith 2015-09-02 11:00:05 UTC
The part of the branch which fixes this bug (isolated in elliot/submit/adamian/json_post-8054) has no effect on behaviour. Closing this bug as a consequence.
Comment 4 Alexandru Roman 2015-09-03 10:46:07 UTC
Verified