MediaWiki talk:Gadget-BugStatusUpdate.js
![](http://up.wiki.x.io/wikipedia/commons/8/8a/Gadget-BugStatusUpdate-screenshot.png)
Webservice restart instructions
[edit]Sometimes the webservice needs to be restarted. For people with access, the commands are:
- ssh login.tools.wmflabs.org
- become phabricator-bug-status
- webservice restart
Sometimes it needs more than a restart.
Ping a maintainer if it is acting up (Currently user:Mattflaschen).
Volunteer to become a maintainer if you understand the code!
Bugs
[edit]See mw:User talk:Robmoen/bugStatusUpdate.js. Helder 09:51, 4 May 2012 (UTC)
Inform resolution in case the bug is "RESOLVED"
[edit]When a bug is marked as "RESOLVED", it would be useful to have the resolution available to know if it is a FIXED, INVALID, WONTFIX, DUPLICATED or a WORKSFORME. Helder 11:25, 25 January 2013 (UTC)
Stepping up to the plate...
[edit]Helder, I see you have made many scattered requests for enhancements/fixes to this template/gadget. I'm going to be working through trying to accomodate as many of them as I can, and would appreciate if you could go through the bulleted list here and make sure I don't miss any. Thanks Technical 13 (talk) 18:32, 18 June 2013 (UTC)
- You can track the progress by adding User:Technical 13/SandBox/Gadget-BugStatusUpdate.js and User:Technical 13/Templates/Bugzilla to your watchlist and you can track the results of my changes on User:Technical 13/Bugzilla#TEST SECTION for template & gadget revamp (you will have to add the following line of code to your custom js page to see the changes) Technical 13 (talk) 19:33, 18 June 2013 (UTC)
importScript('User:Technical 13/SandBox/Gadget-BugStatusUpdate.js'); // [[User:Technical 13/SandBox/Gadget-BugStatusUpdate.js]] testing
- Technical 13, sorry for taking so long to reply.
- What is the current status of the changes you did?
- BTW: our bugmaster (AKlapper (WMF)) might have suggestions about this gadget, since he seems to be very familiar with Bugzilla? Helder 17:22, 11 September 2013 (UTC)
- I've actually asked AKlapper (WMF) for some input, and he said he knows little about the actual api. I actually got distracted from this project, and you can see what I did manage to get done in my version in the list below. I've also made some adjustments to the template and started working on "resolutions" but have had the time to write the code to scrape the html of the bugs to get it (since it isn't returned by the api). I also looked at and thought about ways to indicate "security" bugs based on the error message returned by the api, but haven't gotten around to implementing it just yet. Technical 13 (talk) 17:47, 11 September 2013 (UTC)
- Yeah, sorry, knowledge of Bugzilla's API is definitely one of my weak points. I've played with it (and JIRA's API) a little bit around the beginning of this year for a technical paper but I only touched the surface (plus it was slightly frustrating, but upstream developers are now finally working on a REST API). If you have some specific questions, Arthur Richards might be able to help as he maintains a script to sync Bugzilla with Wikimedia's Mingle instance. --AKlapper (WMF) (talk) 17:02, 16 September 2013 (UTC)
- I've actually asked AKlapper (WMF) for some input, and he said he knows little about the actual api. I actually got distracted from this project, and you can see what I did manage to get done in my version in the list below. I've also made some adjustments to the template and started working on "resolutions" but have had the time to write the code to scrape the html of the bugs to get it (since it isn't returned by the api). I also looked at and thought about ways to indicate "security" bugs based on the error message returned by the api, but haven't gotten around to implementing it just yet. Technical 13 (talk) 17:47, 11 September 2013 (UTC)
List of things to fix or improve
[edit]Fix only the first instance of the template working per bug numberThis should be easily fixed by changing the system to use {{{1}}} as opposed to the {{{1}}} that it currently uses.Done by Technical 13 (talk) @ 19:33, 18 June 2013 (UTC)
- Add more details as to the status of "resolved" bugs as to whether it was resolved as:
- DUPLICATED, FIXED, INVALID, LATER, WONTFIX, WORKSFORME
- Not returned by API directly.
- DUPLICATED, FIXED, INVALID, LATER, WONTFIX, WORKSFORME
- Offer some kind of information for security-restricted bug reports such as T51741
Failure in Chrome/Firefox
[edit]A short time ago, this gadget is failing in chrome with the following error: Uncaught TypeError: Cannot read property 'bugs' of null
on the line if(data.result.bugs)...
. Firefox has the same problem. I can find no recent edits that would cause this, but I can see no definition for 'result'. Anyone knows whats going on? — Edokter (talk) — 10:39, 22 June 2013 (UTC)
- It only seems to be broken at the Village Pump when viewed as a whole, so it must be something on the page itself. — Edokter (talk) — 13:12, 23 June 2013 (UTC)
- Edokter, are you still getting the error? I'm not seeing it on FF21. Technical 13 (talk) 16:49, 23 June 2013 (UTC)
- Still getting the error (but only on Wikipedia:Village pump (technical)). Chrome 28 reports
Uncaught TypeError: Cannot read property 'bugs' of null
, Firefox 21 reportsTypeError: data.result is null
. — Edokter (talk) — 17:19, 23 June 2013 (UTC)
- Okay, I am using a test script I've been working on (see above section) and didn't see the error on other pages... I flipped my script off and tried again with the live script on VPT. I went through one section at a time until I came across T51741 which wouldn't load up with just that section. I've deactivated the {{Tracked}} for that bug and think I know what is going on. I think that is a "security" related bug which you can't see the details of (neither can I for that matter), and it is bugging the whole thing out. I'm already working on a patch/fix for that above, but the api returns a completely different result for those, so it may be a bit for my to formulate it. Let me know if commenting it out fixed VPT for you. Technical 13 (talk) 00:11, 24 June 2013 (UTC)
- Seems to be fixed. A simple check (if data.result) should remedy these faults. — Edokter (talk) — 18:07, 24 June 2013 (UTC)
- Still getting the error (but only on Wikipedia:Village pump (technical)). Chrome 28 reports
Adapting this gadget to Phabricator
[edit]![]() | This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Hi, we are planning to deprecate Bugzilla (and a bunch of other tools) in favor of mw:Phabricator. We are looking for volunteers to adapt this gadget at Port {{tracked}} gadget to query Phabricator API. Any takers?--Qgil (talk) 19:31, 13 May 2014 (UTC)
- Qgil: it is probably better to ask on Wikipedia:Village pump (technical). I'm not familiar with Phabricator yet, much less its API (maybe Technical 13 is?). Helder 15:59, 8 September 2014 (UTC)
- I hadn't even created a user account on Phabricator until just now. I'm very interested in this however, but I may have a slow learning curve as I don't have a lot of free time at the moment with all my 300 level classes at school weighing me down in homework. If others are interested, I'd happily defer it to them, otherwise, there's no real deadline I suppose... — {{U|Technical 13}} (e • t • c) 17:22, 8 September 2014 (UTC)
- We have a new version of the Template:Tracked on its sandbox (see the diff). Helder 13:40, 9 September 2014 (UTC)
- That is just the template which auto-links to either Bugzilla od Phabricator (which does not work at the moment as it is in the process of moving). The Gadget queries the status of the bug/ticket and needs an API to communicate with.
-- [[User:Edokter]] {{talk}}
19:37, 9 September 2014 (UTC)
- That is just the template which auto-links to either Bugzilla od Phabricator (which does not work at the moment as it is in the process of moving). The Gadget queries the status of the bug/ticket and needs an API to communicate with.
- I've cast a glance at how to do the same thing with phabricator as with bugzilla. First, the API (conduit) “auto”-documentation is very light; second, we'll need an additional step to get a CSRF token, even for read-only requests (I still wonder why); third, I haven't found yet how to query information for several tasks at the same time (I certainly wouldn't use the gadget if it was doing one request per task) — but again, the documentation is subpar.
- Example, request for bugzilla was this one, now it'll be like this one (except that it only gets information for one task and that some other query — which one and why, I've no idea — is required first to get the CSRF token).
- I dunno if we had to patch bugzilla in the past, but I've the feeling that we'll have to contribute to phabricator in the future…
- Best regards — Arkanosis ✉ 01:50, 3 October 2014 (UTC)
- Thanks Arkanosis, I'm no Conduit expert, but you can surely find good advice in our Phabricator instance. I have created a task for this: phab:T539.--5.147.248.10 (talk) 11:53, 3 October 2014 (UTC)
- This is done. I've ported it over; the new version is it at User:Mattflaschen (WMF)/Gadget-BugStatusUpdate.js. It uses a simple JSONP service I implemented on Tool Labs. The new gadget does not support Bugzilla at all (the template still does); all Bugzilla bugs have been migrated to the Phabricator site, and any Bugzilla statuses are potentially out of date, so I don't think it's necessary.
- You can try it out if you'd like (see http://en.wiki.x.io/w/index.php?title=User:Mattflaschen_%28WMF%29/common.js&oldid=646451192 for import line). If it looks good, I'd like to have the gadget updated. Mattflaschen (WMF) (talk) 05:52, 10 February 2015 (UTC)
Done. I'll clean up the template later.
-- [[User:Edokter]] {{talk}}
10:07, 10 February 2015 (UTC)
- Thanks Arkanosis, I'm no Conduit expert, but you can surely find good advice in our Phabricator instance. I have created a task for this: phab:T539.--5.147.248.10 (talk) 11:53, 3 October 2014 (UTC)
Not working
[edit]I'm not getting any status; I keep getting a 500 error from tools.wmflabs.org in my console. -- [[User:Edokter]] {{talk}}
14:51, 8 March 2015 (UTC)
- @Mattflaschen (WMF): ^ Quiddity (talk) 17:28, 8 March 2015 (UTC)
- @Quiddity and Edokter: I'm not sure why it stopped working (I didn't make any recent code change), but I can't restart it due to phab:T92039. Mattflaschen (WMF) (talk) 22:56, 9 March 2015 (UTC)
- @Quiddity and Edokter: Tim.landscheidt quickly fixed webservice2, and the gadget is working again. Mattflaschen (WMF) (talk) 21:58, 10 March 2015 (UTC)
- @Mattflaschen (WMF): This gadget seems to be non-functional again, but there are no errors in console this time. Something something error at https://tools.wmflabs.org/phabricator-bug-status/queryTasks though. Quiddity (WMF) (talk) 01:52, 16 April 2015 (UTC)
- I do get a 500 error in my console.
-- [[User:Edokter]] {{talk}}
07:52, 16 April 2015 (UTC)- Restarted it, and it works again. Mattflaschen (WMF) (talk) 00:06, 22 April 2015 (UTC)
- I do get a 500 error in my console.
- @Mattflaschen (WMF): This gadget seems to be non-functional again, but there are no errors in console this time. Something something error at https://tools.wmflabs.org/phabricator-bug-status/queryTasks though. Quiddity (WMF) (talk) 01:52, 16 April 2015 (UTC)
- @Quiddity and Edokter: Tim.landscheidt quickly fixed webservice2, and the gadget is working again. Mattflaschen (WMF) (talk) 21:58, 10 March 2015 (UTC)
- @Quiddity and Edokter: I'm not sure why it stopped working (I didn't make any recent code change), but I can't restart it due to phab:T92039. Mattflaschen (WMF) (talk) 22:56, 9 March 2015 (UTC)
- For anyone with access, steps to restart it:
- ssh login.tools.wmflabs.org
- become phabricator-bug-status
- webservice restart
- -- Mattflaschen (WMF) (talk) 00:07, 22 April 2015 (UTC)
- It's down... again.
-- [[User:Edokter]] {{talk}}
15:14, 28 April 2015 (UTC)
- Mattflaschen (WMF), what does it take to get access? —
{{U|Technical 13}} (e • t • c)
15:50, 28 April 2015 (UTC)
- It's down... again. Please add me to the phabricator-bug-status project, so I can restart. Thanks. —
{{U|Technical 13}} (e • t • c)
02:36, 29 April 2015 (UTC) - FYI, this works again. Nudge me if it goes down again. Thanks. Quiddity (WMF) (talk) 22:35, 5 August 2015 (UTC)
Startup optimization
[edit]Hello, you might be interested by this optimization I made on frwiki. The gain is really worth it, especially on large pages with many links. Od1n (talk) 06:43, 4 April 2018 (UTC)
- Thanks for the suggestion! Done. Enterprisey (talk!) 14:43, 14 February 2019 (UTC)
404 not found?
[edit]The API call gets a 404 error. Is the tool still maintained? Od1n (talk) 16:57, 28 April 2018 (UTC)
- @Mattflaschen: Hi, do you know why this tool is down? (https://tools.wmflabs.org/phabricator-bug-status/queryTasks gets a 503). Also a reminder to look for a second tool-maintainer. :) Quiddity (WMF) (talk) 18:28, 30 April 2018 (UTC)
- Note: I asked Bryan, who said "I think I got it back up and running. it was a bit more complex than just restart". However, whilst a query now works (example), the gadget still does not work and shows this error in console: https://i.imgur.com/fwJhjXr.png Or text: https://ghostbin.com/paste/a4bzf/raw
- I've also added a section at the top of this page, for any further maintenance notes/clues you might be able to add.
- Hope that helps. Quiddity (WMF) (talk) 20:23, 30 April 2018 (UTC)
Status issues?
[edit]Anyone else seeing problems with this showing resolved on open tickets recently?
Example link above. — xaosflux Talk 11:07, 18 June 2021 (UTC)
- @Xaosflux: No, but now it's returning internal service errors (500); and the listed maintainer hasn't edited anywhere since 2019. Any ideas on how to get a suitable kick administered to the tool? Xover (talk) 17:16, 5 August 2021 (UTC)
- @Xover: it is working for me right now, are you seeing this problem now? The local script can produce a 500 error for a timeout upstream. — xaosflux Talk 17:19, 5 August 2021 (UTC)
- @Xaosflux: This URL was grabbed from my JS console shortly before the above message, and still returns 500 for me. Xover (talk) 17:53, 5 August 2021 (UTC)
- @Xover: ah OK, so this isn't a problem with our script - but with the external tool. You can open a ticket on that tool at phab (http://phabricator.wikimedia.org/project/profile/2159/) and maybe someone will pick it up. — xaosflux Talk 18:05, 5 August 2021 (UTC)
- @Xaosflux: AIUI phabricator-bug-status.toolforge.org was developed specifically as the backend for enwp's Gadget-BugStatusUpdate.js, and points here from the tool description. The (only) maintainer listed there and here is Mattflaschen, who hasn't edited on any project since 2019 (cf. #Webservice restart instructions above). Now granted I was following up a problem reported over on enWS, but if it's starting to bitrot it's going to start affecting enWP too. In any case, since it apparently isn't completely down I'll do some more poking and try to quantify it before filing in Phab. Xover (talk) 18:21, 5 August 2021 (UTC)
- @Xover: only option really, the editors and admins of enwiki can't do anything about that, if it goes down for good all we can do is disable this gadget or retarget it if someone else makes a status tool - would probably be better to not have to use a toolforge shunt and just fetch the values from phab directly. — xaosflux Talk 18:37, 5 August 2021 (UTC)
- @Xaosflux: Looking into this, it turns out Phabricator supports neither JSONP nor CORS, and it requires a manually assigned per-user Conduit API key, so in practice it's not possible to query this from JS in a web browser. I also cannot find that the code for the proxy is available anywhere (it's not on Matt's Github, for example), but I imagine that it is in essence just providing the API key and JSONP bits of that. It also, incidentally, massages the data coming from Conduit before returning it to the client, presumably to cater to clients written for Bugzilla's API. But, bottom line, the only way to get at the 500 errors is to either usurp the
phabricator-bug-status
tool, or to replace it with a new tool based on cors-anywhere or something similar.That being said, in debugging why enWS's gadget was seemingly completely broken while enwp's only failed on occasional 500 errors I ended up rewriting{{tracked}}
in Lua, moving hardcoded formatting into TemplateStyles, and cleaning up the code. The gadget itself is now down to about ~55 lines of fairly readable code (and inline comments), faster (not that it matters), more robust (possibly matters), and should deal better with multiple tracked templates on a single page.If there's any interest, the updated code is at s:MediaWiki:Gadget-BugStatusUpdate.js, s:Template:Tracked, s:Module:Tracked, s:Template:Tracked/styles.css, and it's probably a good idea to grab the testcases too: s:Template:Tracked/testcases. I'm happy to help bringing it over, but since I'm not currently very active on enwp I don't want to pull the trigger on that unilaterally. It also requires updating the gadget and the template concurrently meaning it requires someone with the right bits turned on on their account. Xover (talk) 07:38, 13 August 2021 (UTC)
- @Xaosflux: Looking into this, it turns out Phabricator supports neither JSONP nor CORS, and it requires a manually assigned per-user Conduit API key, so in practice it's not possible to query this from JS in a web browser. I also cannot find that the code for the proxy is available anywhere (it's not on Matt's Github, for example), but I imagine that it is in essence just providing the API key and JSONP bits of that. It also, incidentally, massages the data coming from Conduit before returning it to the client, presumably to cater to clients written for Bugzilla's API. But, bottom line, the only way to get at the 500 errors is to either usurp the
- @Xover: only option really, the editors and admins of enwiki can't do anything about that, if it goes down for good all we can do is disable this gadget or retarget it if someone else makes a status tool - would probably be better to not have to use a toolforge shunt and just fetch the values from phab directly. — xaosflux Talk 18:37, 5 August 2021 (UTC)
- @Xaosflux: AIUI phabricator-bug-status.toolforge.org was developed specifically as the backend for enwp's Gadget-BugStatusUpdate.js, and points here from the tool description. The (only) maintainer listed there and here is Mattflaschen, who hasn't edited on any project since 2019 (cf. #Webservice restart instructions above). Now granted I was following up a problem reported over on enWS, but if it's starting to bitrot it's going to start affecting enWP too. In any case, since it apparently isn't completely down I'll do some more poking and try to quantify it before filing in Phab. Xover (talk) 18:21, 5 August 2021 (UTC)
- @Xover: ah OK, so this isn't a problem with our script - but with the external tool. You can open a ticket on that tool at phab (http://phabricator.wikimedia.org/project/profile/2159/) and maybe someone will pick it up. — xaosflux Talk 18:05, 5 August 2021 (UTC)
- @Xaosflux: This URL was grabbed from my JS console shortly before the above message, and still returns 500 for me. Xover (talk) 17:53, 5 August 2021 (UTC)
- @Xover: it is working for me right now, are you seeing this problem now? The local script can produce a 500 error for a timeout upstream. — xaosflux Talk 17:19, 5 August 2021 (UTC)