rombert / ereviewboard

A mylyn-based Eclipse integration for Review Board
46 stars 31 forks source link

Failed creating new review request : basedir : This field is required. #101

Closed lucianocheng closed 12 years ago

lucianocheng commented 12 years ago

Hi, I am getting this error when I try to create a new Review Request from a SVN project:

Failed creating new review request : basedir : This field is required.

I don't see the basedir parameter anywhere, is it automatically configured? For my project I have the Repository Root and the URL as the same:

https://testserver.lucianocheng.com/svn/prod/testproject/trunk

Stack trace is:

org.review_board.ereviewboard.core.exception.ReviewboardInvalidFormDataException: basedir : This field is required.. at org.review_board.ereviewboard.core.client.RestfulReviewboardReader.checkedGetJSonRootObject(RestfulReviewboardReader.java:97) at org.review_board.ereviewboard.core.client.RestfulReviewboardReader.readDiff(RestfulReviewboardReader.java:452) at org.review_board.ereviewboard.core.client.RestfulReviewboardClient.createDiff(RestfulReviewboardClient.java:561) at org.review_board.ereviewboard.subclipse.internal.wizards.PostReviewRequestWizard$1.run(PostReviewRequestWizard.java:134) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1029) at org.review_board.ereviewboard.subclipse.internal.wizards.PostReviewRequestWizard.performFinish(PostReviewRequestWizard.java:88) at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827) at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432) at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.review_board.ereviewboard.subclipse.internal.actions.CreateReviewRequestAction.run(CreateReviewRequestAction.java:40) at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

rombert commented 12 years ago

The field should be automatically configured. I'm not sure what the problem is.

lucianocheng commented 12 years ago

On PostReviewRequestWizard.java:127, the basePath is calculated as the substring of the projectSvnResource starting at the index of the svnRepository:

https://github.com/rombert/ereviewboard/blob/master/org.review_board.ereviewboard.subclipse.ui/src/org/review_board/ereviewboard/subclipse/internal/wizards/PostReviewRequestWizard.java#L127

If projectSvnResource == svnRepository, this returns the empty string as basePath and throws the error.

I'm not actually a SVN expert, so I'm not sure if this is expected behavior or not. It might be that the projectSvnResource should never equal the svnRepository.

Either way, might be best to throw an error if basePath is the empty string? Please advise.

Thanks!

rombert commented 12 years ago

That's a good catch!

Can you try adding a quick fix to the code , something like

if ( basePath.length() == 0 ) { basePath = "/"; }

?

lucianocheng commented 12 years ago

That appears to fix the problem, but I'm now running into a separate issue where SVNKit is producing diffs with absolute (rather than relative) paths, and I am unable to verify my fix.

I'm working though that issue now, which I believe to be unrelated. Once I can confirm I will send a patch.

Are you aware of any existing issues with SVNKit 1.7x producing absolute paths in the diff? The end result is that reviewboard throws a "File not found" error when trying to publish a review request:

"Failed creating new review request : The file was not found in the repository"

rombert commented 12 years ago

I'm not aware of any issues with SVNKit 1.7.

lucianocheng commented 12 years ago

SVNKit issue is resolved by manually installing the most updated version from the SVNKit website. Probably was a temporary bug that got automatically installed as a eclipse plugin dependency.

http://svnkit.com/download.php

Sent a pull request for the change in PostReviewRequestWizard.java