Closed cherylking closed 1 month ago
I recommend option 2. I think we should maintain a collection of known versionless features (based off of finding features when processing features.json that have a required feature that contains .versionless.
in the name). For example, the servlet
versionless feature has a requireFeature
with value io.openliberty.internal.versionless.servlet-3.0
.
When processing the featurelist.xml to collect config elements, for every feature that is related to a versionless feature (e.g. servlet-4.0
is related to servlet
versionless feature...just strip off everything after the last -
including the -
and check if it matches a versionless feature), add all of its config elements to the servlet
FeatureListNode in the FeatureListGraph. See method FeatureService.readFeaturesFromFeatureListFile
where it is processing configElements.
Here is an example of the problem reported in this issue. When I change the feature from servlet-5.0
to just servlet
and add the platform element for jakartaee-0.1
, the httpEnpoint
and webApplication
elements are flagged with diagnostics stating there is no feature configured relating to that config element.
Note that Arun came up with a much simpler approach to modify the method that was determining whether a config element had a feature configured for it, to look for the presence of a versionless feature corresponding to a feature that enabled the config element.
When using versionless features in the
server.xml
, the missing config element diagnostic is flagging because we no longer have the relationship between the features and their config elements. Those are part of the versioned features. Need to figure out what we want to do about this. Two options I can think of:x
may have a new config elementa
that is not valid for an older version of featurex
).