Bug 27412 - need more install lifecycle
Summary: need more install lifecycle
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Update (deprecated - use Eclipse>Equinox>p2) (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Christophe Elek CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 27359
  Show dependency tree
 
Reported: 2002-11-29 11:23 EST by Jeff McAffer CLA
Modified: 2002-12-04 09:39 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2002-11-29 11:23:42 EST
see bug 27359

the core boot part of update currently can recognize when a new feature is laid 
down in an install.  When it discovers this, it passes -newUpdates on the 
command line to the rest of the platform startup.  The workbench looks for this 
and when it sees the flag, runs the update UI to ask the user if they want to 
install the newly laid down features.

After this the platform is restarted.  The workbench's job however is not over. 
It still has to discover new prespectives, open the welcome page, etc. To do 
this they ask update core some questions.  This causes a lot of code to be 
loaded and work to be done.  This is ok if it is only done the first time after 
a feature is *installed*.  Unfortuatnely, there is no lifecycle that tells the 
workbench so they have to do the code on every startup.  99% of the time there 
are no new features so the work was wasted and the code needlessly loaded.

So, the question.
Is it possible for the core part of update to generate the desired lifecycle 
(say as a -installedUpdates) which the workbench (or others) could use to tell 
if they need to do the work described.  Basically update would need to remember 
a token (hash or something) representing the last run and compare it to the has 
for the current run.  If they are different then updates were installed.  (that 
about over extends my limited knowledge of how this code works :-)
Comment 1 Eduardo Pereira CLA 2002-11-29 16:39:21 EST
Bug 27359 is marked for M4 but it depends on this bug. Should we mark this one 
for M4 as well?
Comment 2 Christophe Elek CLA 2002-11-29 16:52:26 EST
Let me restate what I undertsood, tell me if this is valid

UI wants to be triggered after new feature have been enabled so UI can find if
the new feature contribute to perspective and other ui extension point.

I am wondering, is it different than the algorithm we use to refresh the plugin
repository structure in core?  So UI can get our hash from platform.cfg (the
feature hash) and compare it with the previous one they saved ?

Thoughts ?
Comment 3 Christophe Elek CLA 2002-11-29 16:55:22 EST
BootLoader.getCurrentPlatformConfiguration().getFeaturesChangeStamp() returns
the hash of configured features. This does not involve update.core.
Comment 4 Nick Edgar CLA 2002-12-02 11:26:03 EST
Sounds like a good suggestion.  The workbench could simply remember the last 
features change stamp, and only check Update Core for new features if it has 
changed.  This would eliminate most of the checks.  Unfortunately it would not 
eliminate the check the first time Eclipse is started though, unless there's 
some other special flag for this case.

Comment 5 Christophe Elek CLA 2002-12-02 13:01:33 EST
can you elaborate re the first time ? If you do not have any state, it means it
is the first time no ?
Comment 6 Nick Edgar CLA 2002-12-02 13:37:09 EST
Good point <g>.
Comment 7 Eduardo Pereira CLA 2002-12-02 14:14:22 EST
Added the fix based on getFeaturesChangeStamp(). The update plugin will be 
activated the first time the workbench is started because we need to build a 
collection with all features and open the welcome pages.
Comment 8 Nick Edgar CLA 2002-12-02 14:27:07 EST
I thought we just presented the main product's welcome page on first start?

Comment 9 Nick Edgar CLA 2002-12-04 09:39:22 EST
Looks like we don't need the extra lifecycle after all.