Page 1 of 2

Issue 118: Bug Reporting inside Forge lacks checks on Rev

PostPosted: 12 Aug 2011, 19:12
by Braids
Rob Cashwalker wrote:Luckilly, we have switched to SVN, and GIT revision will no longer be a problem.

Thanks to r.9764, the version data can be auto-selected, possibly removed from UI
thanks for noticing. :)

of course, this begs the question: shall I create new fields for subversion rev numbers or repurpose the ones we used for Git?

if BuildInfo.getBuildID() returns null, i would suggest letting the user edit the field. actually, i wouldn't mind implementing this edit: {editing the code for issue 118} once we figure out the answer to the above question. i already implemented it once and had to undo the changes after i disocvered git's limitations.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 12 Aug 2011, 19:15
by Rob Cashwalker
Create new fields. When I get to changing the report screen, I'll match the fields.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 12 Aug 2011, 19:17
by Braids
Rob Cashwalker wrote:Create new fields. When I get to changing the report screen, I'll match the fields.
creating now.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 12 Aug 2011, 19:41
by Braids
created.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 19 Aug 2011, 20:27
by Rob Cashwalker
Trying to use this code:
Code: Select all
String curVer = BuildInfo.getVersion();
Getting an error that getVersion needs to be static.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 19 Aug 2011, 21:02
by Braids
Rob Cashwalker wrote:Trying to use this code:
Code: Select all
String curVer = BuildInfo.getVersion();
Getting an error that getVersion needs to be static.
one must go through the static methods of the Singletons class to get what you want.

Code: Select all
import forge.Singletons;
import forge.model.BuildInfo;

BuildInfo buildInfo = Singletons.getModel().getBuildInfo();
String curVer = buildInfo.getVersion();  // might be "SVN"
String buildID = buildInfo.getBuildID();  // might be null

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 19 Aug 2011, 21:10
by Rob Cashwalker
I get a NPE on
Code: Select all
BuildInfo bi = Singletons.getModel().getBuildInfo();

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 19 Aug 2011, 21:26
by Braids
Rob Cashwalker wrote:I get a NPE on
Code: Select all
BuildInfo bi = Singletons.getModel().getBuildInfo();
the FModel needs to be initialized. if you're not running through forge.view.swing.Main.main, it won't be. if you are, then, try this. please tell me what line the NPE is on.

try chaining less:
Code: Select all
import forge.Singletons;
import forge.model.FModel;  //edit
import forge.model.BuildInfo;

FModel model = Singletons.getModel();
BuildInfo buildInfo = model.getBuildInfo();
String curVer = buildInfo.getVersion();  // might be "SVN"
String buildID = buildInfo.getBuildID();  // might be null

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 20 Aug 2011, 15:28
by Rob Cashwalker
OK.. good point, I was just running the BugzReporter direct.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 20 Aug 2011, 18:34
by Braids
Rob Cashwalker wrote:OK.. good point, I was just running the BugzReporter direct.
i think you can just construct the FModel yourself by passing null to it. . .

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 22 Aug 2011, 18:28
by Rob Cashwalker
I'm back on it now... I just ran Forge using Gui_NewGame so all is initialized. I get "null" for BuildID and "SVN" for Version, while running in eclipse.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 23 Aug 2011, 00:35
by Braids
Rob Cashwalker wrote:I'm back on it now... I just ran Forge using Gui_NewGame so all is initialized. I get "null" for BuildID and "SVN" for Version, while running in eclipse.
yes, that is expected behavior, unless "svnversion" {or svnversion.exe} is in your PATH environment variable in your Eclipse Run Configuration. it tries to get the version from the {manifest of the} jar that it's running inside. it can only do that if it's actually running from a jar, or if there is a forge jar in the CLASSPATH.

my advice would be to make the SVN Revision Detected a text field. if the build ID != null, then set the field's text to the buildID and setEditable(false). otherwise, setEditable(true) and let the user type it in if s/he knows it.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 23 Aug 2011, 16:16
by Rob Cashwalker
Thanks, I'll look into the svnversion thing. It sucks that there's no universal way to do that direct from eclipse/subclipse, because just testing this code means constantly doing Run As -> Maven install, then running java from command line.

BTW, can we ditch the Git fields from mantis?

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 23 Aug 2011, 18:08
by Braids
Rob Cashwalker wrote:Thanks, I'll look into the svnversion thing. It sucks that there's no universal way to do that direct from eclipse/subclipse, because just testing this code means constantly doing Run As -> Maven install, then running java from command line.

BTW, can we ditch the Git fields from mantis?
i'm pretty sure we can hide them. i'll look into it. first i'd like to make sure that anything having a Git Rev Detected has a version detected of Git. similar for Fix Pushed to Git Rev.

Re: Issue 118: Bug Reporting inside Forge lacks checks on Re

PostPosted: 23 Aug 2011, 19:30
by Rob Cashwalker
Mind if I remove Git as a potential version?