| Summary: | BugzillaRepositoryConnector.getTaskData() fails when repository URL has trailing slash and no path | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Alex Bradley <a.bradley> | ||||||||
| Component: | Mylyn | Assignee: | Frank Becker <eclipse> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | minor | ||||||||||
| Priority: | P3 | CC: | eclipse, robert.elves, steffen.pingel | ||||||||
| Version: | unspecified | ||||||||||
| Target Milestone: | 3.7 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Alex Bradley
Created attachment 198153 [details]
Test case
Created attachment 198154 [details]
Test case output and stack traces
(In reply to comment #0) > no path (e.g., https://bugzlla.mozilla.org/), an exception is thrown. It seems Sorry, URL should read "https://bugzilla.mozilla.org/". Also, my version of org.eclipse.mylyn.bugzilla.core is 3.5.0.v20110316-0100. How did you set the URL? If you use the EditRepositoryWizard the Slashes get removed by AbstractRepositorySettingsPage.getRepositoryURL. (In reply to comment #4) > How did you set the URL? > > If you use the EditRepositoryWizard the Slashes get removed by > AbstractRepositorySettingsPage.getRepositoryURL. I set the URL by calling the TaskRepository constructor, as shown in the test case. I'm trying to use the Bugzilla connector through the Mylyn API (for a plugin of my own); I'm not accessing it through the Mylyn UI. (In reply to comment #5) > (In reply to comment #4) > > How did you set the URL? > > > > If you use the EditRepositoryWizard the Slashes get removed by > > AbstractRepositorySettingsPage.getRepositoryURL. > > I set the URL by calling the TaskRepository constructor, as shown in the test > case. I'm trying to use the Bugzilla connector through the Mylyn API (for a > plugin of my own); I'm not accessing it through the Mylyn UI. Sorry I see no way how we can change this. The reason is that TaskRepository Constructor is not Bugzilla specific so we can not add code to remove tailing slashes. If you not use the UI you must do this your own. (In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #4) > > > How did you set the URL? > > > > > > If you use the EditRepositoryWizard the Slashes get removed by > > > AbstractRepositorySettingsPage.getRepositoryURL. > > > > I set the URL by calling the TaskRepository constructor, as shown in the test > > case. I'm trying to use the Bugzilla connector through the Mylyn API (for a > > plugin of my own); I'm not accessing it through the Mylyn UI. > > Sorry I see no way how we can change this. The reason is that TaskRepository > Constructor is not Bugzilla specific so we can not add code to remove tailing > slashes. I don't see how the generality of TaskRepository necessarily implies that conclusion. I tend to agree with bug#211938 that "[the stripping of trailing slash in repository urls] should be encapsulated in the TaskRepository object itself". Stripping the trailing slash from a URL doesn't change its meaning (and therefore shouldn't break any other connector), and doing it centrally in the TaskRepository seems better than doing ad hoc slash removal in every UI that uses TaskRepository. If you don't want to change TaskRepository, can't you at least modify BugzillaClient so it doesn't handle URLs with trailing slashes in a way that causes an exception? What about modifying WebUtil.getRequestPath so it collapses "//" at the beginning of resulting request paths into a single "/"? Fundamentally, an API that claims to accept URLs shouldn't crash when you pass it perfectly valid URLs. Agreed, we should evaluate if BugzillaClient to handle that case more gracefully or update the documentation. Here is what I have commit, can you please verify? (http://git.eclipse.org/c/mylyn/org.eclipse.mylyn.tasks.git/commit/?id=9e71937c527fc44eb9c2eb7d00d7357dcbd11898) Created attachment 200311 [details]
mylyn/context/zip
(In reply to comment #9) > Here is what I have commit, can you please verify? > > (http://git.eclipse.org/c/mylyn/org.eclipse.mylyn.tasks.git/commit/?id=9e71937c527fc44eb9c2eb7d00d7357dcbd11898) Looks OK to me, and I can confirm that my test cases pass with this fix. We can close this see comment#11 |