Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for attachmentsprefix #19

Open
jairideout opened this issue Oct 13, 2012 · 3 comments
Open

Add documentation for attachmentsprefix #19

jairideout opened this issue Oct 13, 2012 · 3 comments

Comments

@jairideout
Copy link

It would be nice to have documentation explaining how to port attachments. The "attachmentsprefix" config key is not explained (from what I could see at least) and I had to look through the code to figure out what to put for this key.

Also, query_attachments.sql selects five columns (the time in Posix format and as a datetime string) but the script expects only the time in Posix format. Removing the datetime column fixed the issue for me.

This tool was very helpful- thank you!

@dirocco
Copy link
Contributor

dirocco commented Oct 15, 2012

Yes sorry about that, attachmentsprefix is the path to the tickets directory copied over from trac. For example, in our trac, it's "bond_trac\attachments\ticket".

When I was writing the feature, I pushed that ticket directory to the github repository and changed the prefix such that clicking on the generated comments went there instead of leaving the site.

@roskakori
Copy link
Owner

Version 0.4 used ISO format for dates and times, which should work fine with most SQL databases. However, when dircco fixed the outdated API calls with #18, he changed the date format to Posix time stamps which AFAIK is required by sqlite's somewhat clumsy date functions.

The only solution I currently can think of is to provide two SQL statements for each export: one for sqlite, and one for "proper" SQL databases. The import code can first try to parse date columns using ISO format and if that fails resort to Posix.

Does anyone see a better solution than this?

@roskakori
Copy link
Owner

I took at look at the contributed code. To me it seems that "attachments" are actually comments that link to an URL where the attachments have to be located. As dirocco suggested you can add the attachments as files to you project. For example in a project mytool you could create a folder attachments and add the file some_sketch.pdf to it. You can then link to it using https://raw.github.com/myuser/mytool/master/attachments/some_sketch.pdf.

After performing a checkout of mytool, the local files might be in /Users/myuser/workspace/mytool/attachments/some_sketch.pdf.

With this setup, you would set the following options in you *.cfg:

[tratihubis]
...
attachments=/Users/myuser/workspace/mytool/attachments
attachmentsPrefix=https://raw.github.com/myuser/mytool/master/attachments

However, I didn't test this because I don't have a single project with attachments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants