Presentation is loading. Please wait.

Presentation is loading. Please wait.

RT Keeping track of things. Hi, Im Jesse fsck | bestpractical President of Best Practical Solutions Perl hacker Recovering sysadmin.

Similar presentations


Presentation on theme: "RT Keeping track of things. Hi, Im Jesse fsck | bestpractical President of Best Practical Solutions Perl hacker Recovering sysadmin."— Presentation transcript:

1 RT Keeping track of things

2 Hi, Im Jesse fsck | bestpractical President of Best Practical Solutions Perl hacker Recovering sysadmin

3 Overview What RT is Who uses RT How to use RT How RT is put together How to extend RT

4 What RT is (buzzwords) Issue tracking platform Enterprise grade Open source Internationalized

5 Who uses RT

6 Usage scenarios –Bug tracking –Customer service –Helpdesk –Network Operations –Project Management –Collaboration (OSCon) –Weblog

7 The RT mindset –its a historical record and a project manager –Everything is a ticket –No task is too big –No task is too small –Update your tickets often –Its better to have a vague ticket than no ticket –Dont send yourself reminders, send them to RT

8 How to use RT

9 By End users dont need to do anything special Except feel like theyre getting special attention RT magically routes mail to the people who need to see it

10 On the web

11

12

13

14 How RT is built

15 Layer cake

16 Database RT is composed of over a dozen types of objects, all of which interrelate Building your own relational database out of BDB or flat files on disk isnt our idea of fun Organizations want to be able to use their own tools to query RT RT uses an SQL backend

17 RTs database schema RT Core Principals Users Groups GroupMembers CachedGroupMembers ACL Links Ticketing system Queues ScripActions ScripConditions Templates Scrips CustomFields CustomFieldValues Tickets TicketCustomFieldValues Transactions Attachments

18 Writing directly to the database is wrong –RT is a complex application with complex relationships between database tables –Querying the database for reporting is OK, but usually unnecessary –Weve got a better way…

19 DBIx::SearchBuilder –Its an object-relational mapper –It hides SQL from your application RTs PostgreSQL and Oracle ports were completed without changes to RT, just to SearchBuilder. –It lets you turn certain kinds of database into singleton and collection objects –Its kind of like Class::DBI –(almost) every RT object is a DBIx::Searchbuilder::Something

20 SearchBuilder is simplicity # Instantiate an empty ticket object $t = new RT::Ticket( $RT::SystemUser ); # Load the ticket we care about $t->Load( 42 ); # Print the tickets subject print $t->Subject;

