We implemented Trac with a customized workflow. In our implementation a ticket has many additional states.

Thus during its lifecycle a ticket has to go through several stages. Most of these stages are irrelevant to the reporter of the ticket. He doesnt want to be overwhelemed by email notifications for each and every change to the ticket. Our managers used to get complains from clients who were ticket reporters about these notifications. We needed a solution.

One option was to turn off the the reporter notification completely other option was to modify trac’s default behaviour. The first option was not a good one as the reporters needed some kind of notification when a ticket was created, closed or reopened.

I searched Trac-hacks plugin list to find out something suitable. I couldnot find anything therefore i decided to tweak the Trac myself. It was not at all difficult as Trac has a plugin architecture and I found an api which could solve my problem. I just needed to add and modify few lines.That was it our problem was solved.I named it “FlexibleReporterNotification” plugin.

I have posted the solution at trac-hacks site so that someone needing similar solution may find it useful. It works on Trac 0.11.

Plugin url :- http://trac-hacks.org/wiki/FlexibleReporterNotificationPlugin

Posted by satyam, filed under Uncategorized. Date: September 12, 2008, 4:56 pm | No Comments »

Trac version 0.11b1

OS:-Windows 2003

Email client: - Fetchmail

Email2trac version: - 0.30

Others: - cygwin

Through this blog I intend to share our experience of configuring email2trac plugin on windows 2003. We had to make few changes in the original email2trac.py file in order to get it working.

We configured this plugin one eventful night a couple of months back. A normal trac plugin takes around 30-40 minutes at max to configure, but this one plugin took one whole night (around 6-7 hrs.). We started off with downloading the plugin and following the install instructions. After completing the instruction set we tried to test the plugin, the test failed we could not create tickets from email. We revisited the instructions to figure out if we had missed out something. We had followed the instructions quite well.

After playing around with the configuration files and revisiting the entire setup it was time to look at the code itself (email2trac.py). It took us a couple of hours to understand the code and its flow. Few things in the code did not make sense to us therefore we commented out those added few lines of ours and email2trac was working for us. Following are the things we commented out from email2trac.py

1) Blacklisting section.

2) Attachment Encoding.

3) Check for syslog.

4) Normalization of the file name for the attachment.

Due to the commenting of the above mentioned sections attachment path was not being generated correctly. To overcome this problem we added the following lines at the end of attachments definition after fd.close (line number 1073.)

attachmentPath = self.PROJECTPATH + “/attachments/ticket/” + str(ticket['id']) + “/” + url_filename

shutil.copy2 (temppath, attachmentPath)

Although this fix made the email2trac functional on our trac system, we are still struggling with attachments. We are able to send in zipped files in but the MS office documents get clobbered. We are still working on this and hopefully will resolve it soon at that point I will post another blog here.

In my view if any one wants to implement email2trac on windows they should be willing to make their hands dirty. There is not enough documentation available for this plugin. It is still a UNIX based program which can be made to work on windows with some hacks. Just as in our case we broke away from the program flow to make it work for us.

Following links are helpful in setting up this plugin on windows.

https://subtrac.sara.nl/oss/email2trac/wiki/Email2tracInstallation/Windows

http://functionalelegant.blogspot.com/search/label/Trac

Posted by satyam, filed under Uncategorized. Date: August 4, 2008, 8:46 pm | No Comments »

If a loaf can full your appetite then why to order for two loafs and waste the other one. But to this people call them stereotype of miser that is wealthy and greedy, a man who lives intelligently in order to save and increase his treasure. Same thing I have seen while creating a table and columns and assigning the data-types and their sizes, if we can full fill the requirement of the data by providing the accurate or approximate size then it will not only increase the treasure(or in technical terms we used to call performance) but also we can reduce the risk which prevails in any application. If we can use tiny int and get our work done then why to use small int or simple int and burden the database and decrease the performance. Use the best data-type matching your requirement, if it is varchar don’t just define varchar, but if you know the size define it like varchar(20) or something else. Below are few data-types and the values they accommodate. I know this is the basic of but sometimes these basic things make a major difference. So when ever creating the tables BE MISER… and don’t BE SPENDTHRIFT

bigint

Integer data from -2^63 through 2^63-1

int

Integer data from -2^31 through 2^31 - 1

smallint

Integer data from -2^15 through 2^15 - 1

tinyint

Integer data from 0 through 255

bit

Integer data with either a 1 or 0 value

decimal

Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1

numeric

Fixed precision and scale numeric data from -10^38 +1 through 10^38 -1

money

Monetary data values from -2^63 through 2^63 - 1

smallmoney

Monetary data values from -214,748.3648 through +214,748.3647

float

Floating precision number data from -1.79E + 308 through 1.79E + 308

real

Floating precision number data from -3.40E + 38 through 3.40E + 38

datetime

Date and time data from January 1, 1753, through December 31, 9999,with an accuracy of 3.33 milliseconds

smalldatetime

Date and time data from January 1, 1900, through June 6, 2079,with an accuracy of one minute

char

Fixed-length character data with a maximum length of 8,000 characters

varchar

Variable-length data with a maximum of 8,000 characters

text

Variable-length data with a maximum length of 2^31 - 1 characters

nchar

Fixed-length Unicode data with a maximum length of 4,000 characters

nvarchar

Variable-length Unicode data with a maximum length of 4,000 characters

ntext

Variable-length Unicode data with a maximum length of 2^30 - 1 characters

binary

Fixed-length binary data with a maximum length of 8,000 bytes

varbinary

Variable-length binary data with a maximum length of 8,000 bytes

image

Variable-length binary data with a maximum length of 2^31 - 1 bytes

timestamp

A database-wide unique number that gets updated every time a row gets updated

uniqueidentifier

A globally unique identifier

sql_variant

A data type that stores values of various data types,except text, ntext, timestamp, and sql_variant

varchar(max)

Maximum 1,073,741,824 characters

text

Maximum 2GB of text data

nvarchar(max)

Maximum 536,870,912 characters

ntext

Unicode data. Maximum 2GB of text data

Posted by sandeverma, filed under Uncategorized. Date: July 30, 2008, 6:22 pm | 4 Comments »