OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.16k stars 599 forks source link

Versionless Feature Introspector Updates #28262

Open tbitonti opened 7 months ago

tbitonti commented 7 months ago

Update the feature introspector output to display new values relating to versionless features.

Current introspector output:

The description of this introspector:
Lists all the features enabled in the server.

com.ibm.websphere.appserver.appLifecycle-1.0
    Visibility: PROTECTED
    Version: 1.0.0
    Simple Name: com.ibm.websphere.appserver.appLifecycle-1.0
    Symbolic Name: com.ibm.websphere.appserver.appLifecycle-1.0
    Bundle Repository Type: core
    Auto Feature: false
    Singleton: false
    Superseded: false
    Constituents: 
        com.ibm.ws.app.manager.lifecycle 
            {version=[1.0.0,1.0.200)}

mpHealth
    Visibility: PUBLIC
    Version: 1.0.0
    Simple Name: mpHealth
    Symbolic Name: io.openliberty.versionless.mpHealth
    Bundle Repository Type: core
    Auto Feature: false
    Singleton: false
    Superseded: false
    Constituents: 
        io.openliberty.internal.versionless.mpHealth-1.0 : tolerates:=[2.0, 2.1, 2.2, 3.0, 3.1, 4.0]
            {type=osgi.subsystem.feature}

Several new values can be displayed:

(1) For all features, if the feature has a platform association, that should be displayed.

There should be three cases:

(1.1) The feature is associated with exactly one platform version.
    -- Platform: jakartaEE-10.0

(1.2) The feature is associated with no platform versions.
    -- The platform element is omitted.

(1.3) The feature is associated with multiple platform versions,
      either from the same platform or from different platforms.
    -- Platform: jakartaEE-10.0, jakartaEE-9.0
    -- Platform: jakartaEE-10.0, microProfile-6.0

Case (1.3) might not exist.

(2) For all versionless features, there should be at least three values which can be displayed:

Versionless: true
Platform: microProfile-2.0
Resolved To: mpHealth-2.0

(3) For all compatibility features, there should be at least two values which can be displayed:

Compatiblity: true
Platform: microProfile-2.0

Overall, this makes for at least four new values which may be displayed:

Versionless
-- optional
-- true | false
-- default to false
-- omit if false

Compatiblity
-- optional
-- true | false
-- default to false
-- omit if false

Platform
-- optional; required when versionless or compatibility is true
-- list of versioned platforms
-- default to empty
-- omit if empty

Resolved To
-- optional; required on versionless is true
-- versioned feature
-- default to unset
-- omit if unset

The target location for these changes should be in https://github.com/OpenLiberty/open-liberty/blob/integration/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/subsystem/FeatureIntrospector.java and associated java classes.

hlhoots commented 6 months ago

This function requires that issue #28203 is complete