Bug 436950 - [target][p2] Update function of target editor does not re-resolve target
Summary: [target][p2] Update function of target editor does not re-resolve target
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: All All
: P3 critical with 1 vote (vote)
Target Milestone: 4.4.1   Edit
Assignee: Vikas Chandra CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 439011 (view as bug list)
Depends on:
Blocks: 438751
  Show dependency tree
 
Reported: 2014-06-09 06:05 EDT by Stephan Eberle CLA
Modified: 2017-01-27 04:15 EST (History)
7 users (show)

See Also:


Attachments
File to recreate (443 bytes, application/octet-stream)
2014-06-11 14:34 EDT, Vikas Chandra CLA
no flags Details
Fix for this issue. (640 bytes, patch)
2014-06-11 14:46 EDT, Vikas Chandra CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Eberle CLA 2014-06-09 06:05:16 EDT
= Steps to reproduce =

* Open a target file based on p2 update sites with outdated feature versions in the target editor

Observation: target editor shows error complaining about first non-existing feature it is unable to spot => OK

* Select the p2 update site that contains to outdated feature in the target editor and click on the Update button

Expected: 
a) Outdated features get updated
b) Target editor becomes dirty
c) Target editor starts a new attempt to resolve the target definition

Actual:
a), b): OK
b): NOK, nothing happens and the previously displayed errors stay there

Observation/workaround: When opening the target file in a text editor, increasing the sequence number in the <?pde ...> header by one and saving the file, the target editor restarts resolving and removes all previously displayed errors once the resolution process has been successfully completed.
Comment 1 Curtis Windatt CLA 2014-06-09 10:02:33 EDT
The update button should be increasing the sequence number, this could have been broken with changes in 4.4 or something else may be affecting it.
Comment 2 Vikas Chandra CLA 2014-06-11 14:34:16 EDT
Created attachment 244167 [details]
File to recreate

1) Open the file attached in target definition editor
2) Click on the location.
3) Click update button on the side
Comment 3 Vikas Chandra CLA 2014-06-11 14:46:18 EDT
Created attachment 244168 [details]
Fix for this issue.

Hi Curtis, Can you please look if this is the most optimum solution. There are other tools/functions like synchronizers (P2TargetUtils synchronizer = getSynchronizer(target);) and resolve but resetting Targeting location after an update seems the easiest way to solve this.
Comment 4 Curtis Windatt CLA 2014-07-02 11:47:35 EDT
(In reply to Vikas Chandra from comment #3)
> Created attachment 244168 [details]
> Fix for this issue.
> 
> Hi Curtis, Can you please look if this is the most optimum solution. There
> are other tools/functions like synchronizers (P2TargetUtils synchronizer =
> getSynchronizer(target);) and resolve but resetting Targeting location after
> an update seems the easiest way to solve this.

The only drawback to resetting the target locations is that it clears any cached information.  Specifically it clears the cached features.

All we want to update is the p2 locations, which is done via the sequence number.  The easiest way to increment the sequence number is to call TargetDefinition.incrementSequenceNumber().

While I would prefer to use API methods, I think it makes more sense to directly call incrementSequenceNumber() over replacing all the target locations.
Comment 5 Curtis Windatt CLA 2014-07-02 12:13:39 EDT
http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?h=R4_4_maintenance&id=37afa4b85f29b7ff7c220cde378dd5dce1e96ddd

Fixed in R4_4_maintenance

Opened bug 438751 for the 4.5 fix.

Vikas, please verify in a 4.4.1 M build.
Comment 6 Matthias Sohn CLA 2014-07-04 05:01:58 EDT
(In reply to Curtis Windatt from comment #5)
> http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/
> ?h=R4_4_maintenance&id=37afa4b85f29b7ff7c220cde378dd5dce1e96ddd
> 
> Fixed in R4_4_maintenance
> 
> Opened bug 438751 for the 4.5 fix.
> 
> Vikas, please verify in a 4.4.1 M build.

where can I find a 4.4.1 build ?
Comment 7 Tobias Oberlies CLA 2014-07-08 08:11:39 EDT
*** Bug 439011 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2014-07-08 10:51:39 EDT
(In reply to Matthias Sohn from comment #6)
> (In reply to Curtis Windatt from comment #5)
> > http://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/
> > ?h=R4_4_maintenance&id=37afa4b85f29b7ff7c220cde378dd5dce1e96ddd
> > 
> > Fixed in R4_4_maintenance
> > 
> > Opened bug 438751 for the 4.5 fix.
> > 
> > Vikas, please verify in a 4.4.1 M build.
> 
> where can I find a 4.4.1 build ?

We start the M-builds this Wednesday. You'll find them here:
http://download.eclipse.org/eclipse/downloads/
Comment 9 Vikas Chandra CLA 2014-08-29 14:22:15 EDT
Verified in Version: Luna SR1 (4.4.1)
Build id: M20140827-1200