Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 274193 - [publisher] ConfigCUsAction creates incorrect entries when used with multiple products
Summary: [publisher] ConfigCUsAction creates incorrect entries when used with multiple...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M7   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-28 18:07 EDT by Thomas Hallgren CLA
Modified: 2009-04-29 16:49 EDT (History)
2 users (show)

See Also:


Attachments
Patch to included id and version in the call to getAdvice() (1.48 KB, patch)
2009-04-28 18:09 EDT, Thomas Hallgren CLA
no flags Details | Diff
updated patch (8.25 KB, patch)
2009-04-29 03:03 EDT, Ian Bull CLA
no flags Details | Diff
Patch for ConfigCUsActionTest with updated IPublisherInfo mock (1.64 KB, patch)
2009-04-29 03:03 EDT, Thomas Hallgren CLA
no flags Details | Diff
attaching my patch again (8.25 KB, patch)
2009-04-29 03:08 EDT, Ian Bull CLA
aniefer: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Hallgren CLA 2009-04-28 18:07:18 EDT
The ConfigCUsAction gets confused when publishing from a source that contains several products, resulting in incorrect touchpointData entries. Typically, all such entries contains setProgramProperty calls for one and the same product/application throughout the repository although they belong to different CU's.

The error seem to stem from the fact that the ConfigCUsAction.perform() method calls on info.getAdvice() with the id and version arguments set to null. The advice that is returned therefore contains advice related to all products instead of just the product that the action was created for.
Comment 1 Thomas Hallgren CLA 2009-04-28 18:09:11 EDT
Created attachment 133654 [details]
Patch to included id and version in the call to getAdvice()

Using this patch, I now able to publish my products again.
Comment 2 Thomas Hallgren CLA 2009-04-28 18:10:57 EDT
Would be great to get this in for M7 since the Buckminster build is dependent on the publisher.
Comment 3 Ian Bull CLA 2009-04-28 18:14:34 EDT
Thomas, did you test the patch?  Does it solve your problem?  (or is there a possibility that there is more going on here).
Comment 4 Thomas Hallgren CLA 2009-04-28 18:19:42 EDT
The patch solves my immediate problem. I'm able to publish a product, install it with the director, and then run it.

But there are more things that needs looking into. I seem to get the root files from all products into the one that I installed. Perhaps that's a similar problem? I'll check.
Comment 5 Thomas Hallgren CLA 2009-04-28 19:10:18 EDT
I found the cause of my second problem.

Product p.a includes feature f.a
Product p.b includes feature f.b and f.a

f.a and f.b both declare root files. Those root files are correctly copied so I'm to blame for that :-)

So please apply the patch.
Comment 6 Andrew Niefer CLA 2009-04-28 19:29:55 EDT
Need to make sure all of pde.build.test/PublishingTests pass before releasing.  Monday there was a publisher change that broke a couple of these tests.
Comment 7 Ian Bull CLA 2009-04-28 19:35:28 EDT
it would also be good to have a regression test around this.
Comment 8 Ian Bull CLA 2009-04-29 03:03:06 EDT
Created attachment 133692 [details]
updated patch

I have updated Thoma's patch to
1. Fix a problem with EasyMock (the tests were not passing when the patch was applied)
2.  I added a regression test.
Comment 9 Thomas Hallgren CLA 2009-04-29 03:03:42 EDT
Created attachment 133693 [details]
Patch for ConfigCUsActionTest with updated IPublisherInfo mock

I found one P2 test that failed due to an IPublisherInfo mock that expected the former null arguments. The patch contains a fix for this.

(In reply to comment #6)
> Need to make sure all of pde.build.test/PublishingTests pass before releasing. 
> Monday there was a publisher change that broke a couple of these tests.
> 
All tests included in the PDEBuildTestSuite pass except this PublishingTests:

testBug264743_PublishExecutable

but this test fails *regardless of the patch* with the following trace:

/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/scripts/build.xml:25: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/scripts/build.xml:84: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/templates/headless-build/customTargets.xml:110: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/templates/headless-build/customTargets.xml:46: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/templates/headless-build/customTargets.xml:12: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/templates/headless-build/allElements.xml:16: The following error occurred while executing this line:
/home/thhal/tools/3.5Integration/eclipse/plugins/org.eclipse.pde.build_3.5.0.v200904271100/scripts/genericTargets.xml:62: The following error occurred while executing this line:
java.io.FileNotFoundException: /home/thhal/workspaces/junit-workspace/pde.build/264743/build1/features/ee/build.xml (No such file or directory)
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:418)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor481.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:623)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:495)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513)
	at org.eclipse.pde.build.tests.PDETestCase.runAntScript(PDETestCase.java:131)
	at org.eclipse.pde.build.tests.PDETestCase.runAntScript(PDETestCase.java:124)
	at org.eclipse.pde.build.tests.PDETestCase.runBuild(PDETestCase.java:106)
	at org.eclipse.pde.build.internal.tests.p2.PublishingTests.testBug264743_PublishExecutable(PublishingTests.java:1040)
Comment 10 Ian Bull CLA 2009-04-29 03:06:47 EDT
Thomas, the patch I posted in comment 8 fixes this problem.  
Comment 11 Thomas Hallgren CLA 2009-04-29 03:07:38 EDT
Ian, forget my last patch. Your patch fixes the problem too. We posted them the very same minute. Oddly enough, I didn't get a bugzilla conflict.
Comment 12 Ian Bull CLA 2009-04-29 03:08:54 EDT
Created attachment 133695 [details]
attaching my patch again

I'm attaching my patch again so it's at the end of the list (easier for someone to find and apply)
Comment 13 Andrew Niefer CLA 2009-04-29 10:04:30 EDT
Thomas, can you still reproduce the failure in comment #9?
This test passes for me, I wonder if your failure is the same as what is seen in bug 273579.   Would you mind diagnosing this a little? We should probably open a new bug.
Can you see if 
/home/thhal/workspaces/junit-workspace/pde.build/264743/build1/features/ee exists? (It should have been populated from the contents of org.eclipse.pde.build.tests/resources/264743).
Is the build.xml there?
What happened in FeatureBuildScriptGenerator.generate() : openScript & closeScript().
Comment 14 Thomas Hallgren CLA 2009-04-29 16:21:38 EDT
Any chance of getting this in for M7? I'd like the publisher to play a key when automating the EPP stuff :-)
Comment 15 Andrew Niefer CLA 2009-04-29 16:49:13 EDT
done