#2296: Refactor ToolCommandlet to determine InstalledEdition and Version in a Single Cached Lookup - #2306
Open
krystynaShatkovska wants to merge 9 commits into
Open
Conversation
- Remove setController() to avoid conflict with fx:controller in FXML - Add initialized flag to MainController.initialize() to run only once across all 3 FXML files (main-view, navigation, status-bar) - All 56 GUI tests pass Co-Authored-By: Capgemini Sovereign AI Platform
- Introduce EditionAndVersion record combining edition and version - Add getInstalledEditionAndVersion() with CachedValue to ToolCommandlet - Make getInstalledVersion()/getInstalledEdition() final, delegating to combined method - Implement computeInstalledEditionAndVersion() in LocalToolCommandlet - GlobalToolCommandlet: getWindowsRegistryAppNames() returns Map<String, String> - Docker: support docker/rancher editions via registry app name mapping - Update all subclasses (IdeasyCommandlet, KubeCtl, DelegatingToolCommandlet, etc.) - Add cache invalidation after installation - Fix pre-existing GUI compilation issue (IdeContext.findProjects visibility)
Author
|
@laert-ll i have tested locally and both ReleaseCommandletTest and BuildCommandletTest pass with BUILD SUCCESS. your refactoring is clean and ReleaseCommandlet now properly supports any BuildTool instead of being hardcoded to Maven. Good job. |
Collaborator
Coverage Report for CI Build 31581158018Coverage increased (+0.05%) to 72.945%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions242 previously-covered lines in 10 files lost coverage.
Coverage Stats💛 - Coveralls |
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.
Implemented changes:
This PR refactors the way IDEasy determines the installed edition and version of tools. Previously,
getInstalledEdition()andgetInstalledVersion()were separate methodsthat often performed redundant expensive lookups (registry queries, process execution, etc.). The new combined approach computes both values in a single call.
EditionAndVersion(String edition, VersionIdentifier version)to hold both values togethergetInstalledEditionAndVersion()withCachedValuetoToolCommandlet— delegates tocomputeInstalledEditionAndVersion()getInstalledVersion()andgetInstalledEdition()final— they now delegate to the combined methodcomputeInstalledEditionAndVersion()inLocalToolCommandlet(resolves edition + version via software link target)GlobalToolCommandlet:getWindowsRegistryAppNames()returnsMap<String, String>mapping edition → registry app nameDocker: returnsMap.of(\"docker\", \"Docker Desktop\", \"rancher\", \"Rancher Desktop\")— enabling correct detection of Rancher Desktop editioncomputeInstalledEditionAndVersion()inLocalToolCommandlet(resolves edition + version via software link target)GlobalToolCommandlet:getWindowsRegistryAppNames()returnsMap<String, String>mapping edition → registry app nameDocker: returnsMap.of(\"docker\", \"Docker Desktop\", \"rancher\", \"Rancher Desktop\")— enabling correct detection of Rancher Desktop editioninvalidateInstalledEditionAndVersion()IdeContext.findProjectswas package-private instead of public)Backward compatibility is maintained via deprecated hooks (
computeInstalledEdition(),computeInstalledVersion(),getInstalledVersionDeprecated(),getInstalledEditionDeprecated()).Testing instructions
Checklist for this PR