Repository navigation
[4.4.x] Keep raw version when feature version is not a valid OSGi version - #3138
Merged
Merged
Conversation
…sion Follow-up backport of apache#2978 (commit c172c9f) to karaf-4.4.x. PR apache#2993 already backported the initial commit of apache#2978 (0e2b7b0) to karaf-4.4.x, but missed the subsequent review fixes before apache#2978 was merged: - ResourceUtils.getFeatureId(name, version) falls back to the raw version when VersionTable.getVersion throws IllegalArgumentException, avoiding failures on unrelated features when a registered repository contains an invalid version. - FeaturesServiceImpl.normalize delegates directly to ResourceUtils.getFeatureId without redundant VersionCleaner.clean. - Deployer reuses the featuresById entry key when installing configs/libraries. - Adds testFeatureWithInvalidVersionDoesNotBreakOtherFeatures regression test. (backport of apache#2978 follow-up commits from c172c9f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up backport of #2978 (commit c172c9f) to
karaf-4.4.x.Context
#2993 already backported the initial commit of #2978 (
0e2b7b03) tokaraf-4.4.x, before #2978 received the review fixes and was merged. As a result,karaf-4.4.xis missing the invalid-version fallback and throwsIllegalArgumentExceptionon unrelated operations (listInstalledFeatures(),installFeatures(),Deployer.DeploymentState.partitionFeatures()) whenever any registered repository contains a feature with an unparseable OSGi version (e.g.1.0.0.beta+1).Changes
Backports the remaining diff from #2978:
ResourceUtils.getFeatureId(String, String)falls back toname + "/" + versionwhenVersionTable.getVersionthrowsIllegalArgumentException.FeaturesServiceImpl.normalizedelegates directly toResourceUtils.getFeatureId(name, version)without redundantVersionCleaner.clean.Deployerreuses thefeaturesByIdmap key when installing configurations and libraries.FeaturesServiceImplTest#testFeatureWithInvalidVersionDoesNotBreakOtherFeaturesand test fixtures.Testing
JAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -pl features/core -am clean test:features/corepassed (131 tests, 0 failures, 0 errors, 2 pre-existing skipped;FeaturesServiceImplTest: 14 tests, 0 failures, 0 errors).