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

Bug 150890

Summary: Trac repository connector should handle trailing slash
Product: z_Archived Reporter: Eugene Kuleshov <ekuleshov>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Strips slashes from repository url
none
mylar/context/zip none

Description Eugene Kuleshov CLA 2006-07-17 19:33:22 EDT
Track repository connector does not allow to have repository URl without trailing back slash.

PS: BTW, we need separate components in Bugzilla for Trac and Web repository connectors
Comment 1 Steffen Pingel CLA 2006-07-19 07:19:29 EDT
I do not allow trailing slashes for Trac repository urls because a slash is appended by the connector when requests are made. Why do we need to support this?
Comment 2 Eugene Kuleshov CLA 2006-07-19 08:44:26 EDT
(In reply to comment #1)
> I do not allow trailing slashes for Trac repository urls because a slash is
> appended by the connector when requests are made. Why do we need to support
> this?

It is just beter user experience. You can cut that slash on save or do smarter concatenation if slash already there, so it would be transparent to the user. 

Comment 3 Mik Kersten CLA 2006-07-20 06:44:07 EDT
Steffen: as Eugene indicates the user shouldn't have to care about the trailing slash, so just turn it into the form you're expecting if it is missing.
Comment 4 Steffen Pingel CLA 2006-07-20 18:31:45 EDT
If I remove all trailing slashes before saving the task repository object this may be a bit odd because the user would expect to see exactly the entered url and not some normalized version. 

If I allow trailing slashes and remove the slashes when connecting to the repository this may cause i ambiguity. Two repositories e.g http://trac.edgewall.org/ and http://trac.edgewall.org could be created which would both share the same task handles e.g. "http://trac.edgewall.org/ticket/1-1".

Mik, do you have any preference on how to solve this? How does Bugzilla handle this?
Comment 5 Mik Kersten CLA 2006-07-20 22:18:23 EDT
Allow the user to enter the trailing slash, but do not save it, e.g. by adding a stripTralingSlash(String) method.  As you indicate we would never want two repositories of that kind.  Put the code for stripping it into tasks.core, since this behavior should be generic.
Comment 6 Mik Kersten CLA 2006-07-28 14:35:13 EDT
This is guaranteed to cause users to think that the Trac connector isn't working (e.g. bug 151077), and while not critical would be best to fix for 0.6.1.  If not fixed the FAQ entry needs to be updated: http://wiki.eclipse.org/index.php/Mylar_FAQ#Trac_Connector_troubleshooting
Comment 7 Steffen Pingel CLA 2006-07-28 15:00:00 EDT
(In reply to comment #6)
> This is guaranteed to cause users to think that the Trac connector isn't
> working (e.g. bug 151077), and while not critical would be best to fix for
> 0.6.1.  

Actually it should not be possible to create repositories with a trailing slash although this can be circumvented easily be adding a space. I'll look into getting this fixed as suggested in comment #5 today.

Comment 8 Steffen Pingel CLA 2006-07-28 18:27:29 EDT
Created attachment 46989 [details]
Strips slashes from repository url

The patch removes trailing slashes and whitespaces from the repository url when saving the url. Some of the test cases failed when running AllTests but I don't think the errors are related to the patch.
Comment 9 Mik Kersten CLA 2006-07-28 19:27:29 EDT
Patch applied and AllTests pass.  I see problems with DuplicateDetectionTest and am looking into that now...
Comment 10 Mik Kersten CLA 2006-07-28 19:27:47 EDT
Created attachment 46991 [details]
mylar/context/zip