Skip to content

[4.4.x] Keep raw version when feature version is not a valid OSGi version - #3138

Merged
jbonofre merged 1 commit into
apache:karaf-4.4.xfrom
jbonofre:backport-2978-karaf-4.4.x
Nov 20, 2026
Merged

jbonofre merged 1 commit into
apache:karaf-4.4.xfrom
jbonofre:backport-2978-karaf-4.4.x

Conversation

@jbonofre

Copy link
Copy Markdown
Member

Follow-up backport of #2978 (commit c172c9f) to karaf-4.4.x.

Context

#2993 already backported the initial commit of #2978 (0e2b7b03) to karaf-4.4.x, before #2978 received the review fixes and was merged. As a result, karaf-4.4.x is missing the invalid-version fallback and throws IllegalArgumentException on 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 to name + "/" + version when VersionTable.getVersion throws IllegalArgumentException.
  • FeaturesServiceImpl.normalize delegates directly to ResourceUtils.getFeatureId(name, version) without redundant VersionCleaner.clean.
  • Deployer reuses the featuresById map key when installing configurations and libraries.
  • Adds FeaturesServiceImplTest#testFeatureWithInvalidVersionDoesNotBreakOtherFeatures and test fixtures.

Testing

  • JAVA_HOME=$(/usr/libexec/java_home -v 21) mvn -pl features/core -am clean test: features/core passed (131 tests, 0 failures, 0 errors, 2 pre-existing skipped; FeaturesServiceImplTest: 14 tests, 0 failures, 0 errors).

…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)
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Test Results

  694 files  ±0    694 suites  ±0   56m 8s ⏱️ - 3m 38s
1 082 tests +1  1 039 ✅ +1   43 💤 ±0  0 ❌ ±0 
2 971 runs  +3  2 850 ✅ +3  121 💤 ±0  0 ❌ ±0 

Results for commit e1bcfe3. ± Comparison against base commit 1ce6af8.

♻️ This comment has been updated with latest results.

@jbonofre
jbonofre merged commit a521c07 into apache:karaf-4.4.x Nov 20, 2026
12 of 13 checks passed
@jbonofre
jbonofre deleted the backport-2978-karaf-4.4.x branch November 20, 2026 20:23
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

Successfully merging this pull request may close these issues.

1 participant