Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 149385 - Trac connector: implement externalizer and adding of existing tickets
Summary: Trac connector: implement externalizer and adding of existing tickets
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-01 20:49 EDT by Steffen Pingel CLA
Modified: 2006-07-06 20:38 EDT (History)
3 users (show)

See Also:


Attachments
Extension for repository connector and externalizer (8.25 KB, patch)
2006-07-05 09:11 EDT, Steffen Pingel CLA
no flags Details | Diff
Wizard for adding existing tasks (23.66 KB, patch)
2006-07-05 21:12 EDT, Steffen Pingel CLA
no flags Details | Diff
mylar/context/zip (24.84 KB, application/octet-stream)
2006-07-05 21:13 EDT, Steffen Pingel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2006-07-01 20:49:54 EDT
Provide an implementation for TracTask and TracTaskExternalizer and a wizard for adding existing tasks.
Comment 1 Mik Kersten CLA 2006-07-05 01:46:25 EDT
Steffen, please base this on the Jira externalizer and try to externalize as little additional state as possible.  Fyi, we are likely going to create a single generic externalizer sometime in July, and seeing what additional state you need to externalize will be useful
Comment 2 Steffen Pingel CLA 2006-07-05 09:11:21 EDT
Created attachment 45751 [details]
Extension for repository connector and externalizer

The patch includes the externalizer and extension declarations. I'll add a patch for adding of existing tasks later today.
Comment 3 Steffen Pingel CLA 2006-07-05 21:12:51 EDT
Created attachment 45812 [details]
Wizard for adding existing tasks

The wizard class is exactly the same as for Jira and Bugzilla. The implementation of addPage() and getTaskId() could be moved to the super class without a loss of flexibility. That way connectors would not have to extend the wizard but could use the default implementation.

The patch also includes some refactoring of the test fixture stuff for better reusability throughout the test suite.
Comment 4 Steffen Pingel CLA 2006-07-05 21:13:46 EDT
Created attachment 45813 [details]
mylar/context/zip
Comment 5 Mik Kersten CLA 2006-07-05 23:29:11 EDT
Patch applied.  I fixed up the wizard banner and titles, and also pulled up addPage() and getTaskId() as you suggested since all 4 clients had the same implementation.  

Eugene, note that affected your wizard too (no change other than the refactoring).

I tried to add an existing task with http://projects.edgewall.com/trac (anonymous) for id 287 but got the following failure.

org.eclipse.mylar.internal.trac.core.TracException: org.eclipse.mylar.internal.trac.core.TracXmlRpcClient$HttpException: HTTP Error 404
	at org.eclipse.mylar.internal.trac.core.TracXmlRpcClient.call(TracXmlRpcClient.java:78)
	at org.eclipse.mylar.internal.trac.core.TracXmlRpcClient.getTicket(TracXmlRpcClient.java:142)
	at org.eclipse.mylar.internal.trac.TracRepositoryConnector.createTaskFromExistingKey(TracRepositoryConnector.java:157)
	at org.eclipse.mylar.internal.tasklist.ui.wizards.AbstractAddExistingTaskWizard.performFinish(AbstractAddExistingTaskWizard.java:42)

Also, I'm still seeing this failure in AllTracTests:

java.lang.ClassCastException: org.apache.xmlrpc.XmlRpcException
	at org.eclipse.mylar.internal.trac.core.TracXmlRpcClient.getTicket(TracXmlRpcClient.java:142)
	at org.eclipse.mylar.trac.tests.AbstractTracClientSearchTest.testGetTicketInvalidId(AbstractTracClientSearchTest.java:81)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
Comment 6 Steffen Pingel CLA 2006-07-06 08:02:47 EDT
Concerning the first exception: The edgewall repository can not be accessed through XML-RPC (only through the "Trac 0.9 and higher" access type). If you do a "Validate Settings" in the repository settings dialog a message should pop up saying that there is no repository at that location. There is a bug in Trac's repository settings page though, so the access type may not have been correctly set. If have attached a fix to bug 147817. 

