Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 265198 - [target] make sure we warn about forward compatibility
Summary: [target] make sure we warn about forward compatibility
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: 3.6 M1   Edit
Assignee: Ankur Sharma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-17 14:24 EST by Chris Aniszczyk CLA
Modified: 2009-07-29 11:39 EDT (History)
2 users (show)

See Also:


Attachments
Patch (6.03 KB, patch)
2009-07-27 06:38 EDT, Ankur Sharma CLA
curtis.windatt.public: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2009-02-17 14:24:20 EST
In the current target platform preference page, we added some logic to warn people if they were developing against a target platform in the future. That is, if you are running Eclipse 3.4, and pointing to a 3.5 target... that's evil. We should provide some type of warning for this case in the new target story.
Comment 1 Chris Aniszczyk CLA 2009-02-17 14:25:34 EST
I believe the logic we used is to get the version of org.eclipse.osgi in the running instance and make sure that there were no major/minor version bumps in the target. This couples us with Equinox for now but that's fine, in the future, we can look at system bundle versions.
Comment 2 Curtis Windatt CLA 2009-02-17 14:39:01 EST
I would want to keep this out of the core model code if possible.  Best place I can think of is just before we do the LoadTargetOperation (preference page performOK() and the link action on the editor).  In both cases there is an opportunity to do some special code before the operation is run.

We could put in a check that would prompt the user warning them of potential problems.

In the preference page we actually do a resolution before closing the page and running the operation, so implementing the check would be a quick search of the target's bundles to get the osgi bundle version.

Comment 3 Chris Aniszczyk CLA 2009-03-09 15:06:55 EDT
Let's look at this in M7... we need to do this otherwise people will be stupid again :/
Comment 4 Curtis Windatt CLA 2009-07-06 14:39:29 EDT
I'll see if there is a simple way to add a warning.
Comment 5 Chris Aniszczyk CLA 2009-07-06 14:41:58 EDT
There should be some code left over in TargetPlatformHelper that does this.

If I recall, we simply check the host and target versions of org.eclipse.osgi... this should work for 99% of the cases...
Comment 6 Ankur Sharma CLA 2009-07-23 16:34:58 EDT
quick question - "warn" means warning dialog or warning marker in Problems view or both?
Comment 7 Chris Aniszczyk CLA 2009-07-23 18:24:35 EDT
If you could do both, that would be fine, although I'm OK with just the dialog for now.
Comment 8 Ankur Sharma CLA 2009-07-27 04:03:38 EDT
I am leaving out the markers. They are just too much a hustle. Firstly, it would make sense only to report on the workspace file targets. Creating them was easy, but to clean them, I need to touch target editor and wizard. Too much housekeeping for fairly not so frequent use case. For now, it just a message box warning.

Let me know if you think otherwise.
Comment 9 Ankur Sharma CLA 2009-07-27 06:38:12 EDT
Created attachment 142638 [details]
Patch

Added a check against version of 'org.eclipse.osgi' bundle.
Comment 10 Curtis Windatt CLA 2009-07-29 11:38:06 EDT
Fixed in HEAD.  Changed the wording and a few other things.  Ankur, if you create a job listener, make sure you check the job result before doing things like opening a dialog.  Otherwise you end up running your code even if the job was cancelled or failed.

There are still two problems with this fix.  1) The dialog is parented to the workbench, so if you have another dialog open (such as the pref dialog staying open because you hit apply) the dialog could end up showing up behind the other.  2) The version test has to wait until resolution is complete so we don't warn the user right away.