[rt-devel] kanben view in RT 4.2.12

Shawn Moore shawn at bestpractical.com
Tue Feb 23 13:37:35 EST 2016


On 2016年2月18日 at 8:20:28, Joachim Schiele (js at lastlog.de) wrote:
> dear rt-developers,

Hi Joachim and Paul,

> we want to add a kanban view for tickets in RT but in order to do that a
> REST interface with websocket support is required.

Sounds great! :-)

> the current 1.0 interface does not support JSON (will be fixed with the
> 2.0 REST API AFAIK)

That’s correct.

> which means we have to create java-script objects
> from the input in the browser manually (without being able to use
> parseJSON(...))
>  
> our initial idea is to use mysql with triggers:
> http://dev.mysql.com/doc/refman/5.0/en/triggers.html
>  
> as this seems to be an easy way to monitor the tickets table for changes
> and then note these ticket IDs down.

Please be aware that you’re limiting the potential audience of your extension by tying it to any specific database engine. RT has many users on Postgres and Oracle as well.

My suggestion would be to add the notification system at the ORM layer. Probably in the guts of RT (RT::Record, RT::SearchBuilder) or possibly in the generic ORM, DBIx::SearchBuilder. Changes to records in the database pass through a very small list of Perl methods (in particular, RT::Record::_Set), so by instrumenting the right place you should be able to see all changes happening.

> the websocket REST-interface then sees all attached clients and every
> time a ticket changes it can push the ticket ID(s) to the client and the
> client then can apply the change.
>  
> === the question ===
> - where in the RT code would be the best place to add the WEBSOCKET REST
> extension (into the routing) + it needs an main loop waiting for
> 'ticket'-table changes

You’ll probably want to use Plack::App::WebSocket with an event-based PSGI server (probably Twiggy). RT is typically deployed with FastCGI or similar, so you have your work cut out for you there. :) You’ll either want to have good documentation around switching an RT deployment from FastCGI to Twiggy, or have your users deploy a standalone Twiggy server alongside their RT http server.

> - how to make this a general solution: instead of binding this feature
> to MYSQL we could also extend the ticket API with various callbacks on:
> - add/remove/update ticket functionality

Instrumenting RT::Record::Create and RT::Record::_Set generally, or RT::Ticket::Create and RT::Ticket::_Set specifically, should get you most of the way there.

> === /the question ===
>  
> we plan to release the kanban as open source once we are done with the
> implementation.
>  
> if you could help us out with implementation details, that'd be a delight.

Absolutely! This is the best forum for such conversations. :)

> thanks in advance,
> joachim & paul

Thanks!
Shawn


More information about the rt-devel mailing list