Closed
Bug 611373
Opened 14 years ago
Closed 14 years ago
Expose tree-status through a separate uri
Categories
(Webtools Graveyard :: Tinderbox, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: Ms2ger)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bear
:
review+
|
Details | Diff | Splinter Review |
Both tinderboxpushlog and the mercurial commit-hook needs to get the status of a particular tree. Currently this is currently only doable by either downloading
http://tinderbox.mozilla.org/Firefox/
or
http://tinderbox.mozilla.org/admintree.cgi?tree=Firefox
The former is a gigantic 2MB file, the latter is a extremely slow loading, and still quite large 200kB file.
It would be great if the status could be accessed separately through a dedicated url. It's quite possible that this uri will be hit a lot, so it might make sense to cache it in a static file or some such, but that might not be worth doing for now.
Another important part is that the uri must server a Access-Control-Allow-Origin:* header so that it can be loaded by tbpl client side.
For simplicity, I would say that no particular format is needed. Simply send the contents of the status textarea as it appears on admintree.cgi.
Reporter | ||
Comment 1•14 years ago
|
||
Reed points out that we already have
http://tinderbox.mozilla.org/Firefox/status.pl
But which isn't accessible to everyone at the moment (and probably doesn't send the Access-Control-Allow-Origin:* header)
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&quickparse=1 doesn't do what you want?
Comment 3•14 years ago
|
||
No - "status" as in tb_load_status(), the contents of the "Status message" textarea in admintree.
Assignee | ||
Comment 4•14 years ago
|
||
Something like this, perhaps?
Comment 5•14 years ago
|
||
Comment on attachment 490114 [details] [diff] [review]
Patch v1
That will add a new endpoint to just return that item. I can imagine this will get a lot of calls so we should ask IT to add it to the tinderbox cache setup they have for slow changing endpoints.
Asking rhelmer for a sanity check - simple tinderbox perl changes always make me worry
Attachment #490114 -
Flags: review?(robert)
Attachment #490114 -
Flags: review?(bear)
Attachment #490114 -
Flags: review+
Comment 6•14 years ago
|
||
Doesn't the caching come from including it in http://mxr.mozilla.org/mozilla/source/webtools/tinderbox/showbuilds.pl#83 so that when anything changes, a static /Treename/status.html file will get regenerated?
Updated•14 years ago
|
Attachment #490114 -
Flags: review?(robert) → review+
Comment 7•14 years ago
|
||
(In reply to comment #6)
> Doesn't the caching come from including it in
> http://mxr.mozilla.org/mozilla/source/webtools/tinderbox/showbuilds.pl#83 so
> that when anything changes, a static /Treename/status.html file will get
> regenerated?
Yes I believe that is how it works.
I don't have a tinderbox server test environment set up right now, but patch looks good to me. Let's get it on tinderbox-stage :)
Reporter | ||
Comment 8•14 years ago
|
||
So should an entry be added to @pages to get a static page generated? The patch currently doesn't do that.
Comment 9•14 years ago
|
||
(In reply to comment #8)
> So should an entry be added to @pages to get a static page generated? The patch
> currently doesn't do that.
Thanks, you're right; I shouldn't be reviewing this late.
Comment 10•14 years ago
|
||
Comment on attachment 490114 [details] [diff] [review]
Patch v1
Please add a section to the @pages array, per comment 6. Something like this should do it:
['status.html', 'status'],
Thanks phil/jonas for catching this.
Attachment #490114 -
Flags: review+ → review-
Comment 11•14 years ago
|
||
Comment on attachment 490114 [details] [diff] [review]
Patch v1
>Index: showbuilds.pl
>===================================================================
>RCS file: /cvsroot/mozilla/webtools/tinderbox/showbuilds.pl,v
>retrieving revision 1.44
(...)
>+sub do_status($) {
>+ my ($form_ref) = (@_);
>+ if (!$form_ref->{static}) {
>+ print "Content-Type: text/html; charset=utf-8\n";
>+ print "Access-Control-Allow-Origin: *\n\n";
>+ }
One thing missing here - $tree is not defined. You can get it using:
my $tree = $form_ref->{tree};
>+ my $status_message = &tb_load_status($tree);
>+ $status_message =~ s:^\s*|\s*$::gs;
>+ if ($status_message and length($status_message) gt 0) {
>+ print "$status_message";
>+ }
>+}
Comment 12•14 years ago
|
||
(In reply to comment #10)
> Comment on attachment 490114 [details] [diff] [review]
> Patch v1
>
> Please add a section to the @pages array, per comment 6. Something like this
> should do it:
>
> ['status.html', 'status'],
Actually should be:
['status.html', 'do_status'],
I've tested this change plus the fix in comment 6 in a local tinderbox instance and it seems to work as expected.
Ms2ger can you please generate a new patch and r? bear, you have r+ from me with the changes above.
I can retest and land it in CVS if you guys need, just let me know.
Assignee | ||
Comment 13•14 years ago
|
||
Done, thanks!
Attachment #490114 -
Attachment is obsolete: true
Attachment #490372 -
Flags: review?(bear)
Updated•14 years ago
|
Attachment #490372 -
Flags: review?(bear) → review+
Comment 14•14 years ago
|
||
Tested this patch on my local tinderbox, seems to work as expected. After changing the status message on the admin page, I get a status.html and "status=1" param to showbuilds.cgi works as well (tried updating the message a few times).
I see this header in the CGI output:
Access-Control-Allow-Origin: *
You may need IT to set this header for the status.html file in the Apache config on stage and prod. The below WFM in Apache 2 with the "headers" module loaded, and inside an appropriate Location directive:
Header set Access-Control-Allow-Origin "*"
I think this patch should be landed, and a followup bug should be filed for IT to update tinderbox-stage (like bug 601010) and set the above header. I don't have time to do either of these right now, but I can help with this early next week if no one else is able to sooner.
Comment 15•14 years ago
|
||
Checking in showbuilds.cgi;
/cvsroot/mozilla/webtools/tinderbox/showbuilds.cgi,v <-- showbuilds.cgi
new revision: 1.200; previous revision: 1.199
done
Checking in showbuilds.pl;
/cvsroot/mozilla/webtools/tinderbox/showbuilds.pl,v <-- showbuilds.pl
new revision: 1.45; previous revision: 1.44
done
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 16•14 years ago
|
||
I'm getting a 404 for
http://tinderbox.mozilla.org/Firefox/status.html
Is that the wrong URL? Was the fix here somehow wrong or was the deployment in bug 612100 somehow wrong?
Reporter | ||
Comment 17•14 years ago
|
||
Similarly
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Firefox&status=1
doesn't show just the status. Am I missing something?
Comment 18•14 years ago
|
||
Yes, you're missing the long slow path to production: bug 612100 deployed it at http://tinderbox-stage.mozilla.org/Firefox/status.html
Updated•10 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•