-
Notifications
You must be signed in to change notification settings - Fork 4
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
Added a CLI command to list Metapath functions #39
Added a CLI command to list Metapath functions #39
Conversation
WalkthroughWalkthroughThe recent changes focus on enhancing the functionality and usability of the Metaschema CLI and core libraries. Key updates include renaming methods for consistency, adding new methods for resource conversion, streamlining command imports, and refactoring file handling logic. Additionally, new commands and test cases have been introduced to improve Metaschema operations and validation processes. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (12)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionLibrary.java (1 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java (3 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java (1 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionLibrary.java (1 hunks)
- databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java (1 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java (2 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (5 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java (2 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (3 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java (1 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/MetapathCommand.java (1 hunks)
- metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java (1 hunks)
Files skipped from review due to trivial changes (5)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionLibrary.java
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionLibrary.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/MetapathCommand.java
Additional comments not posted (12)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java (2)
32-32
: Added import forMetapathCommand
.This import is necessary for the new CLI command to function.
63-63
: AddedMetapathCommand
to command handlers.This change integrates the new
MetapathCommand
into the CLI, enabling the new functionality as described in the PR.core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java (2)
68-68
: Updated method call fromgetFunctionsAsStream
tostream
.This change aligns with the renaming of the method in the
IFunctionLibrary
interface, improving consistency across the codebase.
83-85
: Added newstream
method inFunctionService
.This method provides a streamlined way to access functions, enhancing the modularity and maintainability of the code.
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java (1)
52-131
: ImplementedListFunctionsSubcommand
for listing Metapath functions.The implementation correctly gathers and formats the function details for display, adhering to the requirements specified in the PR. The use of logging and structured data collection enhances the clarity and usability of the command.
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (2)
Line range hint
40-52
: Added imports for URI handling.These imports are necessary for the new URI handling logic in the command, which improves the robustness of source file processing.
183-191
: Refactored URI handling logic inAbstractConvertSubcommand
.This refactor enhances the command's ability to handle different types of sources (files and URLs) more reliably and provides clearer error messages on failures.
metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java (1)
144-146
: Added test case for thelist-functions
command inCLITest
.This addition ensures that the new command is covered by automated tests, which is crucial for maintaining the reliability of the CLI functionality.
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (2)
102-102
: Renamed extra argument tometaschema-module-file-or-URL
.This renaming clarifies the expected input for the command, which can now accept both local files and URLs, enhancing the command's flexibility.
214-214
: Updated URI handling inGenerateSchemaCommand
.This update improves the command's robustness in handling different types of input sources, ensuring that the command can handle both local and remote files effectively.
databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java (2)
526-559
: The implementation of theconvert
method using URI and Path parameters is correct and well-documented.
561-593
: The implementation of theconvert
method using URI and OutputStream parameters is correct and well-documented.
f7d5a45
to
b340ea4
Compare
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: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (12)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionLibrary.java (1 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java (3 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java (1 hunks)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionLibrary.java (1 hunks)
- databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java (1 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java (2 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (5 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java (2 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (3 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java (1 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/MetapathCommand.java (1 hunks)
- metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java (1 hunks)
Files skipped from review due to trivial changes (1)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunction.java
Files skipped from review as they are similar to previous changes (11)
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionLibrary.java
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/FunctionService.java
- core/src/main/java/gov/nist/secauto/metaschema/core/metapath/function/IFunctionLibrary.java
- databind/src/main/java/gov/nist/secauto/metaschema/databind/io/IBoundLoader.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/MetapathCommand.java
- metaschema-cli/src/test/java/gov/nist/secauto/metaschema/cli/CLITest.java
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: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java (2 hunks)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/MetaschemaCommands.java (1 hunks)
Files skipped from review due to trivial changes (2)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/CLI.java
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/MetaschemaCommands.java
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: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/MetaschemaCommands.java (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/MetaschemaCommands.java
240beb5
into
metaschema-framework:develop
Committer Notes
This adds a new CLI command
metaschema-cli metapath list-functions
that lists all supported functions and their signature.Example output:
All Submissions:
Changes to Core Features:
Summary by CodeRabbit
New Features
Path
orOutputStream
.Improvements
Bug Fixes
Tests