Issue 118: Bug Reporting inside Forge lacks checks on Rev
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
19 posts
• Page 1 of 2 • 1, 2
Issue 118: Bug Reporting inside Forge lacks checks on Rev
by Braids » 12 Aug 2011, 19:12
thanks for noticing.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

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
Last edited by Braids on 12 Aug 2011, 19:16, edited 1 time in total.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 12 Aug 2011, 19:15
Create new fields. When I get to changing the report screen, I'll match the fields.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 12 Aug 2011, 19:17
creating now.Rob Cashwalker wrote:Create new fields. When I get to changing the report screen, I'll match the fields.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 12 Aug 2011, 19:41
created.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 19 Aug 2011, 20:27
Trying to use this code:
- Code: Select all
String curVer = BuildInfo.getVersion();
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 19 Aug 2011, 21:02
one must go through the static methods of the Singletons class to get what you want.Rob Cashwalker wrote:Trying to use this code:Getting an error that getVersion needs to be static.
- Code: Select all
String curVer = BuildInfo.getVersion();
- 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
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 19 Aug 2011, 21:10
I get a NPE on
- Code: Select all
BuildInfo bi = Singletons.getModel().getBuildInfo();
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 19 Aug 2011, 21:26
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.Rob Cashwalker wrote:I get a NPE on
- Code: Select all
BuildInfo bi = Singletons.getModel().getBuildInfo();
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
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 20 Aug 2011, 15:28
OK.. good point, I was just running the BugzReporter direct.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 20 Aug 2011, 18:34
i think you can just construct the FModel yourself by passing null to it. . .Rob Cashwalker wrote:OK.. good point, I was just running the BugzReporter direct.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 22 Aug 2011, 18:28
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.
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 23 Aug 2011, 00:35
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.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.
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.
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 23 Aug 2011, 16:16
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?
BTW, can we ditch the Git fields from mantis?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Braids » 23 Aug 2011, 18:08
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.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?
"That is the dumbest thing I've ever seen." --Rob Cashwalker, regarding Innistrad double-sided cards. One of the first times he and I have ever agreed on something. 

-
Braids - Programmer
- Posts: 556
- Joined: 22 Jun 2011, 00:39
- Location: Unknown. Hobby: Driving myself and others to constructive madness.
- Has thanked: 1 time
- Been thanked: 1 time
Re: Issue 118: Bug Reporting inside Forge lacks checks on Re
by Rob Cashwalker » 23 Aug 2011, 19:30
Mind if I remove Git as a potential version?
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
19 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 45 guests