Improve handling of unresolved bundles for feature-launches #2367#2373
Improve handling of unresolved bundles for feature-launches #2367#2373ptziegler wants to merge 1 commit into
Conversation
…de#2367 The logic for calculating the included plug-ins for a feature-based launch configuration assigns resolved bundles a higher priority than bundles, that perfectly match the version in a feature.xml. This means that even though the user configured their application to run with a specific version of a plug-in, PDE might decide to silently update it to its latest version, simply because it conflicts with a different plug-in in the IDE (which might not even be included in the app). With this change, the logic has been adapted to first check for a version match, before checking the resolution state. So if a version matches perfectly, it will always be chosen first, even if it's not resolved. Closes eclipse-pde#2367
|
Without this change, the test case would fail with: Which is completely different than what's expected when looking at the feature.xml. |
|
I would say that if a specific version is given in the feature this exact version must be used and no higher version is actually valid at all, so for me it looks not only like an ordering problem but that other plugins are actually selected at all. |
That's what I would expect as well. But there is this test case, where a If I were to filter out all plugins that don't match the specified version, this test case would break. This is not the case when changing the order, as this only comes into play when the specified version really exists. |
| private static IPluginModelBase getIncludedPlugin(String id, String version, String pluginLocation) { | ||
| List<List<IPluginModelBase>> plugins = getPlugins(id, pluginLocation); | ||
| return getIncluded(plugins, ENABLED_VALID_PLUGIN_FILTER, GET_PLUGIN_VERSION, COMPARE_PLUGIN_RESOLVED, version); | ||
| return getIncluded(plugins, ENABLED_VALID_PLUGIN_FILTER, GET_PLUGIN_VERSION, getIncludedPluginComparator(version), version); |
There was a problem hiding this comment.
I'm also not quite happy with doing the change here. I'll try to have a look later today to move it down into the getIncluded(...) method, so that it's in the same place as the already existing version logic.
Where of course the question is if it is actual wanted behavior that is tested or the test just crafted in a way that it passes... At least for P2 an exact version is generated for a feature and Tycho resolves all |
I also painfully remember that Tycho fails if a plugin has e.g. the version By that logic, the following assertion is also wrong, because it expects the bundle with version @HannesWell I think you initially worked on this as part of Bug 578005 - Extend FeatureBasedLaunchTest to fully cover Feature-based launches. Do you remember the use-cases you had in mind when you originally wrote those tests? |
The logic for calculating the included plug-ins for a feature-based launch configuration assigns resolved bundles a higher priority than bundles, that perfectly match the version in a feature.xml.
This means that even though the user configured their application to run with a specific version of a plug-in, PDE might decide to silently update it to its latest version, simply because it conflicts with a different plug-in in the IDE (which might not even be included in the app).
With this change, the logic has been adapted to first check for a version match, before checking the resolution state. So if a version matches perfectly, it will always be chosen first, even if it's not resolved.
Closes #2367