21 Singleton Objects DBIx::SearchBuilder::Record takes care of –Creators my $user = RT::User->new($RT::SystemUser); $user->Create(Name => jrv, Address => –Loaders $user->LoadByCols( Address => –Accessors print $user->Name; –Mutators $user->SetName(jesse); –Destructors $user->Delete();

22 Collection Objects Every singleton has a corresponding DBIx::SearchBuilder collection object Complex searches without raw SQL my $users = RT::Users->new($RT::SystemUser); $users->Limit(FIELD => Address, OPERATOR => LIKE, VALUE => fsck.com); while (my $user = $users->Next) { print Found.$user-> Address.\n; }

23 RT Core

24 The RT Core Objects DBIx::SearchBuilder::Record subclasses –Ticket –Queue –User –Group –And Others ACE, Attachment, GroupMember, CachedGroupMember, Link, Principal, CustomField, CustomFieldValue, TicketCustomFieldValue, Transaction

25 Overlay and local classes Core database-access classes are autogenerated –When the database changes, you dont want to hand-hack code –When you make changes to RT, you want your changes to persist seamlessly across minor version upgrades Most sites dont track local source changes Even if they do, merging sucks

26 How Overlays work eval "require RT::Ticket_Overlay"; if && !~ qr{^Can't locate RT/Ticket_Overlay.pm}) { die }; eval "require RT::Ticket_Local"; if && !~ qr{^Can't locate RT/Ticket_Local.pm}) { die };

27 Principals, Users and Groups Principals –Every User is a Principal –Every Group is a Principal –We can treat users and groups as equivalent for ACL checks and Group Membership Groups can contain users and groups –Groups cant contain themselves

28 Authentication RT has its own internal authentication system RT needs to have a user object for any user before theyre allowed to access RT –They are autocreated on submission, if you grant Everyone the right to create/correspond/comment on tickets You can tie RT into your own authentication source

29 ACL system ACLs can apply to any DBIx::SB::Record Any Record object type can define what rights it supports Rights can be granted to any user or group Other systems that drop on top of RT can use the ACL system

30 Delegation Supports basic delegation of rights Doesnt support partial delegation of a given right Doesnt support redelegation of rights When a users right to do something is revoked, delegates also have right revoked

31 ACL Queries Currently supports –Does $principal have $right for any object –What principals has $right for $object? Should also support –What rights does $principal have for $object

32 Mason application server RTs web interface is built on HTML::Mason –Easy to start hacking on, especially if you know perl –Fast –Flexible Multiple Component Roots –System –Local

33 Handlers mod_perl FastCGI SpeedyCGI

34 Brief comparison to JSP,ASP,PHP,TT Mason is like ASP or JSP, but for perl Unlike the Template Toolkit, its all perl, all the time Unlike PHP, theres a real language behind it

35 I18N and L10N

36 Internationalization

37

38 Building blocks –UTF8/Unicode –Encode –Locale::MakeText{::Lexicon,}

39 String Extraction Overview Core $self->loc(Created ticket [_1], $self->Id); Code In Mason loc(Created ticket [_1], $ticket->Id); Text In Mason Id &>Created ticket [_1] Getting the strings into the.po files –tool/extract-message-catalog

40 Localization

41 Adding a new translation –Basic internationalization for languages without cases/aspects –Extract a fresh.po file Example string from.po file #: html/Admin/Users/Modify.html:80 msgid "Access control" msgstr "Toegangscontrole –Translate.po file –Check your work

42 Corporatization Localization can be useful just within an organization. Every organization has its own jargon Its a request, not a ticket –PO files can be overlaid just like libraries

43 How to extend RT

44 User Visible API All RT tools use the API we export to the world –rt-cron –web frontend –SOAP server perldoc RT::Ticket perldoc RT::Ticket_Overlay

45 RPC Mechanisms Scraping REST –Mail Gateway –CLI SOAP –Net::RT

46 Some code examples

47 RT Preamble #!/usr/bin/perl -w use strict; use lib ("/opt/rt3/lib", "/opt/rt3/local/lib"); use RT; # Load the config file RT::LoadConfig(); #Connect to the database and get RT::SystemUser loaded RT::Init();

48 A simple tool to resolve a ticket [preamble] use RT::Interface::CLI qw(GetCurrentUser loc); use RT::Tickets; my $CurrentUser = GetCurrentUser(); die loc("No RT user found.") unless ($CurrentUser->Id); my $ticketid = shift; my $ticket = RT::Ticket->new($CurrentUser); $ticket->Load($ticketid); die loc(Ticket not found) unless ($ticket->Id) ; my ($tid, $msg) = $ticket->SetStatus(resolved); print $msg;

49 A simple web tool my $tix = new RT::Tickets ($session{CurrentUser}); $tix->Limit(FIELD => Owner, VALUE => $session{CurrentUser}); My tickets % while (my $ticket = $tix->Next) { id%>: Subject%> Status)%> %}

50 Testing Make regression tests –database setup –core code –mail gateway –web ui It doesnt yet test –with multiple databases –with multiple perl versions

51 Development Methodology Core controlled by Best Practical Linux-style stable and development branches Development roadmap is driven by enlightened itch-scratching Archive of community contributed add-ons

52 Recommended reading Web UI –Mason Book Core –RT Style Guide –perldoc RT::Ticket –perldoc RT::Ticket_Overlay I18N –perldoc Locale::Maketext::TPJ13 –perldoc Locale::Maketext::Lexicon

53 Getting in touch –Find RT on the web –Chat with other users –Get involved in development –Report issues you run into –Overworked? Lazy? Let us do it for you –Hassle Jesse directly

54 Thanks! Got any questions?


Download ppt "RT Keeping track of things. Hi, Im Jesse fsck | bestpractical President of Best Practical Solutions Perl hacker Recovering sysadmin."

Similar presentations


Ads by Google