Concerning the second exception: Could you check if you are using the latest version (2.0.1) of the org.apache.xmlrpc plug-in?

Comment 7 Eugene Kuleshov CLA 2006-07-06 12:42:52 EDT
Mik, why getAddExistingTaskWizard(TaskRepository repository) is now return Wizard and not IWizard instance?

PS: it is weird, but I couldn't use Bugzilla editor to submit this comment. It says that credentials are invalid and leave the following info message in the Eclipse log.

eclipse.buildId=M20060629-1905
java.version=1.5.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86 -data C:\dev\workspace

Info
Thu Jul 06 12:40:16 EDT 2006
Mylar: Attributes: bug_status=ASSIGNED | resolution= | bug_id=149385 | rep_platform=All | product=Mylar | op_sys=All | component=Core | version=unspecified | priority=P1 | bug_severity=enhancement | assigned_to=steffenp@gmx.de | target_milestone=--- | reporter=steffenp@gmx.de | dependson= | blocked= | bug_file_loc= | newcc= | keywords= | creation_ts=2006-07-01 20:49 | short_desc=Trac connector: implement externalizer and adding of existing tickets | delta_ts=2006-07-05 21:13:46 | cc=eu@md.pp.ru | longdesclength=5 | , source: java.lang.Class
Comment 8 Steffen Pingel CLA 2006-07-06 12:49:55 EDT
(In reply to comment #7)
> PS: it is weird, but I couldn't use Bugzilla editor to submit this comment. It
> says that credentials are invalid and leave the following info message in the
> Eclipse log.

I have hit the same problem each time Eclipse is restarted (I am working boot-strapped out of head). A warning message is displayed "Repository does not have credentials set, verify via Task Repositories View view" forcing me to reenter my credentials.
Comment 9 Mik Kersten CLA 2006-07-06 17:09:28 EDT
Eugene: I made that change to be able to set the title on the wizard that was returned, but now that it's common it's back to IWizard.

Steffen: 
- AllTracTests passes for me, problem was that I didn't have the xmlrpc plug-in synched.  
- I changed settings to 0.9 and higher, and successfully added a ticket, good stuff :)
- Consider removing the "#" from the ticket ID, it's redundant (Bugzilla used to use it too)

Rob: please look problem listed in comment#7 and #8 and advise.
Comment 10 Robert Elves CLA 2006-07-06 19:21:22 EDT
re comment#7, Eugene, when you got that message in your log was it just after a web dialog was displayed showing a bugzilla error? If so was there another entry in the log with an html dump? If so could you fire that to me? Thanks.

re comment#8 Steffen, when you go to the edit repository view are your credentials in fact blank?
Comment 11 Steffen Pingel CLA 2006-07-06 19:31:11 EDT
(In reply to comment #10)
> re comment#8 Steffen, when you go to the edit repository view are your
> credentials in fact blank?

Yes. 
Comment 12 Mik Kersten CLA 2006-07-06 19:39:39 EDT
That indicates the message is correct.  The credentials disappear when changing Eclipse versions.  We should be prompting for them the way CVS does (bug 149607).
Comment 13 Eugene Kuleshov CLA 2006-07-06 20:13:50 EDT
(In reply to comment #12)
> That indicates the message is correct.  The credentials disappear when changing
> Eclipse versions.  We should be prompting for them the way CVS does (bug
> 149607).

Mik, in my case credentials wasn't empty. 

Rob, there was only that message in the log.

Comment 14 Steffen Pingel CLA 2006-07-06 20:21:45 EDT
(In reply to comment #12)
> That indicates the message is correct.  The credentials disappear when changing
> Eclipse versions.  We should be prompting for them the way CVS does (bug
> 149607).

I didn't change Eclipse versions but I did clear the configuration area. That explains my problem (which doesn't seem to be related to Eugene's).

Comment 15 Robert Elves CLA 2006-07-06 20:38:48 EDT
Okay thanks for the confirmation Steffan. 

Eugene, if this persists lets open a new bug report.