Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 146334

Summary: basic Trac connector
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse.dserodio, ekuleshov, gunnar, pombredanne, tvanlessen
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 147816    
Bug Blocks:    
Attachments:
Description Flags
Instructions for building Trac connector none

Description Steffen Pingel CLA 2006-06-09 16:00:29 EDT
Implement a connector for Trac (https://bugs.eclipse.org/bugs/show_bug.cgi?id=140512):

 * Access through XML-RPC plug-in or tab-delimited output of query script
 * Adding of existing tickets
 * Query support
 * Editing of tickets through web-browser
Comment 1 Mik Kersten CLA 2006-06-09 16:49:45 EDT
This sounds right Steffen, just skip the "adding of existing" for the first iteration and focus on tests and wiring up of the queries.  Note that some of the classes that you'll be extending will be changing, but I will walk you through that as it happens.
Comment 2 Eugene Kuleshov CLA 2006-06-10 16:19:48 EDT
BTW, it looks like Mylar's URL finder fail to properly select URL from the description of this bug report.
Comment 3 Mik Kersten CLA 2006-06-12 11:50:43 EDT
Eugene, if you're talking about an error dialog that pops up stating that the title could not be downloaded, that's a timeout and the message will be made silent once the web integration gets released.
Comment 4 Eugene Kuleshov CLA 2006-06-12 11:57:44 EDT
(In reply to comment #3)
> Eugene, if you're talking about an error dialog that pops up stating that the
> title could not be downloaded, that's a timeout and the message will be made
> silent once the web integration gets released.

No, it is about decorator that you see in the Bugzilla editor. It adds "):" to the end of the url.

Comment 5 Mik Kersten CLA 2006-06-13 22:31:30 EDT
Regarding comment #4, I added bug 146964.
Comment 6 Steffen Pingel CLA 2006-06-14 12:23:06 EDT
Mik, to follow up on the conference call: You mentioned some kind of wiki integration for Mylar that is being done for Confluence. I haven't quite grasped the concept, yet. Is there more information available?
Comment 7 Steffen Pingel CLA 2006-06-14 12:45:26 EDT
A few suggestions for minor changes to the API have come up:

* The signature of AbstractRepositoryConnector.canCreateTask() should include an instance of TaskRepository. For Trac the availability of this operation depends on the permissions of the logged in user and may vary on a repository basis. 

* The signature of AbstractRepositoryConnector.createTaskFromExistingKey() could be extended to include an IProgressMonitor since this operation requires remote access and can take a long time. 

* The visibility of AbstractRepositorySettingsPage.RepositoryStringFieldEditor should be changed to protected. Otherwise a cast is required to access the password editor ((StringFieldEditor)passwordEditor) in classes that extend AbstractRepositorySettingsPage. Trac supports access without authentication, so it would be nice to have an "Anonymous access" check box that disabled the username and password editor.
Comment 8 Eugene Kuleshov CLA 2006-06-14 12:49:11 EDT
(In reply to comment #7)
> * The visibility of AbstractRepositorySettingsPage.RepositoryStringFieldEditor
> should be changed to protected. Otherwise a cast is required to access the
> password editor ((StringFieldEditor)passwordEditor) in classes that extend
> AbstractRepositorySettingsPage. Trac supports access without authentication, so
> it would be nice to have an "Anonymous access" check box that disabled the
> username and password editor.

For this one I think would be better to use custom settings page that connector could provide and which will be replacing the standard one. I also need this feature for generic web0based provider.
Comment 9 Steffen Pingel CLA 2006-06-14 13:06:22 EDT
(In reply to comment #8)
> For this one I think would be better to use custom settings page that
> connector could provide and which will be replacing the standard one. 
> I also need this feature for generic web0based provider.
 
Alright, that certainly makes sense, since time zone and character encoding are fixed for Trac (always UTC and UTF-8).

I still think it is not good practice to have a protected field with a private type. Changing the type of passwordEditor to StringFieldEditor would also do the job.
Comment 10 Mik Kersten CLA 2006-06-16 20:14:36 EDT
Steffen: Eugene has implemented the custom settings and those are now committed.  Let me know if anything else needs to be opened up there.

I gave AbstractAddExistingTaskWizard a setNeedsProgressMonitor(true).  If you would like to pass the monitor to the connector you can submit a patch for that, but we'll have to make that consistent with Bugzilla which currently closes the Wizard and runs a job for retrieving the task.

Regarding the canCreate*Task() methods, this is a repository capability and not a task capability.  So this check would have to happen after the repository was selected.  Could you just handle the error for now, and submit a patch if you would like to add this check to that stage of the wizard (perhaps disabling the widgets for the repositories that do not accept new reports being added?).

As you should break out the items in the description into seperate bug reports, probably one at a time as you do them, and then submit patches to those.  We can keep this one open for general discussion.
Comment 11 Eugene Kuleshov CLA 2006-06-16 23:01:43 EDT
(In reply to comment #10)
> Regarding the canCreate*Task() methods, this is a repository capability and not
> a task capability.  So this check would have to happen after the repository was
> selected.  Could you just handle the error for now, and submit a patch if you
> would like to add this check to that stage of the wizard (perhaps disabling the
> widgets for the repositories that do not accept new reports being added?).

+1 for adding repository instance to the canCreate*() methods, since it is used from the list of repository instances anyways. In web-based repository provider I would check if repository has url defined for creating new tasks.
Comment 12 Steffen Pingel CLA 2006-06-17 08:08:01 EDT
Yes, for Trac I could check the access type (xml-rpc vs. query) when the new task wizard is opened. I would prefer not to display the task repository in the list if I know beforehand that creating new tasks is not possible.
Comment 13 Steffen Pingel CLA 2006-06-17 09:00:36 EDT
(In reply to comment #10)
> Steffen: Eugene has implemented the custom settings and those are now
> committed.  Let me know if anything else needs to be opened up there.

The settings are fine. I am still thinking about opening a request to refactor AbstractRepositorySettingsPage to make it more flexible. I am hesitant to copy&pasting most part of it to create a settings page for Trac.

> I gave AbstractAddExistingTaskWizard a setNeedsProgressMonitor(true).  If you
> would like to pass the monitor to the connector you can submit a patch for
> that, but we'll have to make that consistent with Bugzilla which currently
> closes the Wizard and runs a job for retrieving the task.

I have to think about that. Closing the wizard and synchronizing the task in the background seems like a good idea. I was looking at the Jira code that fetches the task in a blocking way.

> Regarding the canCreate*Task() methods, this is a repository capability and not
> a task capability.

I have opened bug 147609 for that.
Comment 14 Steffen Pingel CLA 2006-06-19 21:59:01 EDT
I have opened bug 147816 for the implementation of core and model.
Comment 15 Steffen Pingel CLA 2006-06-29 11:52:41 EDT
Created attachment 45541 [details]
Instructions for building Trac connector

Patch for the Mylar Contributor Reference as discussed on the Mylar devel mailing list.
Comment 16 Mik Kersten CLA 2006-06-30 13:39:58 EDT
Thanks Steffen, I plan to apply on Tuesday.
Comment 17 Steffen Pingel CLA 2006-07-01 20:56:54 EDT
Once the outstanding patches for bug 147816 and bug 147817 have been merged, I will start working on bug 149385 (adding of existing tasks) and bug 149386 (query support).
Comment 18 Mik Kersten CLA 2006-07-05 01:49:24 EDT
Docs patch applied and pushed to web, and patches on the other reports applied as well.  What you should implement now is the org.eclipse.mylar.tasklist.repositories extension point, using ..mylar.jira/plugin.xml as an example.  Then once you have bug 149385 working please post the test repository details on it.
Comment 19 Steffen Pingel CLA 2006-07-06 22:30:07 EDT
(In reply to comment #18)

> Then once you have bug 149385 working please post the test repository 
> details on it.

Anonymous access using Trac 0.9 as an access type should work on all public Trac repositories that allow custom queries (which is the default).

To try out XML-RPC you can use:

 http://trac.steffenpingel.de/mylar-test
 Username: trac-test
 Password: trac-test
Comment 20 Daniel Serodio CLA 2006-07-18 09:20:39 EDT
My repository uses Digest HTTP authentication, will you add support for that?
Comment 21 Steffen Pingel CLA 2006-07-18 09:44:31 EDT
(In reply to comment #20)
> My repository uses Digest HTTP authentication, will you add support for that?

Sounds like a nice to have feature. Please file a new report for that.
Comment 22 Daniel Serodio CLA 2006-07-19 08:38:09 EDT
(In reply to comment #21)
> (In reply to comment #20)
> > My repository uses Digest HTTP authentication, will you add support for that?
> 
> Sounds like a nice to have feature. Please file a new report for that.
> 

There is no "Trac" component in Bugzilla for Mylar. Which component should I choose for this report?
Comment 23 Steffen Pingel CLA 2006-07-19 08:42:33 EDT
> There is no "Trac" component in Bugzilla for Mylar. Which component should I
> choose for this report?

You can use "Core". 

Comment 24 Mik Kersten CLA 2006-07-26 12:45:47 EDT
Basic connector is working now--if anyone is having trouble with it please file a new bug to the new Trac component in Bugzilla.