Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343898 - Errors while resolving a baseline inside ant tasks should be reported somehow
Summary: Errors while resolving a baseline inside ant tasks should be reported somehow
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: API Tools (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-26 15:08 EDT by Olivier Thomann CLA
Modified: 2011-04-28 12:34 EDT (History)
2 users (show)

See Also:
Michael_Rennie: review+


Attachments
Proposed fix (3.79 KB, patch)
2011-04-26 20:39 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (3.36 KB, patch)
2011-04-27 12:42 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (9.22 KB, patch)
2011-04-27 16:41 EDT, Olivier Thomann CLA
no flags Details | Diff
First jar (167.17 KB, application/octet-stream)
2011-04-27 16:43 EDT, Olivier Thomann CLA
no flags Details
Second jar (167.56 KB, application/octet-stream)
2011-04-27 16:43 EDT, Olivier Thomann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2011-04-26 15:08:02 EDT
Using HEAD, I got many problems with unresolved bundles inside an API baseline initialized using an SDK zip.

I took me lots of time to realize that all problems came from missing Execution Environments set up in my self-hosting workspace.

The ant task should report this to the user somehow. I would say all resolved errors for a state should be reported because unresolved bundles or resolved errors will have a direct impact on the accuracy of the API tools analysis.
Comment 1 Michael Rennie CLA 2011-04-26 15:23:36 EDT
Perhaps we could just support the skipped component mechanism we have for the analysis / use tasks. Basically if we detect an API component with ResolverErrors we dump it to a listing of SkippedComponents and write out the not_searched.xml file. That way the freeze check could report components that could not be checked and continue scanning, then the freeze report converter can notify the user however it pleases using the not_searched.xml file.
Comment 2 Olivier Thomann CLA 2011-04-26 19:58:24 EDT
I think simply dumping the list of errors per bundle in the console in debug mode is good enough for now.
Comment 3 Olivier Thomann CLA 2011-04-26 20:36:22 EDT
With the patch, I am getting:
[apitooling.apifreeze] Errors for component : org.eclipse.ecf
[apitooling.apifreeze] Missing Constraint: Require-Bundle: org.eclipse.ecf.identity; bundle-version="0.0.0"
[apitooling.apifreeze] Errors for component : org.eclipse.ecf.provider.filetransfer
[apitooling.apifreeze] Missing Constraint: Require-Bundle: org.eclipse.ecf; bundle-version="0.0.0"
[apitooling.apifreeze] Errors for component : org.eclipse.ecf.filetransfer
[apitooling.apifreeze] Missing Constraint: Require-Bundle: org.eclipse.ecf; bundle-version="0.0.0"
[apitooling.apifreeze] Errors for component : org.eclipse.equinox.p2.transport.ecf
[apitooling.apifreeze] Missing Constraint: Require-Bundle: org.eclipse.ecf; bundle-version="3.1.0"
[apitooling.apifreeze] Errors for component : org.eclipse.ecf.provider.filetransfer.httpclient
[apitooling.apifreeze] Missing Constraint: Require-Bundle: org.eclipse.ecf.provider.filetransfer; bundle-version="0.0.0"

This would have been good enough for me to find out that something was wrong with my configuration.
Comment 4 Olivier Thomann CLA 2011-04-26 20:39:32 EDT
Created attachment 194116 [details]
Proposed fix

If we don't dump the bundles with errors inside a specific file, we can get rid of the set where I store the api components.
Comment 5 Olivier Thomann CLA 2011-04-27 12:42:48 EDT
Created attachment 194182 [details]
Proposed fix

Simplified patch that removes the usage of a Set to store the bundles with errors.
This simply dumps the errors found to the console to help the user to find out that something is bad with his/her configuration.
Comment 6 Olivier Thomann CLA 2011-04-27 12:43:13 EDT
Michael, please review.
Comment 7 Michael Rennie CLA 2011-04-27 14:29:18 EDT
The patch looks good to me.

I think we should add this in for 3.7M7 to ensure that the freeze report is accurate (so we do not try to scan bundles with ResolverErrors)
Comment 8 Michael Rennie CLA 2011-04-27 15:00:11 EDT
running the test suite on the patch I get three failures (test1, test2, test3):

API Tools Plugin Test Suite
org.eclipse.pde.api.tools.tests.ApiToolsPluginTestSuite
org.eclipse.pde.api.tools.anttasks.tests.ApiToolsAntTasksTestSuite
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests
test1(org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests)
junit.framework.AssertionFailedError: report.xml must exist
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.assertTrue(Assert.java:20)
	at org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests.runTaskAndVerify(ApiToolingApiFreezeAntTaskTests.java:53)
<snip>
Comment 9 Michael Rennie CLA 2011-04-27 15:02:32 EDT
the test bundle has the following ResolverError:

Missing Constraint: Require-Bundle: org.eclipse.ui; bundle-version="0.0.0"
Comment 10 Olivier Thomann CLA 2011-04-27 16:41:53 EDT
Created attachment 194211 [details]
Proposed fix

When the scopes are used, the bundle version errors were not reported.
Comment 11 Olivier Thomann CLA 2011-04-27 16:43:12 EDT
Created attachment 194212 [details]
First jar

First jar to dump into org.eclipse.pde.api.tools.tests\test-anttasks\apitooling.apifreeze\profile
Comment 12 Olivier Thomann CLA 2011-04-27 16:43:45 EDT
Created attachment 194213 [details]
Second jar

Second jar to dump into org.eclipse.pde.api.tools.tests\test-anttasks\apitooling.apifreeze\profile
Comment 13 Olivier Thomann CLA 2011-04-27 17:10:12 EDT
All tests pass with the new patch.
Comment 14 Olivier Thomann CLA 2011-04-27 17:10:44 EDT
We need to decide if we want to make this optional. That might be an item for 3.8.
Comment 15 Dani Megert CLA 2011-04-28 04:23:57 EDT
(In reply to comment #7)
> The patch looks good to me.
> 
> I think we should add this in for 3.7M7 to ensure that the freeze report is
> accurate (so we do not try to scan bundles with ResolverErrors)

Can this be done without switching the entire builder? If not, I think it's too late and should be done for RC1.
Comment 16 Olivier Thomann CLA 2011-04-28 09:35:25 EDT
(In reply to comment #15)
> Can this be done without switching the entire builder?
What do you mean ? The fix is to walk all bundles after the baseline is initialized to report the ones with errors.
Bundles are then added to an IApiScope that is processed to report potential API freeze changes.
I tested the patch using 3.7M6 zip and the current I-build zip and it works fine.
Kim only updates the builder with every milestone.

This one is less important as it is only a matter of reporting resolution errors in the ant task. I don't think the builder has any resolution error with the baseline it is using.
Comment 17 Dani Megert CLA 2011-04-28 09:37:51 EDT
(In reply to comment #16)
> (In reply to comment #15)
> > Can this be done without switching the entire builder?
> What do you mean ? The fix is to walk all bundles after the baseline is
> initialized to report the ones with errors.
> Bundles are then added to an IApiScope that is processed to report potential
> API freeze changes.
> I tested the patch using 3.7M6 zip and the current I-build zip and it works
> fine.
> Kim only updates the builder with every milestone.
> 
> This one is less important as it is only a matter of reporting resolution
> errors in the ant task. I don't think the builder has any resolution error with
> the baseline it is using.


I thought the suggestion was to fix the results for the official builds. If that's not the case I'm fine.
Comment 18 Olivier Thomann CLA 2011-04-28 12:34:21 EDT
Released for 3.7M7.