willkg/ernest — pull request #58 by mythmon (2014-10-11 00:27:57+00:00)
Title: Automatically update bugs.

This listens on a websocket to the [Bugzfeed service](https://wiki.mozilla.org/BMO/ChangeNotificationSystem) for bugs that *already exist int he sprint*. When one of those bugs changes, it will make a request to the backend to get the new data about it, and update the UI.

I've tested all the parts in separation, but I've run out of bug metadata to fiddle with, so I haven't tested a full bug change to UI process. I have tested that the service notices when bugs change, and that requesting a manual update of a bug gets the right data from the server. The weak link is whether that happens when a bug changes. I think it will, but I plan on testing this more in the morning.

The caveat here is that it won't be able to tell if bugs get added to the sprint, or if new bugs get filed and added to the sprint. That's because we don't know the bug IDs to watch when we start. It might be possible to get a list of every SUMO bug that might be added to a sprint (maybe any bug that is open?) and watch those too, but that still wont' catch bugs that move from another product into SUMO.

Additionally we could try and catch new bugs by watching the bug ID `N` where the most recent bug filed globally is `N - 1`. This does work on the bugzfeed system, and it will get a change, and that change is creation. The logic for this sounds really complicated.

I'm happy with just updating bugs that already exist. The refresh button is still there for bugs being added to the sprint. It would be nice if that was automatic too, but I can't think of a good way to do it. I'd love if there is another way!

There is some debugging code in here we might be able to get rid of. I figured I would leave it for now since I'm about to go run and catch a bus, and also because it's useful when debugging.

r?