| Summary: | Improve Open Correspond Task action | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Eugene Kuleshov <ekuleshov> | ||||||||||||||||||||
| Component: | Mylyn | Assignee: | Eugene Kuleshov <ekuleshov> | ||||||||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||||||||
| Severity: | normal | ||||||||||||||||||||||
| Priority: | P3 | ||||||||||||||||||||||
| Version: | unspecified | ||||||||||||||||||||||
| Target Milestone: | --- | ||||||||||||||||||||||
| Hardware: | PC | ||||||||||||||||||||||
| OS: | Windows XP | ||||||||||||||||||||||
| Whiteboard: | |||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||
|
Description
Eugene Kuleshov
Same error when trying to open correspond resource from svn changeset (subclipse) with linked web repository. java.lang.NullPointerException at org.eclipse.mylar.internal.tasks.web.WebRepositoryConnector.getRepositoryUrlFromTaskUrl(WebRepositoryConnector.java:151) at org.eclipse.mylar.tasks.core.TaskRepositoryManager.getConnectorForRepositoryTaskUrl(TaskRepositoryManager.java:148) at org.eclipse.mylar.internal.tasks.ui.TaskUiUtil.openRepositoryTask(TaskUiUtil.java:143) at org.eclipse.mylar.internal.team.ui.actions.OpenCorrespondingTaskAction.run(OpenCorrespondingTaskAction.java:146) at org.eclipse.mylar.internal.team.ui.actions.OpenCorrespondingTaskAction.run(OpenCorrespondingTaskAction.java:81) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:253) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3463) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3077) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1924) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1888) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:348) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:341) at org.eclipse.core.launcher.Main.basicRun(Main.java:285) at org.eclipse.core.launcher.Main.run(Main.java:987) at org.eclipse.core.launcher.Main.main(Main.java:962) Created attachment 54525 [details]
Reworked Open Correspond Task action
This patch introduce massive refactoring around Open Correspond task action. Now it is working with Subclipse synchronizations and its History view. All old functionality should still work. There is few new methods on connectors to convert urls back and forth. Other plugins can also register own adapters for ILinkedTaskInfo (interface probably should be moved to the core plugin) to make this action work for somewhere else. All old functionality and Subclipse stuff is adapted by LinkedTaskInfoAdapterFactory. I also hooked up svn's issue tracking info. So, repository url resolved from svn info if it is there, though there is still some space for improvement. I still would like to add one more method into connector API to use information about repository to parse comments. For example, for JIRA they could use project ids to build regexps for really really smart comment parsing. Current parsing it is nearly unusable. Created attachment 54527 [details]
Reworked Open Correspond Task action. 2nd take
This should fix classloading issues when Subclipse is not avaialable. Also, added better resolution of the repository url from svn properties.
I reviewed the patch and like the LinedTaskInfo approach. I still need to take a closer look before applying, but before I do that could you post the signature and comment for the additional method that you want on the connector? And yes, I think we should move ILikendTaskInfo into mylar.tasks but I can do that when reviewing the patch. Also, since we are not covered by unit tests here could you verify that the manual tests we have listed for this pass after your refactoring: http://wiki.eclipse.org/index.php/Mylar_Testing#Team (In reply to comment #5) > I reviewed the patch and like the LinedTaskInfo approach. I still need to take > a closer look before applying, but before I do that could you post the > signature and comment for the additional method that you want on the connector? It should take repository (or its url) and a text string and return LikendTaskInfo or an array/collection of those with parsing results. Default implementation can just search for any http urls, and I can look at implementing a special one for JIRA after you'll apply this patch and maybe add this method. We can eventually see if all the code used in bugzilla edtiors to find "bug#xxx" links can be also moved into that method, though then we may need to include all positions/offsets into the LikendTaskInfo. > And yes, I think we should move ILikendTaskInfo into mylar.tasks but I can do > that when reviewing the patch. I wonder if we really need interface? Maybe it could be just LinkedTaskInfo. Then you can also move OpenCorrespondingTask action to the task ui plugin. > Also, since we are not covered by unit tests here could you verify that the > manual tests we have listed for this pass after your refactoring: > http://wiki.eclipse.org/index.php/Mylar_Testing#Team Will do. (In reply to comment #5) > Also, since we are not covered by unit tests here could you verify that the manual tests we have listed for this pass after your refactoring: http://wiki.eclipse.org/index.php/Mylar_Testing#Team Just tested and everything seem working fine. By the way, when you'll be reviewing this patc, can you please check which one of the following calls is more appropriate to open a Task? // TaskUiUtil.openEditor(info.getTask(), false); TaskUiUtil.refreshAndOpenTaskListElement(info.getTask()); Here we are. Patch is stale now. I'm sorry about that Eugene. I couldn't get to it because it too big a change for me to get to for RC1, and I really needed to apply Willian's patch because it changed the UI. But this is on top of my list as soon as RC1 goes out. If you could re-cut the patch it should no longer go stale because we are about to finalize RC1, unless there is a major bug to fix. New dev build uploading now. (In reply to comment #9) > I'm sorry about that Eugene. I couldn't get to it because it too big a change > for me to get to for RC1 I really hoped to get this in RC1, so it would be better tested... Will cut a patch again in a minute Created attachment 54587 [details]
Updating stale patch
Note that attachement submission is still not working for me even with the last dev build.
Mik, Rob, I can barely work on anything else with such huge patch sitting in my workspace. :-( Patch applied but not verified. I moved the Subclipse stuff to org.eclipse.mylar.internal.sandbox.team.SubclipseLinkedTaskInfoWrapper, but had to comment that class out until there is a way of consuming that dependency without forcing a check-out of Subclipse. Created attachment 54696 [details]
Second iteration
This is second iteration. I changed most (if not all) menu contributions to use adaptable class, removed all subclipse dependencies, added new connector method for repository-specific parsing comments and implemented version for jira.
Mik, Rob, I hope you can review and apply this one too. New plugin for Subclipse will be in the next attachment.
Created attachment 54697 [details]
Subclipse integration for Mylar
Created attachment 54698 [details]
mylar/context/zip
TODO move adapter factory into the extension point:
<extension point="org.eclipse.core.runtime.adapters">
<factory class="com.xyz.MyFileAdapterFactory"
adaptableType="org.eclipse.core.resources.IFile">
<adapter type="com.xyz.MyFile"/>
</factory>
</extension>
Created attachment 54925 [details]
updating stale patch
Patch applied. This gets rid of our Subclispe support, so I assume that you will be making a patch to Subclipse to ensure that 1.0 supports it? If so we will need to ensure that we let the existing users know of the update instructions. (In reply to comment #19) > Patch applied. This gets rid of our Subclispe support, Hallelujah! That is totally awesome! > so I assume that you will be making a patch to Subclipse to ensure > that 1.0 supports it? I already did. Have you had a chance to look at the plugin I attached here? https://bugs.eclipse.org/bugs/attachment.cgi?id=54697 > If so we will need to ensure that we let the existing users know > of the update instructions. I was wondering if we can link Sublipse update site from Mylar update site... and in the future we can continue such practice and link other 3rd party plugins integrated with mylar. Mik, there is a showstopper issue that holds me from completing this. Class org.eclipse.mylar.internal.team.ILinkedTaskInfo should be made an API and maybe moved into org.eclipse.mylar.tasks.core plugin. Here is complete list of dependencies required for new Subclipse plugin: org.eclipse.mylar.tasks.core, org.eclipse.mylar.tasks.ui, org.eclipse.mylar.team, The only class used from org.eclipse.mylar.tasks.ui is the TasksUiPlugin in order to get list of all repositories to matching repository for svn url (which can be longer then repository URL) So, SubclipseLinkedTaskInfo class is calling TasksUiPlugin.getRepositoryManager().getAllRepositories(). Yes, we should be able to link the site via the discovery site mechanism, and this is something I have always imaged we would have too. Please open a new bug for that, hopefully we can have it working for 1.0. I moved ILinkedTaskInfo into ..mylar.tasks.core, it doesn't belong in context.core but seems fine to have as API there. Regarding the TasksUiPlugin, is that dependency a problem? Note sure if we will be able to move the repository management into tasks.core quickly enough, but let me know. Created attachment 55032 [details]
Fixed an NPE
Created attachment 55033 [details]
mylar/context/zip
Patch applied. |