Merge lp:~pfalcon/linaro-android-frontend/lava-requests-fixes2 into lp:linaro-android-frontend

Proposed by Paul Sokolovsky
Status: Merged
Approved by: James Tunnicliffe
Approved revision: 245
Merged at revision: 245
Proposed branch: lp:~pfalcon/linaro-android-frontend/lava-requests-fixes2
Merge into: lp:linaro-android-frontend
Diff against target: 51 lines (+0/-31)
1 file modified
static/buildDetails.js (+0/-31)
To merge this branch: bzr merge lp:~pfalcon/linaro-android-frontend/lava-requests-fixes2
Reviewer Review Type Date Requested Status
James Tunnicliffe Pending
Review via email: mp+88532@code.launchpad.net

Description of the change

This fixes case of clicking 2 builds w/o reloading the page - 2nd and other builds would still show stuck "Loading..." due to static var assignment.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'static/buildDetails.js'
--- static/buildDetails.js 2012-01-13 16:18:29 +0000
+++ static/buildDetails.js 2012-01-13 17:07:28 +0000
@@ -95,17 +95,6 @@
95 }95 }
9696
97 function receivedLavaJobInfo (e, response) {97 function receivedLavaJobInfo (e, response) {
98 if (typeof receivedLavaJobInfo.got_info != "undefined")
99 {
100 // Don't pass through a second job info. Assumption is that they are the same
101 // so it doesn't matter if we find several and they are just duplicates. This
102 // happened around 12-2011 when we started to migrate build outputs to
103 // snapshots.linaro.org.
104 return;
105 }
106
107 receivedLavaJobInfo.got_info = true;
108
109 var job_info = Y.JSON.parse(response.responseText);98 var job_info = Y.JSON.parse(response.responseText);
110 if (typeof job_info.lava_url == "undefined") {99 if (typeof job_info.lava_url == "undefined") {
111 Y.one("#testresults").setContent("This build did not undergo LAVA testing.");100 Y.one("#testresults").setContent("This build did not undergo LAVA testing.");
@@ -168,29 +157,9 @@
168 },157 },
169 testresults: function (results) {158 testresults: function (results) {
170159
171 /* The build result can exist in one of two locations depending
172 on how old the test result is. We create both URLs and fire
173 off fetches to both locations. The one that works will be
174 used to display the results.
175 */
176 var old_style_url = results.buildUrl + '/artifact/build/out/lava-job-info';
177
178 /* Check URL. If it points to snapshot.linaro.org, proxy it through
179 the master, which doesn't get stopped to ask to accept a license. */
180 if (old_style_url.match(/https:\/\/snapshots.linaro.org\//))
181 {
182 old_style_url = '/api/get-lava-job-info?url=' + old_style_url
183 }
184
185 var new_style_url = '/api/get-lava-job-info?url=http://snapshots.linaro.org/android/'160 var new_style_url = '/api/get-lava-job-info?url=http://snapshots.linaro.org/android/'
186 + rawBuildName + '/' + results.number.toString() + '/lava-job-info';161 + rawBuildName + '/' + results.number.toString() + '/lava-job-info';
187162
188 // Try both locations. File should exist only in one location...
189/* Y.io(
190 old_style_url,
191 {
192 on: { success: receivedLavaJobInfo }
193 });*/
194 Y.io(163 Y.io(
195 new_style_url,164 new_style_url,
196 {165 {

Subscribers

People subscribed via source and target branches