Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate PDE off the antiquated Equinox resolver and its API #1069

Open
1 of 3 tasks
HannesWell opened this issue Jan 23, 2024 · 1 comment
Open
1 of 3 tasks

Migrate PDE off the antiquated Equinox resolver and its API #1069

HannesWell opened this issue Jan 23, 2024 · 1 comment

Comments

@HannesWell
Copy link
Member

HannesWell commented Jan 23, 2024

As said in Bug 570198 and Bug 575374, "the org.eclipse.osgi.service.resolver [API] is antiquated and has not been used by the Equinox Framework since Kepler release." and PDE should be migrated to modern alternatives, ideally standard OSGi APIs.

This is intended as an umbrella issue to track all efforts in the area as well as to discuss the general approaches to solve this great effort.

The API in o.e.osgi.service.resolver is used for different areas within PDE.

  • VersionRange: can be replaced with osgi.VersionRange (which it already extends). Used in PDE APIs so alternatives have to be added and existing methods have to be deprecated for removal.

  • State: For the resolver State used in PDEState probably the OSGi resolver service and/or the implementations in the org.eclipse.osgi.container can serve as an replacement

  • BundleDescription/Plugin dependencies: The initial proposal was to replace BundleDescription by BundleRevision. But in Support finding a model by Resource instead of BundleDescription #1062 (comment) @laeubi suggested to use the even more generic osgi Resouce API instead, which would allow even lighter Bundle/Plug-in representations

    you don't need a resolved state with bundles to compute the required information, it is already there in the meta-data, currently this requires PDE to download all bundles of a target platform even if only a few are used to resolve the projects classpath. Also this currently hinders PDE from using more than one target platform, e.g. you must always have one big-fat target that can satisfy all your workspace bundles, using different sets of bundles in the same workspace is not possible often without much efforts.

    And in combination with the suggested usage of the ResolveContext.getWirings() most of the information from the BundleRevision are also available for a osgi Resource , just in a slightly more abstract form. I agree, that it is probably possible to use mostly the Resources API.
    But maybe a migration is easier in two phases, first from BundleDescription to BundleRevision and the to Resource. The second step is then probably simpler, since a BundleRevision is already a Resource.

    As listed in Bug 570198, BundleDescription is used in several PDE APIs that need replacements and then have to be deprecated for removal.

For repeating patterns and required conveniences we can create a PDE internal utility class to use the Resources/Wiring API as convenient as the Equinox resolver API was.

HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Feb 21, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Feb 21, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Feb 22, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Feb 22, 2024
@HannesWell HannesWell changed the title Migrate PDE off the antiquated Equinox resolver API Migrate PDE off the antiquated Equinox resolver Jul 13, 2024
@HannesWell HannesWell changed the title Migrate PDE off the antiquated Equinox resolver Migrate PDE off the antiquated Equinox resolver and its API Jul 13, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 14, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods as deprecated for removal.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 14, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 14, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 14, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
[FIXUP] Remove seldomly used filter parameter.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 15, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 16, 2024
HannesWell added a commit that referenced this issue Jul 16, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of #1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 16, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 17, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 21, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Jul 22, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
fedejeanne pushed a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
Provide alternatives that are using org.osgi.framework.VersionRange and
deprecate the existing methods for removal.

Part of eclipse-pde#1069
fedejeanne pushed a commit to fedejeanne/eclipse.pde that referenced this issue Jul 31, 2024
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 6, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 6, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 6, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 6, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 15, 2024
Besides replacing the Equinox resolver VersionRange by the osgi
VersionRange, this also remove the rarely used filter parameter from the
findModel(s)() methods. Instead of a List the findModels() methods now
return a stream that can also be filtered if desired.

In all cases plug-ins with null IPluginBase or ID are now discarded.

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 15, 2024
Besides replacing the Equinox resolver VersionRange by the OSGi's
org.osgi.framework.VersionRange, this also removes the rarely used
filter parameter from the findModel() methods. Instead of an array the
new findModels() methods return a stream that can be filtered by the
caller if desired and is sorted by descending plug-in version.

In all cases plug-ins with null IPluginBase or ID are now discarded by
all findModel() methods that accept plug-in id plus version
specification (range or match-rule).

Part of eclipse-pde#1069
HannesWell added a commit to HannesWell/eclipse.pde that referenced this issue Aug 15, 2024
Besides replacing the Equinox resolver VersionRange by the OSGi's
org.osgi.framework.VersionRange, this also removes the rarely used
filter parameter from the findModel() methods. Instead of an array the
new findModels() methods return a stream that can be filtered by the
caller if desired and is sorted by descending plug-in version.

In all cases plug-ins with null IPluginBase or ID are now discarded by
all findModel() methods that accept plug-in id plus version
specification (range or match-rule).

Part of eclipse-pde#1069
HannesWell added a commit that referenced this issue Aug 15, 2024
Besides replacing the Equinox resolver VersionRange by the OSGi's
org.osgi.framework.VersionRange, this also removes the rarely used
filter parameter from the findModel() methods. Instead of an array the
new findModels() methods return a stream that can be filtered by the
caller if desired and is sorted by descending plug-in version.

In all cases plug-ins with null IPluginBase or ID are now discarded by
all findModel() methods that accept plug-in id plus version
specification (range or match-rule).

Part of #1069
@HannesWell
Copy link
Member Author

HannesWell commented Aug 15, 2024

  • VersionRange: can be replaced with osgi.VersionRange (which it already extends). Used in PDE APIs so alternatives have to be added and existing methods have to be deprecated for removal.

With #1163 being submitted we reached the first milestone and have deprecated and provided replacements for all APIs using the Equinox resolver's VersionRange.
There are three other references to the Resolver's VersionRange left in the code. They are easy to replace but the surrounding code should be generally be revisited any ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant