This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 142594 - Add test dependency will not upgrade project schema
Summary: Add test dependency will not upgrade project schema
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: rmichalsky
URL:
Keywords:
: 143561 144913 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-01 15:57 UTC by Jan Lahoda
Modified: 2008-08-30 05:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample project. (3.78 KB, application/x-compressed)
2008-08-01 15:58 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2008-08-01 15:57:44 UTC
[recent sources]

Have a (old) APISupport project which uses /2 schema. Open it and try to add a test dependency - an error will be shown
(and the dependency will not be added). This is because the project schema is not updated to /3 version before adding
the dependency, producing incorrect project.xml, which is refused after issue #42686.

See attachment for a sample project.
Comment 1 Jan Lahoda 2008-08-01 15:58:38 UTC
Created attachment 66325 [details]
Sample project.
Comment 2 Jesse Glick 2008-08-01 19:25:21 UTC
Yes, the IDE ought to switch the schema in this case.
Comment 3 rmichalsky 2008-08-02 08:27:04 UTC
So any change to project.xml should update to newest schema? Probably with a warning, as user will not open the 
project in older version of NetBeans (which version)? Or adding test dependency is a special case?
Comment 4 Jesse Glick 2008-08-02 10:21:53 UTC
I think it can upgrade the schema quietly. /3 has been supported since the second apisupport patch update to 5.0.
Comment 5 rmichalsky 2008-08-25 13:24:26 UTC
*** Issue 143561 has been marked as a duplicate of this issue. ***
Comment 6 rmichalsky 2008-08-25 13:28:14 UTC
Duplicity is P2.
Comment 7 rmichalsky 2008-08-25 13:28:34 UTC
*** Issue 144913 has been marked as a duplicate of this issue. ***
Comment 8 rmichalsky 2008-08-26 11:38:23 UTC
core-main, #5514a2fc8214
Comment 9 Jesse Glick 2008-08-28 21:00:19 UTC
There does not appear to be any such revision; did you ever push it?
Comment 10 Jesse Glick 2008-08-28 21:06:15 UTC
Fix ought to be simple: in NbModuleProject.putPrimaryConfigurationData, write out in /2 only if the project is already
in /2 *and* XMLUtil.validate works on the result of Util.translateXML. Else write in /3 (i.e. use the method param
unchanged).

Alternately, just always write in /3 and assume that the project will be read by NB 5.1+.
Comment 11 Jesse Glick 2008-08-28 22:39:17 UTC
Take a look at issue #143966.
Comment 12 rmichalsky 2008-08-29 10:07:24 UTC
I haven't pushed it yet, I have some other modified files which I don't want to commit yet, thus I cannot fetch. I've
read at http://wiki.netbeans.org/HgMigrationFollowups that it is encouraged to close bugs even before pushing.

I'll push it ASAP so that you can review the change. I've implemented it only for <test-dependency>, since it was the
only change between /2 and /3. Your suggestion implies that any such change in the future would cause NetBeans to
silently upgrade to newest project schema, right? Is such behavior ok? E.g. user tries new beta of NB, opens his
existing project, plays a bit with it (it is saved automatically) and then cannot open it in his working version of
NB.... Not a big deal, as any real project will be in some VCS, but IMHO not a desired scenario. Maybe I'm just too
defensive :).
Comment 13 rmichalsky 2008-08-29 11:03:46 UTC
changeset #5514a2fc8214 pushed into core-main.
Comment 14 Jesse Glick 2008-08-29 16:10:47 UTC
"I have some other modified files which I don't want to commit yet, thus I cannot fetch" - you can use separate clones
for experimental work, or

http://www.selenic.com/mercurial/wiki/index.cgi/ShelveExtension

(ask me for a patched copy that works with current versions of Hg), or simply save and later reapply a patch. If you
routinely have a lot of changes in progress that you need more time to play with, and want to keep them clearly separate
and tracked, MQ is the most powerful option.


"it is encouraged to close bugs even before pushing" - sure, but it is expected that you will be pushing the fix
sometime in the next day or so. Especially if you are using core-main, where you do not need to run exhaustive tests in
advance.


"in NbModuleProject.putPrimaryConfigurationData, write out in /2 only if the project is already in /2 *and*
XMLUtil.validate works on the result of Util.translateXML" would upgrade the project schema only if it actually had to,
not just for changes you could have made in the old version.
Comment 15 Jesse Glick 2008-08-29 16:11:19 UTC
So I guess this is FIXED then?
Comment 16 Quality Engineering 2008-08-30 05:43:58 UTC
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/5514a2fc8214
User: Richard Michalsky <rmichalsky@netbeans.org>
Log: #142594: adding test dep. to /2 schema project silently switches to /3