-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open Audio Stack Registry support #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request refactors terminology and resource usage across the codebase, replacing StudioRack references with Open Audio and shifting from “product/store” nomenclature to “package/registry”. Image resources, URL configurations, and method names have been updated. Deprecated specifications and legacy JSON mappers were removed in favor of new mapping classes for the Open Audio Stack (OAS) and registry. Several UI components, controllers, and service classes have been adjusted accordingly, and the source synchronization flow now clearly distinguishes between registry and OAS sources. Changes
Sequence Diagram(s)sequenceDiagram
participant SST as SourceSyncTask
participant RS as RemoteSource
participant HE as HttpEntity
participant RM as RegistryModelAdapter
participant OAM as OASModelAdapter
SST->>RS: getType()
alt RS type is OWLPLUG_REGISTRY
SST->>HE: Fetch response
SST->>RM: processRegistrySource(response, RS)
RM-->>SST: Returns RemotePackage
else RS type is OAS_REGISTRY
SST->>HE: Fetch response
SST->>OAM: processOASSource(response, RS)
OAM-->>SST: Returns RemotePackage
end
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
6e97f0c to
dce3543
Compare
dce3543 to
2c22198
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (25)
owlplug-client/src/main/java/com/owlplug/core/model/platform/OperatingSystem.java (2)
21-34: Consider adding JavaDoc for better code documentation and maintainability.The enum lacks documentation that explains its purpose and the meaning of each constant. Adding JavaDoc would improve code maintainability and help other developers understand the intended use.
package com.owlplug.core.model.platform; +/** + * Enum representing the operating systems supported by OwlPlug. + * Each enum constant is associated with a string code used for + * platform-specific operations and integration with external systems. + */ public enum OperatingSystem { + /** + * Windows operating system. + */ + WIN("win"), + /** + * macOS operating system (formerly OSX). + */ + MAC("mac"), + /** + * Linux operating system. + */ + LINUX("linux"), + /** + * Unknown or unsupported operating system. + */ + UNKNOWN("unknown"); + /** + * The string code representing the operating system. + * Used for serialization and integration with external systems. + */ private String code; + /** + * Constructs an OperatingSystem with the specified code. + * @param code the string representation of the operating system + */ OperatingSystem(String code) { this.code = code; } + /** + * Returns the string code representing the operating system. + * @return the operating system code + */ public String getCode() { return code; }
21-34: Enhance enum with utility methods for platform detection.Consider adding static utility methods to determine the current operating system at runtime, which would improve the usability of this enum.
package com.owlplug.core.model.platform; public enum OperatingSystem { WIN("win"), MAC("mac"), LINUX("linux"), UNKNOWN("unknown"); private String code; OperatingSystem(String code) { this.code = code; } public String getCode() { return code; } + /** + * Determines the current operating system. + * @return the detected OperatingSystem enum constant + */ + public static OperatingSystem getCurrentOS() { + String osName = System.getProperty("os.name").toLowerCase(); + if (osName.contains("win")) { + return WIN; + } else if (osName.contains("mac") || osName.contains("darwin")) { + return MAC; + } else if (osName.contains("linux") || osName.contains("unix")) { + return LINUX; + } else { + return UNKNOWN; + } + } + + /** + * Checks if the current operating system is the specified one. + * @param os the operating system to check against + * @return true if the current OS matches the specified one + */ + public static boolean isCurrent(OperatingSystem os) { + return getCurrentOS() == os; + } }owlplug-client/src/main/resources/fxml/menu/PackageInfoView.fxml (1)
51-51: Confirm “RemoteSource” aligns with registry terminology.
Changing the label text from “Store” to “RemoteSource” appears correct for the new naming convention. Ensure this label is consistent with other UI references to "Registry" or "Remote Source" if you aim to unify the terminology.owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatformResolver.java (3)
27-47: Consider making the platform set unmodifiable.
To prevent accidental modifications (e.g., additional platforms added at runtime), consider usingCollections.unmodifiableSet(platforms)or a similar approach in the static block. This helps preserve the intended immutability.-static Set<RuntimePlatform> platforms = new HashSet<>(); +static Set<RuntimePlatform> platforms = Collections.unmodifiableSet(new HashSet<>());
64-83: Account for broader architectures if needed.
These regex checks correctly categorize common architecture strings. If you someday need to support additional or less typical architectures, consider adding more patterns or a fallback approach beyond “unknown.”
85-96: Extend OS detection for future growth.
Currently, the method recognizes Windows, macOS, and Linux variations, returningUNKNOWNfor everything else. This is fine for now, but you may want to handle other popular systems (e.g., FreeBSD) if that becomes relevant.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASPackage.java (1)
23-28: New OASPackage class structure looks appropriateThe class implements a data model for OAS packages with well-defined fields: slug (identifier), version (current version), and versions (available versions map).
Consider adding JavaDoc comments to clarify the purpose of each field, especially explaining the relationship between the
versionfield and theversionsmap.public class OASPackage { + /** + * Unique identifier for the package. + */ private String slug; + /** + * Current version of the package. + */ private String version; + /** + * Map of available versions of the plugin, keyed by version string. + */ private Map<String, OASPlugin> versions;owlplug-client/src/main/java/com/owlplug/explore/dao/RemotePackageDAO.java (1)
115-115: Changed platformTagList parameter type from List to Set.This change from
List<String>toSet<String>provides a more appropriate collection type for platform tags, as it enforces uniqueness and aligns better with the semantic meaning of platform tags as a unique set of identifiers.Consider also updating the variable name from
platformTagListtoplatformTagsin the Javadoc to accurately reflect the new parameter type.- * @param platformTagList - The compatible platformTagList to find + * @param platformTagList - The compatible platform tags to findowlplug-client/src/main/java/com/owlplug/explore/ui/PackageSourceBadgeView.java (1)
50-53: Updated URL check and badge content for Open Audio Stack Registry.The code properly updates the URL check from StudioRack to Open Audio Stack Registry. The tooltip text has been simplified to just show "Open Audio Stack Registry" without additional context.
Consider adding more descriptive tooltip text similar to the OwlPlug Registry tooltip to provide users with context about what the Open Audio Stack Registry is:
- String tooltipText = "Open Audio Stack Registry"; + String tooltipText = "Open Audio Stack Registry\nCommunity curated audio packages";owlplug-client/src/main/java/com/owlplug/explore/controllers/ExploreController.java (3)
267-267: Update analytics tracking path to reflect new terminology.This line still uses the term "store" in the analytics path "/app/store/action/search" while other parts of the code have been updated to use "registry" or "package" terminology.
- this.getAnalyticsService().pageView("/app/store/action/search"); + this.getAnalyticsService().pageView("/app/registry/action/search");
199-199: Update analytics tracking path to reflect new terminology.This line still uses the term "store" in the analytics path "/app/store/actions/syncStores" while other parts of the code have been updated to use "registry" terminology.
- this.getAnalyticsService().pageView("/app/store/actions/syncStores"); + this.getAnalyticsService().pageView("/app/registry/actions/syncSources");
374-377: Update analytics tracking path to reflect new terminology.The analytics path still uses "store" instead of the new "registry" terminology.
- this.getAnalyticsService().pageView("app/store/action/install", + this.getAnalyticsService().pageView("app/registry/action/install", bundle.getRemotePackage().getRemoteSource().getName(), bundle.getRemotePackage().getName(), bundle.getName());owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatform.java (3)
46-49: Added constructor with aliases support.Enhanced class with a new constructor that enables platform alias specification, which helps with cross-platform compatibility.
Consider adding JavaDoc comments to explain the purpose of aliases and how they are used:
+/** + * Constructs a RuntimePlatform with the given tag, operating system, architecture, and aliases. + * Aliases are alternative identifiers for the platform that can be used in platform compatibility checks. + * + * @param tag The primary identifier for this platform + * @param operatingSystem The operating system associated with this platform + * @param arch The architecture (e.g., x86, x64, arm) of this platform + * @param aliases Alternative identifiers for this platform + */ public RuntimePlatform(String tag, OperatingSystem operatingSystem, String arch, String[] aliases) { this(tag, operatingSystem, arch); this.aliases.addAll(Arrays.stream(aliases).toList()); }
51-59: Improved tag collection by using a Set for uniqueness.Changed return type from
List<String>toSet<String>and modified the implementation to use a HashSet, which ensures unique platform tags and includes aliases.Consider adding JavaDoc to clarify the method behavior change:
+/** + * Returns a set of unique platform tags that are compatible with this runtime platform. + * The set includes the operating system code, all platform aliases, and tags from compatible platforms. + * + * @return A set of unique platform tags + */ public Set<String> getCompatiblePlatformsTags() { Set<String> platforms = new HashSet<>(); platforms.add(this.operatingSystem.getCode()); platforms.addAll(aliases); for (RuntimePlatform platform : compatiblePlatforms) { platforms.add(platform.getTag()); } return platforms; }
33-33: Consider using interface type instead of concrete implementation.The field type has been changed from
List<RuntimePlatform>toArrayList<RuntimePlatform>. While this works, programming to an interface (usingList) rather than a concrete implementation (ArrayList) is generally preferred for better flexibility.- private ArrayList<RuntimePlatform> compatiblePlatforms = new ArrayList<>(); + private List<RuntimePlatform> compatiblePlatforms = new ArrayList<>();owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java (1)
232-232: Review empty line.There appears to be an empty line at position 232 that doesn't serve any purpose. Consider removing it to maintain consistent spacing in the code.
public String getOpenAudioRegistryUrl() { return env.getProperty("openaudio.registry.url"); } - public String getEnvProperty(String property) {owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASModelAdapter.java (1)
119-120: Consider adding validation for file size.The code converts size from bits to bytes, but doesn't check if
file.getSize()is null or negative before performing the division.- // Size in OAS registry is in bits not in bytes. - packageBundle.setFileSize(file.getSize() / 8); + // Size in OAS registry is in bits not in bytes. + if (file.getSize() != null && file.getSize() > 0) { + packageBundle.setFileSize(file.getSize() / 8); + } else { + packageBundle.setFileSize(0L); + }owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASFile.java (2)
25-31: Consider usinglongfor file size.If the file size can exceed the range of a 32-bit integer, using
intmay cause overflow.- private int size; + private long size;
89-117: Rename nested classSystemto avoid overshadowingjava.lang.System.Naming this class
Systemcould be confusing since it shares a name with the core Java class. Renaming it to something more descriptive (e.g.,OASSystem) improves clarity.- public static class System { + public static class OASSystem {owlplug-client/src/main/java/com/owlplug/explore/tasks/SourceSyncTask.java (2)
137-168: RenameStoreParsingExceptionto reflect registry context.Since this method processes a registry source, renaming the exception could reduce confusion and align with new naming conventions (e.g.,
RegistryParsingException).- } catch (StoreParsingException e) { + } catch (RegistryParsingException e) { ... - private class StoreParsingException extends Exception { - StoreParsingException(Exception e) { + private class RegistryParsingException extends Exception { + RegistryParsingException(Exception e) {
170-198: Reduce duplication between registry and OAS source processing.Both
processRegistrySourceandprocessOASSourceperform similar chunk-based processing. Consider extracting shared logic or using a generic approach to reduce duplicated code.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/RegistryModelAdapter.java (1)
48-90: Add error handling for unsupported plugin type or stage.
By callingPluginType.fromString(...)andPluginStage.fromString(...), the code may throw an exception if the string is unrecognized. Consider wrapping these calls in a try-catch or providing a safe fallback to avoid runtime errors for malformed input.owlplug-client/src/main/java/com/owlplug/explore/services/ExploreService.java (2)
192-213: Deepen validation for OwlPlug registry data.
Currently, you only check ifregistryMapper.getPackages()is null. Consider verifying whether it's merely non-null or also non-empty, and that required fields exist, to avoid partially valid data.
216-239: Add consistency checks for OAS registry data.
Similar to the OwlPlug registry handling, consider verifying thatregistryMapper.getPlugins()is not only non-null, but also non-empty or sufficiently populated. This can prevent unexpected behavior with incomplete data.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASPlugin.java (1)
1-133: Reduce boilerplate and add validations.
This class functions as a data holder with many getters and setters. Consider a more concise approach (e.g., Lombok or Java records) and check whether certain fields (e.g.,name,type) require null-safety or additional data validation.Would you like assistance adding unit tests or refactoring these setters for improved safety?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
owlplug-client/src/main/resources/media/open-audio-16.pngis excluded by!**/*.png,!**/*.pngowlplug-client/src/main/resources/media/powered-by-open-audio-stack.pngis excluded by!**/*.png,!**/*.pngowlplug-client/src/main/resources/media/studiorack-logo-16.pngis excluded by!**/*.png,!**/*.png
📒 Files selected for processing (44)
README.md(3 hunks)doc/ThirdParty_Store_Specification.md(0 hunks)owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java(2 hunks)owlplug-client/src/main/java/com/owlplug/core/controllers/DirectoryInfoController.java(2 hunks)owlplug-client/src/main/java/com/owlplug/core/model/PluginFormat.java(0 hunks)owlplug-client/src/main/java/com/owlplug/core/model/platform/OperatingSystem.java(1 hunks)owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatform.java(1 hunks)owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatformResolver.java(1 hunks)owlplug-client/src/main/java/com/owlplug/core/services/OptionsService.java(2 hunks)owlplug-client/src/main/java/com/owlplug/core/utils/StringUtils.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/components/ExploreTaskFactory.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/controllers/ExploreController.java(3 hunks)owlplug-client/src/main/java/com/owlplug/explore/controllers/NewSourceDialogController.java(4 hunks)owlplug-client/src/main/java/com/owlplug/explore/controllers/PackageInfoController.java(5 hunks)owlplug-client/src/main/java/com/owlplug/explore/dao/RemotePackageDAO.java(5 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/PackageTag.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/SourceType.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/json/legacy/ProductJsonMapper.java(0 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/json/legacy/StoreModelAdapter.java(0 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASFile.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASModelAdapter.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASPackage.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASPlugin.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASRegistry.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/BundleMapper.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/PackageMapper.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/PackageVersionMapper.java(3 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/RegistryMapper.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/RegistryModelAdapter.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/model/search/ExploreFilterCriteria.java(3 hunks)owlplug-client/src/main/java/com/owlplug/explore/services/ExploreService.java(7 hunks)owlplug-client/src/main/java/com/owlplug/explore/tasks/BundleInstallTask.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/tasks/SourceSyncTask.java(3 hunks)owlplug-client/src/main/java/com/owlplug/explore/ui/ExploreChipView.java(1 hunks)owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBlocView.java(4 hunks)owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBlocViewBuilder.java(2 hunks)owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBundlesView.java(4 hunks)owlplug-client/src/main/java/com/owlplug/explore/ui/PackageSourceBadgeView.java(1 hunks)owlplug-client/src/main/resources/application.properties(1 hunks)owlplug-client/src/main/resources/fxml/ExploreView.fxml(1 hunks)owlplug-client/src/main/resources/fxml/Preloader.fxml(2 hunks)owlplug-client/src/main/resources/fxml/dialogs/NewSourceView.fxml(2 hunks)owlplug-client/src/main/resources/fxml/menu/PackageInfoView.fxml(1 hunks)owlplug-client/src/test/java/com/owlplug/dao/GoogleCredentialDAOTest.java(0 hunks)
💤 Files with no reviewable changes (5)
- doc/ThirdParty_Store_Specification.md
- owlplug-client/src/main/java/com/owlplug/explore/model/json/legacy/ProductJsonMapper.java
- owlplug-client/src/main/java/com/owlplug/explore/model/json/legacy/StoreModelAdapter.java
- owlplug-client/src/test/java/com/owlplug/dao/GoogleCredentialDAOTest.java
- owlplug-client/src/main/java/com/owlplug/core/model/PluginFormat.java
✅ Files skipped from review due to trivial changes (5)
- owlplug-client/src/main/java/com/owlplug/explore/model/search/ExploreFilterCriteria.java
- owlplug-client/src/main/java/com/owlplug/explore/ui/ExploreChipView.java
- owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/BundleMapper.java
- owlplug-client/src/main/java/com/owlplug/explore/components/ExploreTaskFactory.java
- owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBlocViewBuilder.java
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (73)
owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatformResolver.java (2)
21-23: Switching to a Set is a suitable choice.
Shifting from aMapto aSetis appropriate since the code performs membership checks rather than key-based lookups. This change simplifies the structure without losing functionality.
53-62: Well-structured stream-based resolution.
The use of a stream to filter the set by OS and architecture is clear and concise, returning an “unknown” platform when no match is found. This logic is good as-is.owlplug-client/src/main/resources/fxml/ExploreView.fxml (1)
107-107: Consistent rename from product to package.
Renamingfx:idfrom “productInfoView” to “packageInfoView” aligns with the broader shift from “product” to “package.”owlplug-client/src/main/resources/application.properties (1)
16-16: Configuration property added for Open Audio Stack Registry.The addition of the Open Audio Stack Registry URL is aligned with the PR objective to implement support for OAS-R. This property will be used to connect to the new registry service.
owlplug-client/src/main/java/com/owlplug/explore/model/PackageTag.java (1)
47-47: JavaDoc updated to reflect terminology change from 'product' to 'package'.The documentation update is part of the larger effort to transition from the legacy OwlPlug Store specification to the Open Audio Stack Registry, ensuring consistent terminology throughout the codebase.
Also applies to: 50-50
owlplug-client/src/main/java/com/owlplug/core/services/OptionsService.java (2)
53-53: Field renamed from 'productDAO' to 'packageDAO' for terminology consistency.The renaming of this dependency is part of the broader terminology shift from 'product' to 'package' throughout the codebase.
107-107: Method call updated to use 'packageDAO' instead of 'productDAO'.The method call has been properly updated to use the renamed dependency, ensuring functionality remains intact.
owlplug-client/src/main/java/com/owlplug/explore/tasks/BundleInstallTask.java (2)
53-53: JavaDoc updated to reflect terminology change from 'product' to 'package'.The constructor documentation has been properly updated to use the new 'package' terminology, which is consistent with the broader changes in this PR.
Also applies to: 56-56
259-259: Updated documentation for archive structures.The comment header for the
OwlPackStructureTypeenum has been updated to reference "package archive structures" instead of "product archive structures", maintaining consistent terminology throughout the codebase.owlplug-client/src/main/java/com/owlplug/explore/model/SourceType.java (1)
24-24: Added new OAS_REGISTRY source typeThe addition of the
OAS_REGISTRYsource type is aligned with the PR's objective to implement support for Open Audio Stack Registry. This replacement for the previously removedOWLPLUG_STOREmaintains the expected enum structure with the correct parameter types.README.md (3)
84-84: Clarified terminology with registry referenceThe addition of "(or Registry)" to the Remote Source description helps users understand the terminology changes and makes the documentation more consistent with the code changes.
137-139: Added Open Audio Stack badgeThe addition of the "powered-by-open-audio-stack" image appropriately acknowledges the integration with the Open Audio Stack framework and aligns with the PR objective to add an OAS badge.
94-98:Details
❓ Verification inconclusive
Updated registry information to reference Open Audio Stack
The replacement of StudioRack registry with Open Audio Stack registry aligns with the PR objectives. The updated URL format is different from the OwlPlug Registry (no .json extension) - verify this is the correct format.
🏁 Script executed:
#!/bin/bash # Verify that the Open Audio Stack Registry URL is valid and returns expected content curl -s -I "https://open-audio-stack.github.io/open-audio-stack-registry" | grep -E "HTTP|Content-Type"Length of output: 115
Attention: Confirm Redirect Resolution for Open Audio Stack Registry URL
The update to reference the Open Audio Stack registry aligns with the PR objectives. However, our verification shows that the URL “https://open-audio-stack.github.io/open-audio-stack-registry” currently returns an HTTP/2 301 redirect. Please ensure this redirect leads to the correct final resource with the intended content, especially considering that the updated URL intentionally omits the .json extension compared to the OwlPlug Registry.
- Verify that following the redirect (using, for example,
curl -s -o /dev/null -w "%{http_code}" -L ...) results in a 200 response and the expected content.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASPackage.java (1)
29-51: Getters and setters look goodAll required getters and setters are properly implemented following Java bean conventions.
owlplug-client/src/main/java/com/owlplug/core/controllers/DirectoryInfoController.java (2)
33-33: Added StringUtils importThe import of StringUtils aligns with the code changes and is correctly placed in the import section.
139-140:Details
✅ Verification successful
Refactored to use centralized StringUtils utility class
The replacement of a local ellipsis method with a centralized utility method improves code organization and promotes code reuse. The functionality remains the same, maintaining backward compatibility.
🏁 Script executed:
#!/bin/bash # Verify that the StringUtils class exists and contains the ellipsis method fd StringUtils.java | xargs grep -A 10 "ellipsis"Length of output: 444
Centralized StringUtils Utility Verified
The refactor to use the centralized
StringUtils.ellipsismethod is correctly implemented. Verification confirms that the utility class contains the expected method, and its behavior remains consistent with the original functionality. The changes inowlplug-client/src/main/java/com/owlplug/core/controllers/DirectoryInfoController.javaare good to go.
- Confirmed implementation in
StringUtils.javamatches expectations.owlplug-client/src/main/resources/fxml/dialogs/NewSourceView.fxml (3)
23-23: Updated suggestion count to match new implementation.The label has been updated to reflect that there are now 3 plugin source suggestions instead of 2, which properly aligns with the UI elements shown (OwlPlug Registry and Open Audio Stack).
39-50: Successfully transitioned from Studiorack to Open Audio Stack.The button has been appropriately renamed and its text updated to reflect the transition from "Studiorack Registry" to "Open Audio Stack" in line with the PR objectives.
41-49: Properly structured Open Audio Stack logo container.The image container implementation is consistent with other similar components in the UI (like the OwlPlug logo component), ensuring visual consistency throughout the application.
owlplug-client/src/main/java/com/owlplug/explore/dao/RemotePackageDAO.java (4)
26-26: Added Set import for more appropriate collection usage.The import of
java.util.Setis correctly added to support the parameter type change in thehasPlatformTagmethod.
46-47: Updated documentation to reflect package terminology.The Javadoc has been updated to use "package" instead of "product," bringing consistency to the new terminology used throughout the application.
124-125: Updated documentation to reflect package terminology.The Javadoc has been updated to use "Package tag" instead of what was likely "Product tag," bringing consistency to the new terminology used throughout the application.
139-140: Updated documentation to reflect package terminology.The Javadoc has been updated to use "Package type" instead of what was likely "Product type," bringing consistency to the new terminology used throughout the application.
owlplug-client/src/main/java/com/owlplug/explore/controllers/NewSourceDialogController.java (4)
59-59: Renamed button field to match UI component.The field has been correctly renamed from
studiorackSuggestionButtontoopenAudioSuggestionButtonto reflect the UI changes in the FXML file.
82-84: Updated button action to use Open Audio Registry URL.The action handler has been properly updated to retrieve the Open Audio Registry URL instead of the Studiorack Registry URL, aligning with the PR objectives.
105-107: Updated button disable logic for Open Audio Registry.The logic that disables the button if the source already exists has been correctly updated to check against the Open Audio Registry URL.
147-148: Updated success message and analytics tracking.The success message now correctly refers to "plugin source" instead of "plugin store", and the analytics page view path has been updated from "/app/store/action/add" to "/app/source/action/add", maintaining consistency with the new terminology.
owlplug-client/src/main/resources/fxml/Preloader.fxml (4)
3-5: Improvement: Consolidated imports for better maintainability.The wildcard imports for JavaFX components improve code readability and make future additions more manageable.
7-7: Updated JavaFX version to modern release.The JavaFX version has been updated from an older version to 17.0.2-ea, which aligns with modern JavaFX standards and ensures compatibility with newer features.
17-17: Adjusted UI element dimensions for better visual alignment.The ImageView dimensions and positions have been fine-tuned to present a more balanced layout in the preloader screen.
Also applies to: 22-22
24-24: Updated branding to use Open Audio Stack image.This change aligns with the PR objectives to implement support for the Open Audio Stack Registry by replacing the Steinberg VST logo with the Open Audio Stack badge.
owlplug-client/src/main/java/com/owlplug/explore/controllers/ExploreController.java (3)
121-121: Updated terminology to align with OAS Registry terminology.The comment has been updated to use "packages from remote sources" instead of "products from store," aligning with the new Open Audio Stack Registry terminology.
281-283: Standardized method documentation to use "package" terminology.Documentation has been updated to use "remote source package list" and "Remote package list" instead of store-related terminology, maintaining consistency with the Open Audio Stack Registry specification.
480-480: Renamed method to follow new package-based nomenclature.Method renamed from
installProducttoinstallPackageto maintain consistency with the new terminology throughout the codebase.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/RegistryMapper.java (3)
19-19: Improved package structure to better reflect component purpose.Package changed from
com.owlplug.explore.model.jsontocom.owlplug.explore.model.mappers.registry, which better describes the mapper's role and association with registries.
23-23: Simplified class name to follow new mapping conventions.Class renamed from
RegistryJsonMappertoRegistryMapper, removing the technology-specific "Json" qualifier for a more generic and adaptable naming convention.
28-28: Updated field and method types to use new mapper classes.Changed from
Map<String, PackageJsonMapper>toMap<String, PackageMapper>to align with the updated mapper class structure.Also applies to: 46-46, 50-50
owlplug-client/src/main/java/com/owlplug/core/model/platform/RuntimePlatform.java (1)
35-35: Added support for platform aliases.Added a new field to store platform aliases, which will enhance platform identification across different naming conventions.
owlplug-client/src/main/java/com/owlplug/core/utils/StringUtils.java (1)
21-42: Well-designed utility class with clean implementations.The
StringUtilsclass contains two well-implemented string utility methods that handle edge cases appropriately:
truncate- Truncates a string to a specified length with a suffixellipsis- Adds an ellipsis in the middle of a string while preserving its beginning and end partsBoth methods handle null inputs, invalid sizes, and edge cases correctly. The code is clean and follows good practices.
owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBundlesView.java (3)
46-46: Class and method renaming aligns with product to package terminology shift.The class has been renamed from
ProductBundlesViewtoPackageBundlesView, and the methodaddProductBundlehas becomeaddPackageBundle. This change is consistent with the PR's objective to replace legacy specifications and align with the Open Audio Stack Registry terminology.Also applies to: 57-57, 68-68
88-91: Improved UI layout with better text handling.The changes improve the UI layout and text display:
- Setting
setWrapText(true)allows long bundle names to wrap instead of being cut off- Giving
bundleNamea higher growth priority (Priority.ALWAYS) ensures it uses available space- Changing
fillertoPriority.SOMETIMESallows other elements to take precedence when neededThese changes enhance the readability and usability of the UI component.
Also applies to: 94-95
99-100: Fixed potential UI layout issues.Setting
setMinWidth(USE_PREF_SIZE)on theinstallButtonandsizeLabelensures they don't get compressed below their preferred size when the window is resized, maintaining button visibility and text readability.Also applies to: 106-107
owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/PackageVersionMapper.java (2)
19-19: Package and class renamed to align with new architecture.The package has been renamed from
com.owlplug.explore.model.jsontocom.owlplug.explore.model.mappers.registry, and the class has been renamed fromPackageVersionJsonMappertoPackageVersionMapper. This change:
- Indicates a shift from JSON-specific mapping to a more generic mapping structure
- Organizes mapper classes into a dedicated registry package
- Aligns with the PR's goal of adding OASR model mapping classes
These changes make the code structure more maintainable and clearer.
Also applies to: 23-23
35-35: Field type updated for consistency.The field type was changed from
List<BundleJsonMapper>toList<BundleMapper>, with corresponding updates to getter and setter methods. This maintains consistency with the mapper class renaming throughout the codebase.Also applies to: 119-125
owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.java (2)
75-75: Added resource for Open Audio Stack.The new image resource
openAudioLogoSmallreplaces the removedstudiorackLogoSmallresource, aligning with the PR's objective to replace StudioRack with Open Audio Stack Registry support.
228-230:Details
✅ Verification successful
New method for Open Audio Registry URL.
This method replaces the removed
getStudiorackRegistryUrl()method, retrieving the Open Audio Registry URL from application properties. This supports the transition from StudioRack to Open Audio Stack Registry.
🏁 Script executed:
#!/bin/bash # Verify the property exists in application properties and that the old property has been removed # Look for openaudio.registry.url property echo "Checking for Open Audio Registry URL property..." fd --type f "application.properties" -x grep -l "openaudio.registry.url" {} \; # Verify the old studiorack.registry.url property has been removed echo "Verifying removal of StudioRack Registry URL property..." fd --type f "application.properties" -x grep -l "studiorack.registry.url" {} \; # Check for any remaining references to getStudiorackRegistryUrl() echo "Checking for any remaining references to getStudiorackRegistryUrl..." rg "getStudiorackRegistryUrl" --type javaLength of output: 638
Verified: New Open Audio Registry URL method implementation is correct
- The new method in
owlplug-client/src/main/java/com/owlplug/core/components/ApplicationDefaults.javacorrectly retrieves theopenaudio.registry.urlproperty.- Verification scripts confirm that the
openaudio.registry.urlproperty exists inowlplug-client/src/main/resources/application.properties.- There are no remaining references to the deprecated
getStudiorackRegistryUrl()method or its associatedstudiorack.registry.urlproperty.owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASRegistry.java (6)
19-19: Package structure aligns with new OAS model architecture.The package structure has been updated from legacy JSON mapping to the new OAS model mapping, which better reflects the purpose of this class.
21-22: Appropriate import for Map collection.The import is correctly updated to reflect the change from List to Map collection type.
23-23: Proper class renaming for OAS compliance.The class has been correctly renamed from
StoreJsonMappertoOASRegistryto better reflect the Open Audio Stack Registry concept.
28-30: Data structure improved from List to Map for better plugin lookup.Changing from
List<ProductJsonMapper> productstoMap<String, OASPackage> pluginsimproves lookup performance and better represents the relationship between plugin identifiers and their metadata.
56-58: Properly updated getter method to reflect data structure change.The getter now correctly returns a Map of OASPackage objects keyed by string identifiers, replacing the previous List of products.
60-62: Setter method appropriately updated for new data structure.The setter parameter type has been updated to match the new field type, maintaining proper encapsulation.
owlplug-client/src/main/java/com/owlplug/explore/ui/PackageBlocView.java (5)
24-24: Added StringUtils dependency for text processing.StringUtils is now imported to support string truncation functionality, which is used for displaying bundle names.
63-68: Documentation updated to align with package-based terminology.The JavaDoc comments have been updated from product/store-based terminology to package/registry-based terminology, maintaining consistency with the overall refactoring.
126-129: UI label updated to match new Remote Source terminology.The text has been updated to display "Auto" instead of a store-specific reference, making the UI more generic and aligned with the remote source concept.
131-131: Method call updated to use new package-based terminology.The method call has been correctly updated from
installProducttoinstallPackage, maintaining consistency with the renamed methods in the controller.
143-143: Improved UI for bundle names using string truncation.Added string truncation for bundle names to improve the UI appearance and prevent overly long names from breaking the layout. This is a good usability improvement.
owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/PackageMapper.java (5)
19-19: Package path updated to reflect new model structure.The package has been moved from
jsontomappers.registry, better categorizing it within the application's architecture.
24-24: Class renamed for consistency with mapper pattern.The class has been properly renamed from
PackageJsonMapperto simplyPackageMapper, removing the JSON suffix which aligns with the refactoring of json-specific classes to general mapping classes.
29-29: Updated field type to use new mapper class.The versions field now uses
PackageVersionMapperinstead ofPackageVersionJsonMapper, maintaining consistency with the overall renaming pattern.
47-47: Updated getter return type to match new field type.The getter's return type has been properly updated to match the field's new type.
51-51: Updated setter parameter type to maintain consistency.The setter's parameter type has been properly updated to match the field's new type.
owlplug-client/src/main/java/com/owlplug/explore/model/mappers/oas/OASModelAdapter.java (5)
19-31: Well-structured imports for new adapter class.The imports are properly organized, including core model classes, explore model classes, and Java collection utilities.
32-47: Well-designed adapter method for registry conversion.The
mapperToEntitymethod forOASRegistrytoRemoteSourceconversion is well-documented and correctly implements the adapter pattern. The method properly sets relevant fields from the source to the target object.
48-93: Comprehensive adapter for plugin conversion with proper filtering.The adapter method for converting OAS plugins to OwlPlug's
RemotePackageincludes important validations:
- Type validation for supported plugin types
- File type filtering to only include archives
- Proper handling of bundles and tags
This ensures data integrity during the conversion process.
95-124: Bundle conversion logic handles targets and size conversion correctly.The
mapperToEntitymethod forOASFiletoPackageBundleconversion properly:
- Sets download URLs and checksums
- Handles target systems and architectures
- Converts file size from bits to bytes
- Sets appropriate plugin formats
The size conversion comment on line 120 is particularly helpful for clarifying the unit conversion.
126-137: Clean and efficient format mapping using modern switch expressions.The plugin format mapping uses Java's modern switch expression syntax effectively, making the code concise and readable. The use of a HashSet ensures no duplicate formats are included.
owlplug-client/src/main/java/com/owlplug/explore/tasks/SourceSyncTask.java (1)
95-99: Ensure source consistency and support.The conditional logic checks for
OWLPLUG_REGISTRYorOAS_REGISTRY, but if future registry types are introduced, they might not be handled. Consider adding a default or logging behavior for unknown types.owlplug-client/src/main/java/com/owlplug/explore/controllers/PackageInfoController.java (2)
93-116: InitializebundlesViewonce and verify multiple calls toinitialize.Currently,
bundlesViewis constructed ininitialize(). Ifinitialize()is called multiple times, re-instantiation may occur. Confirm a single initialization is intended.
214-214: Consistent naming for bundle addition.Replacing
addProductBundlewithaddPackageBundlealigns well with the new naming convention. Good consistency across the codebase!owlplug-client/src/main/java/com/owlplug/explore/model/mappers/registry/RegistryModelAdapter.java (2)
34-45: Recommend adding null-check or fallback forregistryMapperfields.
You might want to safely handle cases whereregistryMapper.getName()orregistryMapper.getUrl()returnsnull, to prevent potential null-pointer issues or blank fields on theRemoteSourceentity.
93-123: Review default fallback for missing bundle formats.
Currently, if the format is undefined, the code defaults to"vst2". Verify whether this is the intended behavior for all missing or unknown formats. If not, a more explicit handling or user prompt might be preferable.owlplug-client/src/main/java/com/owlplug/explore/services/ExploreService.java (1)
124-153: Handle empty or missing bundles infindBestBundle().
IfremotePackage.getBundles()is empty, this method returnsnull. Confirm whether returningnullis acceptable or if a fallback bundle or exception should be used.
Implement OAS-R (Open Audio Stack Registry) support to OwlPlug (#275)
The support of OAS-M (Open Audio Stack Manager) specification is out of scope of this PR.