Add JSON and YAML output options for the jmp-admin, jmp-client, and jmp-exporter CLIs#335
Add JSON and YAML output options for the jmp-admin, jmp-client, and jmp-exporter CLIs#335
jmp-admin, jmp-client, and jmp-exporter CLIs#335Conversation
WalkthroughThe changes extend support for configurable output formats and non-interactive modes across the codebase. Updates include new parameters (e.g., Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as CLI Command
participant R as Resource Operation
participant P as Printer
U->>C: Execute command (--nointeractive, --output format)
C->>R: Process resource operation (create, delete, get, import)
R-->>C: Return resource data
alt Output option specified (JSON/YAML/NAME/PATH)
C->>P: Call corresponding print function
P-->>C: Return formatted output
else Default table output
C->>P: Build table representation
P-->>C: Return table view
end
C-->>U: Display result
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (5)
⏰ Context from checks skipped due to timeout of 90000ms (7)
🪧 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 (
|
✅ Deploy Preview for jumpstarter-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (15)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/json.py (3)
5-14: Well-designed JSON and YAML serialization base classThe
JsonBaseModelprovides a solid foundation for JSON and YAML serialization across the codebase, using Pydantic for robust validation and serialization. This class nicely supports the PR's objective of enabling standardized output formats.Consider enhancing the class documentation to include examples of usage and explain the purpose of each method in more detail.
8-9: Consider adding explicit error handling for JSON serializationWhile Pydantic's
model_dump_jsonhandles most serialization errors internally, consider adding explicit try/except blocks to gracefully handle any unexpected serialization failures.def dump_json(self): - return self.model_dump_json(indent=4, by_alias=True) + try: + return self.model_dump_json(indent=4, by_alias=True) + except Exception as e: + # Log the error or handle it appropriately + raise ValueError(f"Failed to serialize model to JSON: {e}") from e
11-12: Consider adding error handling for YAML serializationSimilar to the JSON serialization method, the YAML serialization could benefit from explicit error handling, especially since it involves both a Pydantic method and the yaml library.
def dump_yaml(self): - return yaml.safe_dump(self.model_dump(mode="json", by_alias=True), indent=2) + try: + model_dict = self.model_dump(mode="json", by_alias=True) + return yaml.safe_dump(model_dict, indent=2) + except Exception as e: + # Log the error or handle it appropriately + raise ValueError(f"Failed to serialize model to YAML: {e}") from epackages/jumpstarter-kubernetes/jumpstarter_kubernetes/list.py (2)
8-13: Generic list implementation looks goodThe
V1Alpha1Listclass provides a clean, generic implementation for representing lists of resources. The use of Pydantic'sFieldfor aliases and defaults is appropriate.Consider using TypeVar for better type safety:
-class V1Alpha1List[T](JsonBaseModel): +from typing import TypeVar, Generic + +T = TypeVar('T') + +class V1Alpha1List(JsonBaseModel, Generic[T]):This makes the generic type parameter more explicit and follows common patterns for generic classes in Python.
9-10: Enhance class documentationThe current documentation is minimal. Consider adding more details about the purpose of this class, how it's intended to be used, and examples of concrete implementations.
- """A generic list result type.""" + """A generic list result type for Jumpstarter resources. + + This class provides a standardized container for lists of resources, + following the Kubernetes-style API conventions with apiVersion and kind fields. + + Attributes: + api_version: The API version (always "jumpstarter.dev/v1alpha1") + items: The list of resources of type T + kind: The resource kind (always "List") + + Example: + ```python + class ClientList(V1Alpha1List[Client]): + kind: Literal["ClientList"] = Field(default="ClientList") + ``` + """packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py (1)
61-78: Consider handling empty list case for NAME output format.While JSON, YAML, and table output formats handle empty lists gracefully, the NAME output format (lines 65-67) doesn't output anything when the exporters list is empty. Consider adding a consistent feedback message for this case to improve user experience.
elif output == OutputMode.NAME: if len(exporters) > 0: click.echo(exporters[0].alias) + else: + click.echo("No exporter configs found")packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
43-49: Consider standardizing help messages for output options.There's a slight inconsistency in the help messages between
opt_output_name_only("resource/name") andopt_output_path_only("file/path"). Consider standardizing the terminology for a more consistent user experience.opt_output_path_only = click.option( "-o", "--output", type=click.Choice([OutputMode.PATH]), default=None, - help='Output mode. Use "-o path" for shorter output (file/path).', + help='Output mode. Use "-o path" for shorter output (resource/path).', )Also applies to: 53-59
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create.py (3)
7-8: Recommend clarifying relationship betweenOutputTypeandOutputMode.
The code checksif output == OutputMode.JSONlater, but the argument type here isOutputType. Ensure consistent naming and usage to avoid confusion.
101-103: Clarify operator precedence in the condition.
The expressionif save or out is not None or nointeractive is False and click.confirm(...):may be ambiguous. Wrap subexpressions in parentheses to avoid unexpected short-circuiting.- if save or out is not None or nointeractive is False and click.confirm("Save client configuration?"): + if (save or out is not None) or (nointeractive is False and click.confirm("Save client configuration?")):
179-181: Apply parentheses for clarity in condition.
Same concern as in the client creation flow. Adding parentheses avoids ambiguity in the boolean expression.- if save or out is not None or nointeractive is False and click.confirm("Save exporter configuration?"): + if (save or out is not None) or (nointeractive is False and click.confirm("Save exporter configuration?")):packages/jumpstarter-kubernetes/jumpstarter_kubernetes/leases.py (1)
34-72: Potential overshadowing of built-indict.
Usingdef from_dict(dict: dict)redefines the built-in. This can cause confusion in larger codebases. Consider renaming the parameter todataorpayload.- @staticmethod - def from_dict(dict: dict): + @staticmethod + def from_dict(data: dict): return V1Alpha1Lease( - api_version=dict["apiVersion"], - kind=dict["kind"], ... )packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (2)
37-48: Potential design choice inNAMEoutput
In each of these printing functions (print_clients,print_exporters,print_leases), only the first item’s name is emitted inNAMEmode. This differs from the typicalkubectlpattern, which prints all resources by name. If you’d like to matchkubectlbehavior, consider iterating over all items.Also applies to: 99-113, 163-174
134-150: Consider safe iteration inmake_lease_row
Iflease.spec.selectoris everNone, iterating labels could fail. Adding aNonecheck forlease.spec.selectormight prevent unexpectedAttributeError.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py (1)
21-23:V1Alpha1ClientStatusendpoint is non-optional
If a client might not have an endpoint at creation, you could makeendpointoptional. Otherwise, looks fine for guaranteed endpoints.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py (1)
35-57: Consider leveraging more of Pydantic's parsing capabilitiesWhile the
from_dictmethod works correctly, consider using Pydantic's built-in parsing to handle validation and error reporting more robustly.@staticmethod def from_dict(dict: dict): - return V1Alpha1Exporter( - api_version=dict["apiVersion"], - kind=dict["kind"], - metadata=V1ObjectMeta( - creation_timestamp=dict["metadata"]["creationTimestamp"], - generation=dict["metadata"]["generation"], - name=dict["metadata"]["name"], - namespace=dict["metadata"]["namespace"], - resource_version=dict["metadata"]["resourceVersion"], - uid=dict["metadata"]["uid"], - ), - status=V1Alpha1ExporterStatus( - credential=V1ObjectReference(name=dict["status"]["credential"]["name"]) - if "credential" in dict["status"] - else None, - endpoint=dict["status"]["endpoint"], - devices=[V1Alpha1ExporterDevice(labels=d["labels"], uuid=d["uuid"]) for d in dict["status"]["devices"]] - if "devices" in dict["status"] - else [], - ), - ) + # Let Pydantic handle validation and parsing + return V1Alpha1Exporter.model_validate(dict)This approach would use Pydantic's built-in validation, which can handle missing fields more gracefully and provide better error messages when parsing fails.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (27)
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create.py(7 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create_test.py(5 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete.py(3 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete_test.py(4 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get.py(3 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get_test.py(14 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res.py(5 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res_test.py(3 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py(1 hunks)packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py(3 hunks)packages/jumpstarter-cli-common/jumpstarter_cli_common/__init__.py(2 hunks)packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py(2 hunks)packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py(2 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/__init__.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py(3 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients_test.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py(2 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters_test.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/json.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/leases.py(2 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/list.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/serialize.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/test_leases.py(1 hunks)packages/jumpstarter-kubernetes/pyproject.toml(2 hunks)packages/jumpstarter/jumpstarter/config/__init__.py(2 hunks)packages/jumpstarter/jumpstarter/config/client.py(5 hunks)packages/jumpstarter/jumpstarter/config/exporter.py(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: pytest-matrix (3.13)
- GitHub Check: pytest-matrix (3.12)
- GitHub Check: e2e
- GitHub Check: pytest-matrix (3.11)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (121)
packages/jumpstarter-kubernetes/pyproject.toml (4)
10-13: Good addition of Pydantic dependencyThe addition of the Pydantic dependency aligns well with the PR objective of adding JSON and YAML output options, as it provides robust data validation and serialization capabilities. The version constraint is appropriate and ensures compatibility with modern Pydantic features.
5-5: Formatting change looks goodThe authors section has been reformatted from a multi-line to a single-line format, which is consistent with modern TOML styling practices.
18-21: Consistent formatting of dev dependenciesThe dev dependencies section has been reformatted to match the main dependencies section, providing a consistent style throughout the file.
30-30: Minor formatting fixThe spacing around curly braces in the raw-options property has been adjusted for better readability.
packages/jumpstarter/jumpstarter/config/__init__.py (2)
1-9: Good addition of list types to importsThe addition of
ClientConfigListV1Alpha1andExporterConfigListV1Alpha1to the imports aligns well with the PR objective of supporting standardized output formats for collections of resources.
22-26: Proper update to all listThe
__all__list has been correctly updated to include the new types, ensuring they're available when importing from this module.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res_test.py (4)
2-2: Good addition of Path importAdding the Path import is necessary for the updated test cases that verify the path output functionality.
59-64: LGTM: Non-interactive mode test is well implementedThe test for the new
--nointeractiveflag properly verifies that client configurations can be saved without user prompts, matching the PR goal of improving CLI automation.
74-83: Comprehensive test for path output optionThis test correctly verifies the new
--output pathfunctionality, ensuring that the command correctly returns only the path to the saved file instead of success messages. The mock return value update on line 76 is essential to support this functionality.
137-143: Good parallel implementation for exporter path outputThe test for exporter path output matches the client implementation, maintaining consistency in behavior across resource types. This ensures that both client and exporter commands provide the same user experience.
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters_test.py (3)
1-21: Well-structured test setup with comprehensive test dataThe test exporter object is created with complete metadata and status fields, providing thorough coverage for serialization testing. This approach will help catch any serialization issues with complex nested objects.
24-69: Thorough JSON serialization testThe test validates that the
dump_jsonmethod produces the expected JSON output including all nested properties. The comprehensive expected output validates that the serializer handles complex nested objects correctly.
71-107: Complete YAML serialization testThe test for YAML serialization complements the JSON test, ensuring both output formats work correctly. Having both tests provides complete coverage of the output options in the PR objectives.
packages/jumpstarter/jumpstarter/config/client.py (6)
10-10: Updated imports to support enhanced serializationThe addition of
ConfigDictimport from Pydantic is necessary for the new configuration options in the addedClientConfigListV1Alpha1class.
40-41: Field definition improvement for serialization supportRemoving the
exclude=Trueparameter allows these fields to be included in model dumps when needed, which supports the enhanced output options being added.
186-186: Method return type enhancementUpdating the
savemethod to return aPathobject enables the new path output option, allowing CLI commands to display the path to the saved file.
196-197: Improved YAML dumping with exclusionsThe updated YAML dumping excludes path and alias fields, which aren't part of the standard configuration and shouldn't be persisted, while returning the path for programmatic usage.
201-201: Consistent exclusion in dump_yaml methodThis change ensures the same fields are excluded in both the save method and the dump_yaml method, maintaining consistency in the serialized output.
234-247: Well-designed ClientConfigListV1Alpha1 classThis new class provides a structured way to represent multiple client configurations, with proper serialization methods for both JSON and YAML. The model configuration enables arbitrary types and naming consistency with the API.
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/serialize.py (3)
1-5: Appropriate imports for serialization functionalityThe imports provide all necessary types and utilities for the serialization functionality, including Pydantic's WrapSerializer for custom serialization behavior.
7-10: Clean and efficient serialization functionThe
k8s_obj_to_dictfunction effectively converts Kubernetes objects to dictionaries while filtering outNonevalues, which produces cleaner output and is a best practice for serialization.
12-14: Type annotations for consistent serializationThese type annotations using
WrapSerializerprovide a clean, reusable way to handle serialization of common Kubernetes objects across the codebase, promoting consistency and reducing code duplication.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/test_leases.py (4)
1-4: Good imports and module structuringThe imports are well organized, clearly separating the Kubernetes async client models from the Jumpstarter-specific classes.
5-32: Well-structured test fixture with comprehensive test dataThe TEST_LEASE constant provides a complete representation of a lease object with all required fields, which is excellent for testing the serialization methods. The test data includes metadata, spec, and status fields with realistic values.
35-99: Good test for JSON serializationThe test validates that the
dump_json()method correctly serializes the lease object to a properly formatted JSON string. All expected fields are present in the output, maintaining the proper structure and relationships.
102-156: Good test for YAML serializationThe test confirms that the
dump_yaml()method correctly serializes the lease object to a properly formatted YAML string. The YAML representation maintains the same data structure as the JSON format but in YAML syntax.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/__init__.py (2)
1-11: Well-organized imports with clear groupingThe imports have been updated to include the new list classes for clients, exporters, and leases. The parentheses for the exporters imports improve readability for the multi-line import. The V1Alpha1List base class import is also appropriately added.
13-32: Consistent all list updated with new exportsThe all list has been properly updated to include the new list classes, maintaining alphabetical ordering within logical groupings. This ensures that the new classes are properly exposed for import from the package.
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients_test.py (3)
1-17: Good test fixture for client serializationThe TEST_CLIENT constant is well-structured with all necessary fields for testing serialization. The use of V1ObjectMeta for metadata is consistent with Kubernetes patterns.
20-45: Thorough test for JSON serialization of client objectThe test properly validates that the client object can be serialized to a correctly formatted JSON string, with all expected fields included.
47-69: Thorough test for YAML serialization of client objectThe test ensures that the client object can be serialized to a correctly formatted YAML string, maintaining data consistency with the JSON representation.
packages/jumpstarter-cli-common/jumpstarter_cli_common/__init__.py (2)
2-16: Well-organized imports with clear grouping of output-related typesThe imports have been expanded to include the new output-related types and options, using parentheses for improved readability. The organization makes it clear which options are related to output formatting.
21-40: Properly updated all list with new exportsThe all list has been extended to include all the new output-related types and options, maintaining a logical grouping and making these entities available for import from the package.
packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py (1)
55-59: Good implementation of multiple output formats.The function now accepts an
outputparameter following the PR objectives to support JSON, YAML, and NAME formats, with proper decoration using@opt_output_all.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create_test.py (6)
37-40: Good update to include credential field in V1Alpha1ClientStatus.The addition of the credential field with a V1ObjectReference properly aligns with the model structure used in Kubernetes.
42-70: Well-structured JSON and YAML templates for client objects.These templates provide excellent examples of the expected output format, making them valuable for testing the new output format functionality.
143-169: Comprehensive test coverage for non-interactive client creation.The tests effectively verify all the new output formats (JSON, YAML, and NAME) and confirm that the configuration isn't saved in non-interactive mode, which is crucial behavior.
184-185: Good enhancement of V1Alpha1ExporterStatus with credential field.Similar to the client object, this properly includes the credential reference in the exporter status.
188-218: Well-structured JSON and YAML templates for exporter objects.These templates are consistent with the client templates and provide clear examples of the expected output formats.
269-295: Good test coverage for non-interactive exporter creation.The tests thoroughly verify all the supported output formats and confirm the expected behavior in non-interactive mode.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete_test.py (3)
128-157: Good test coverage for non-interactive client deletion.These tests verify that the non-interactive flag works correctly for client deletion and that the NAME output format returns the expected value.
170-173: Proper update to include credential field in V1Alpha1ExporterStatus.The addition of the credential field with a V1ObjectReference matches the changes made in other files, ensuring consistency across the codebase.
234-258: Good test coverage for non-interactive exporter deletion.The tests effectively verify both the non-interactive flag and the NAME output format for exporter deletion, ensuring the new functionality works as expected.
packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (3)
24-29: Good definition of OutputMode class.The OutputMode class clearly defines the supported output formats as string constants, making them easy to reference throughout the codebase.
33-39: Well-implemented output option for all formats.The
opt_output_alloption supports JSON, YAML, and NAME output formats with a clear help message explaining the usage.
61-63: Good implementation of non-interactive option.The
opt_nointeractiveoption is well-defined with a clear help message indicating its purpose for scripting scenarios.packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (5)
4-9: Well-structured imports to support new output formatsThe addition of
OutputMode,OutputType, andopt_output_allimports is appropriate for implementing the new output formatting options mentioned in the PR.
12-18: Well-organized config importsGood organization of imports with the addition of
ClientConfigListV1Alpha1which is needed for the structured output formats.
121-123: Good use of decorator for CLI option handlingThe
@opt_output_alldecorator and updated function signature properly implement the output options described in the PR objectives, allowing for JSON, YAML, and NAME formats.
132-139: Clean implementation of JSON, YAML, and NAME output formatsThe conditional logic for handling different output formats is clear and follows good practices. Using the
ClientConfigListV1Alpha1class with its built-in serialization methods ensures consistent output formatting.
140-151: Preserved backward compatibility with table outputThe implementation maintains backward compatibility by keeping the original table output format as the default behavior, which is a good practice when adding new features.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete.py (8)
5-14: Good import organization for new CLI optionsThe addition of
NameOutputType,opt_nointeractive, andopt_output_name_onlyimports properly supports the new CLI options for output control and automation.
36-50: Well-structured decorators for the delete_client commandThe addition of the
@opt_output_name_onlyand@opt_nointeractivedecorators enhances the CLI interface by supporting structured output formats and non-interactive mode, which aligns perfectly with the PR objectives.
51-58: Clear function signature updates for enhanced CLI optionsThe function signature is properly updated to include the new
outputandnointeractiveparameters, maintaining backward compatibility while adding new functionality.
63-66: Good conditional output formattingThe implementation correctly checks the output mode and formats the response accordingly. Using resource-typed paths (
client.jumpstarter.dev/{name}) follows good Kubernetes-like conventions.
68-70: Proper handling of non-interactive mode for automationThe condition to check for non-interactive mode before prompting for confirmation is well-implemented, allowing for automation when using the
--nointeractiveflag.
78-80: Consistent output handling for confirmation messagesThe code consistently checks the output mode before printing confirmation messages, maintaining a clean user experience in both interactive and non-interactive modes.
98-108: Consistent implementation for delete_exporter commandThe changes to the
delete_exportercommand follow the same pattern asdelete_client, ensuring a consistent CLI experience across different resource types.
113-124: Consistent output handling in delete_exporterThe output handling in the
delete_exporterfunction mirrors that ofdelete_client, maintaining a consistent approach throughout the codebase.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res.py (7)
4-11: Good import organization for new CLI optionsThe addition of
PathOutputType,opt_nointeractive, andopt_output_path_onlyimports properly supports the new CLI options for output control and automation in import operations.
47-52: Well-structured decorators for the import_client commandThe addition of the
@opt_output_path_onlyand@opt_nointeractivedecorators enhances the CLI interface by supporting structured output formats and non-interactive mode for import operations.
53-62: Clear function signature updates for enhanced CLI optionsThe function signature is properly updated to include the new
outputandnointeractiveparameters, maintaining backward compatibility while adding new functionality to the import_client command.
69-74: Proper handling of non-interactive modeThe conditional logic for handling non-interactive mode is well-implemented, bypassing interactive prompts when the
--nointeractiveflag is set, which is essential for automation.
75-88: Good conditional output handlingThe implementation correctly checks the output mode before printing messages and handles the output path appropriately, providing a clean user experience in both interactive and non-interactive modes.
105-115: Consistent implementation for import_exporter commandThe changes to the
import_exportercommand follow the same pattern asimport_client, ensuring a consistent CLI experience across different resource types.
125-132: Consistent output handling in import_exporterThe output handling in the
import_exporterfunction is implemented consistently with the approach used inimport_client, maintaining a uniform pattern throughout the codebase.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get_test.py (12)
41-78: Well-structured test data for client output formatsThe test data constants for client objects in various formats (JSON, YAML) are well-defined and accurately represent the expected output structures, providing a solid foundation for testing.
95-114: Comprehensive test cases for client output formatsThe test cases for client JSON, YAML, and NAME output formats are thorough and verify the correct behavior of the CLI commands with different output options.
130-226: Thorough test data for client list output formatsThe test data constants for client lists in various formats are comprehensive and include both populated and empty list scenarios, which is excellent for complete test coverage.
244-291: Good coverage of client list output formatsThe test cases properly verify all output formats for client lists, including edge cases like empty lists, ensuring that the CLI behaves correctly in all scenarios.
294-333: Well-structured test data for exporter output formatsSimilar to the client test data, the exporter test data is well-organized and covers all output formats, maintaining consistency in testing approach.
350-369: Good test coverage for exporter output formatsThe test cases for exporter output formats follow the same comprehensive approach as the client tests, ensuring consistent behavior across resource types.
384-447: Comprehensive test data for exporters with devicesThe test data for exporters with devices is thorough and accurately represents complex nested structures in different output formats.
466-485: Good test coverage for exporter devices output formatsThe tests properly verify all output formats for exporters with devices, ensuring that complex nested structures are correctly serialized in different formats.
865-926: Comprehensive test data for lease output formatsThe test data constants for leases are thorough and accurately represent the expected structures in different output formats.
964-983: Good test coverage for lease output formatsThe test cases for lease output formats are comprehensive and verify the correct behavior of the CLI commands with different output options.
998-1129: Thorough test data for lease listsThe test data for lease lists is well-structured and comprehensive, covering the complexity of lease objects in different output formats.
1157-1176: Good test coverage for lease list output formatsThe test cases for lease list output formats follow the same comprehensive approach as other resource types, ensuring consistent behavior across the CLI.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create.py (12)
14-15: Validate interactive logic with non-interactive flag.
Addingopt_nointeractiveandopt_output_allis useful, but confirm that related prompts are skipped or included appropriately, preventing unexpected user interaction.
17-17: No concerns.
The new imports fromjumpstarter_kuberneteslook correct for the usage below.
40-47: Output printing function design looks good.
This function correctly handles JSON, YAML, and name-based outputs according to the specified mode. The code cleanly separates different output formats.
77-78: Streamline CLI decorators.
Stacking@opt_nointeractiveand@opt_output_allis consistent with the overall pattern. No issues found.
90-91: Ensure default output behavior is intuitive.
The function signature includesnointeractiveandoutput. Check if aNoneoutput gracefully defaults to a console/table format, matching user expectations.
96-99: Restrict extraneous console logs for non-JSON/YAML outputs.
The conditionif output is None:is a neat way to limit console messages. This aligns with the new format-based approach.
120-122: Confirm final output messages are suppressed for JSON/YAML.
The conditionif output is None:ensures minimal console feedback when users prefer structured output.
129-136: Output function design for exporters is consistent.
Mirroring the approach used for clients helps maintain consistent UX. No issues detected.
158-159: Retaining consistent decorators.
Same logic as the client creation. Looks good.
169-170: Same parameter arrangement for exporters.
Parallel structure fornointeractiveandoutputis appropriate, matching the client creation workflow.
175-177: Limit console feedback in non-JSON/YAML modes.
if output is None:check ensures structured outputs remain clean.
184-186: Consistent save logic with user notification.
The final message is displayed only for the default (non-structured) mode, achieving the desired interactive experience.packages/jumpstarter/jumpstarter/config/exporter.py (10)
10-10: No issues with import changes.
The import frompydanticis appropriate for model classes.
72-72: Include alias in the model.
Definingalias: str = "default"is convenient to identify each exporter config. This ensures clarity in referencing.
74-75: Usage of defaultapiVersionandkind.
Setting these as fields with default literal values is consistent with other CRD-based models.
84-84: Optional path field.
Allowingpath: Path | Noneto be set later is a flexible approach. No concerns.
102-102: Type hint using-> Self.
Makes the code more concise in Python 3.11+, and clarifies that the class returns its own instance.
108-108: Implementinglist()usinglist[Self].
Good approach for type-checking. No immediate concerns.
116-117: Excluding fields from YAML dump.
Excludingaliasandpathmatches existing patterns. Verify that the omission of these fields is intentional.
120-121: Save method now returning a path is clear.
Returning the storage path clarifies usage for call sites that need confirmation of where the file is saved.
128-129: Safe dumping excludes certain fields.
Mirror logic fromdump_yaml. This ensures the model'saliasandpathremain internal while saving.
171-183: NewExporterConfigListV1Alpha1class is well-structured.
Providingdump_jsonanddump_yamlwithmodel_dumpensures consistent output. This fosters easier batch export of exporter configs.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/leases.py (8)
4-4: Expanded import usage.
Switching toFieldfrom pydantic is consistent with the changes below.
6-8: Adoption ofJsonBaseModel& new utilities.
Migrating to these classes is aligned with your approach to unify serialization logic.
12-17: RevisedV1Alpha1LeaseStatusfields.
Aliasing withField(alias="...")helps ensure JSON keys match the CRD spec. Properly marks optional fields.
20-21: Adding a typed field forclient.
UsingSerializeV1ObjectReferenceclarifies the reference type. No issues.
26-31: New Pydantic model forV1Alpha1Lease.
The defaultapi_versionandkindfields are a standard approach for CRD-based models.
77-82:V1Alpha1LeaseListclass mirrors the single object structure.
Returning items as typed instances enhances clarity for consumers.
85-86:LeasesV1Alpha1Apidocstring & concurrency approach.
The docstring clarifies this CRD's usage, and the approach for listing leases asynchronously is consistent with existing patterns.Also applies to: 88-88, 90-90, 93-93
100-101: Single lease retrieval.
Invokingfrom_dictis correct to maintain consistent Pydantic-based initialization. No concerns.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (6)
1-16: Imports and constants look consistent
This block correctly sets up the environment and includes the essential dependencies for output formatting.
18-23:make_client_rowhandles missing status gracefully
Returning an empty string for the endpoint whenclient.statusisNoneis good, preventing attribute errors. No issues found.
26-35:print_clientoutput logic is clear
All supported output modes (JSON, YAML, NAME, table) look well-implemented.
85-97:print_exporterfollows the same output pattern
Features consistent JSON/YAML/NAME/table logic. No new issues identified.
118-132:get_reasonlogic covers known lease statuses
The conditional checks for “Ready” and “Expired” are implemented well.
152-160:print_leaseis consistent
Follows the output modes pattern (JSON, YAML, NAME, table) with no issues.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get.py (1)
44-47: Newoutputanddevicesparameters integrated consistently
The updates inget_client,get_exporter, andget_leasecommands align well with the new print functions, providing flexible output modes. No issues found.Also applies to: 63-63, 68-68, 71-76, 100-101
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py (6)
6-11: Good refactoring toward structured model serializationThe imports have been updated to support the transition from standard classes to Pydantic's
JsonBaseModel. This change aligns with the PR objective of adding structured output formats (JSON, YAML) to the CLI tools.
18-20: Transition to JsonBaseModel improves serialization capabilitiesConverting the exporter-related classes to inherit from
JsonBaseModelis a good approach for supporting multiple output formats. The use of Pydantic'sFieldwith aliases forapiVersionand other camelCase fields ensures proper serialization.Also applies to: 23-26, 29-33
60-66: Excellent addition of List model for supporting multiple resultsThe new
V1Alpha1ExporterListclass integrates well with theV1Alpha1Listgeneric type and provides a clean way to handle collections of exporters. This enables proper serialization of lists for the CLI output formats.
71-77: Updated return type and deserialization approachThe
list_exportersmethod now correctly returns a typed list and uses the newfrom_dictmethod for deserialization. This change supports the new CLI output formats while maintaining backward compatibility.
78-84: Consistent deserialization patternThe
get_exportermethod has been updated to use the same deserialization pattern aslist_exporters, which ensures consistent handling of exporter objects throughout the codebase.
114-116: Final deserialization update for create operationUpdating the final return in
create_exportercompletes the refactoring across all API methods. This consistent approach ensures all exporter objects can be properly serialized for the new CLI output formats.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients_test.py (1)
1-59: Consider adding tests for edge cases and error conditions.While the current tests verify the basic functionality of the serialization methods, consider adding tests for:
- Objects with minimal required fields
- Objects with all optional fields populated
- Error handling for invalid inputs
This would improve test coverage and ensure robust handling of various scenarios.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients_test.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters_test.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/test_leases.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters_test.py
- packages/jumpstarter-kubernetes/jumpstarter_kubernetes/test_leases.py
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: pytest-matrix (3.13)
- GitHub Check: pytest-matrix (3.12)
- GitHub Check: e2e
- GitHub Check: pytest-matrix (3.11)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (3)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients_test.py (3)
5-17: Well-structured test fixture creation.The
TEST_CLIENTconstant provides a comprehensive test fixture with realistic values for all required fields. This is a good practice for testing serialization methods.
20-39: Well-implemented JSON serialization test.The test effectively validates that the
dump_json()method produces correctly formatted JSON output with the expected structure and indentation.
42-58: Well-implemented YAML serialization test.The test properly validates that the
dump_yaml()method produces correctly formatted YAML output that matches the expected structure.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py (1)
75-92: Output handling provides flexible formatsThe implementation cleanly supports multiple output formats (JSON, YAML, NAME) with appropriate formatting for each. The table output fallback provides good human-readable output when specific formats aren't requested.
Document NAME output behavior
When using
OutputMode.NAME, only the first exporter's alias is displayed, even if multiple exporters exist. Consider documenting this behavior or modifying it to handle multiple results more explicitly if this output is intended for automation.packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (2)
142-161: Well-structured output handlingThe implementation effectively supports multiple output formats with appropriate formatting for each type. The table output provides a clean human-readable format when specific machine formats aren't requested.
Document NAME output behavior
When using
OutputMode.NAME, only the first client's alias is displayed, even if multiple clients exist. Consider documenting this behavior or modifying it to handle multiple results more explicitly if this output is intended for automation.
171-173: Handle potential None returnThe
use_clientmethod might returnNoneif there's an issue with the client path, but there's no error handling here. Consider adding a check to handle this case gracefully.def use_client_config(name: str, output: PathOutputType): """Select the current Jumpstarter client configuration to use.""" user_config = UserConfigV1Alpha1.load_or_create() path = user_config.use_client(name) - if output == OutputMode.PATH: + if output == OutputMode.PATH and path: click.echo(path)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py(6 hunks)packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py(4 hunks)packages/jumpstarter/jumpstarter/config/client.py(5 hunks)packages/jumpstarter/jumpstarter/config/exporter.py(6 hunks)packages/jumpstarter/jumpstarter/config/user.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/jumpstarter/jumpstarter/config/exporter.py
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: Redirect rules - jumpstarter-docs
- GitHub Check: Header rules - jumpstarter-docs
- GitHub Check: Pages changed - jumpstarter-docs
- GitHub Check: e2e
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (4)
packages/jumpstarter/jumpstarter/config/client.py (2)
235-247: LGTM! New ClientConfigListV1Alpha1 class enhances serialization capabilities.The added class implements proper serialization methods for both JSON and YAML formats, aligning perfectly with the PR's objective to support multiple output options. The class structure provides a clean way to handle collections of client configurations.
186-197: Return type and behavior change enhances the API.Adding the
-> Pathreturn type and explicitly returning the config path improves the function's usability, especially when combined with the new output options. This change enables the CLI to properly display the path when requested via the path output mode.packages/jumpstarter-cli-exporter/jumpstarter_cli_exporter/exporter_config.py (1)
38-41: Path output handling works as expectedThe addition of conditional path output aligns with the PR objectives and provides a clean way to display the path when explicitly requested.
packages/jumpstarter-cli-client/jumpstarter_cli_client/client_config.py (1)
125-127: Path output follows consistent patternThe implementation of path output for delete operations follows the same pattern as create operations, maintaining consistency across the codebase.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (4)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py (2)
33-52: Consider safer dictionary lookups and avoid overshadowing built-in name.
- This method accesses fields like
"apiVersion","kind", and"metadata"directly, which can raiseKeyErrorif the raw dictionary lacks these keys. Consider using.getor validating input earlier.- At line 46,
dict["status"]["credential"]["name"]may raise aKeyErrorif"name"is missing orcredentialis empty. A safer approach is:credential=( V1ObjectReference(name=dict["status"]["credential"].get("name", "")) if "credential" in dict["status"] else None )- The function parameter
dict: dictovershadows the built-indicttype, which can cause confusion. Consider renaming the function argument to something likedataorraw_dict.
64-65: Class docstring offers good clarity.The short docstring succinctly describes the purpose of this API class for clients. Additional detail can be added if needed, but this is acceptable.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (2)
19-23: Consider handling aNoneendpoint more gracefully
Ifclient.statusis notNonebutclient.status.endpointisNone, the table would display"None". A small refinement could default to an empty string or "N/A" to avoid confusion in the UI.return { "NAME": client.metadata.name, - "ENDPOINT": client.status.endpoint if client.status is not None else "", + "ENDPOINT": client.status.endpoint if (client.status and client.status.endpoint) else "", "AGE": time_since(client.metadata.creation_timestamp), }
37-49: Refactor repeated single/multiple resource printing paths
Each function handling multiple resources has similar logic for JSON, YAML, NAME, or table outputs. Consider a unified helper or shared approach to avoid duplication and centralize future updates.Also applies to: 101-115, 165-177
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py(3 hunks)packages/jumpstarter/jumpstarter/config/user.py(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/jumpstarter/jumpstarter/config/user.py
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: pytest-matrix (3.13)
- GitHub Check: pytest-matrix (3.12)
- GitHub Check: e2e
- GitHub Check: pytest-matrix (3.11)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (11)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py (7)
7-11: Use of Pydantic and local modules is appropriate.The new imports from Pydantic and local modules are well-structured and correctly reference the necessary classes for model serialization. No issues found here.
21-22: Optional credential field is clear and consistent.Declaring
credentialas an optional field of typeSerializeV1ObjectReferenceclearly indicates that a client may not always have an associated credential. This design choice is coherent with the rest of the code.
26-30: Pydantic model for client resource is well-defined.Defining
api_versionandkindasLiteraltypes, along withmetadataand an optionalstatus, aligns with best practices for typed resource models. UsingFieldfor aliasing and defaults is also correct.
56-57: Client list model is consistent with standard Kubernetes resource lists.Declaring the
kindfield as"ClientList"and extendingV1Alpha1Listensures consistent behavior with other Kubernetes-style list objects.
59-61: Robust fallback for missing “items” key.Using
dict.get("items", [])prevents potential KeyErrors and gracefully handles empty or missing items. This aligns well with prior suggestions from older commits.
97-97: Reusing static method for updated client is consistent.Returning
V1Alpha1Client.from_dict(updated_client)neatly centralizes client instantiation logic. This is well-structured for maintainability.
102-102: Consistent list & get operations.The methods
list_clientsandget_clientalso leveragefrom_dict, ensuring a uniform creation process for all resources. This promotes reusability and consistent handling of the client data model.Also applies to: 107-107, 114-114
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (4)
43-45: Revisit NAME output for multiple client resources
Currently, you only print the first client’s name whenOutputMode.NAMEis selected, which deviates from typical CLI behavior (e.g.,kubectl get pods -o nameprints all items).Should this be updated to print each client on a new line? For instance:
- if len(clients.items) > 0: - click.echo(f"client.jumpstarter.dev/{clients.items[0].metadata.name}") + for c in clients.items: + click.echo(f"client.jumpstarter.dev/{c.metadata.name}")
69-70: HandleNonedevices to avoid iteration errors
Ife.status.devicesisNone, iterating over it will raise a TypeError.- for d in e.status.devices: + if e.status.devices: + for d in e.status.devices: + ...
107-108: Revisit NAME output for multiple exporter resources
You only print the first exporter’s name rather than all exporters. Confirm if that is intended or if you prefer a list-like output.- if len(exporters.items) > 0: - click.echo(f"exporter.jumpstarter.dev/{exporters.items[0].metadata.name}") + for exp in exporters.items: + click.echo(f"exporter.jumpstarter.dev/{exp.metadata.name}")
171-172: Revisit NAME output for multiple lease resources
Similar to clients and exporters, you only print the first lease’s name in NAME mode. Please confirm whether you want to print all leases.- if len(leases.items) > 0: - click.echo(f"lease.jumpstarter.dev/{leases.items[0].metadata.name}") + for l in leases.items: + click.echo(f"lease.jumpstarter.dev/{l.metadata.name}")
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py (1)
36-40: Consider standardizing indentation between JSON and YAML outputs.The JSON output uses 4-space indentation while YAML uses 2-space indentation. Consider standardizing both to 2-space for consistency, or documenting why they differ.
- def dump_json(self): - return self.model_dump_json(indent=4, by_alias=True) + def dump_json(self): + return self.model_dump_json(indent=2, by_alias=True)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py(2 hunks)packages/jumpstarter-cli-common/pyproject.toml(2 hunks)packages/jumpstarter-kubernetes/pyproject.toml(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/jumpstarter-kubernetes/pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: pytest-matrix (3.13)
- GitHub Check: pytest-matrix (3.12)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-devspace .devfile/Containerfile.client)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
- GitHub Check: pytest-matrix (3.11)
- GitHub Check: e2e
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter Dockerfile)
🔇 Additional comments (9)
packages/jumpstarter-cli-common/pyproject.toml (4)
5-5: Author Consolidation UpdateThe
authorsfield is now consolidated into a single entry with the specified name and email. Please verify that "kbrauer@hatci.com" is the correct email address intended for contact.
10-16: Dependency List Update and ReformattingThe dependencies list has been reformatted for consistency and now includes the new dependency
"pydantic>=2.8.2". Confirm that the versions for all listed dependencies meet your project’s requirements.
21-24: Development Dependencies FormattingThe
devdependency group has been updated to a more concise list format. Please ensure that the specified versions forpytestand its plugins are appropriate for your testing framework.
36-36: Raw-options Formatting ImprovementThe
raw-optionsentry now includes a space before the closing brace for improved consistency. Verify that this change does not interfere with any tooling or parsing mechanisms in your build process.packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py (5)
6-7: LGTM: Good choice of libraries for the new output formats.The addition of YAML and Pydantic provides robust serialization capabilities consistent with the PR objectives of adding JSON and YAML output options.
30-35: Well-structured Pydantic model for versioning.The
JumpstarterVersionclass effectively uses Pydantic features:
- Field aliases for standard JSON naming conventions
- ConfigDict with populate_by_name for flexible initialization
- Clean organization of version attributes
This makes the version information easily serializable to structured formats.
43-44: LGTM: Simple and effective factory function.This function efficiently creates a version object with the current package and Python versions.
47-56: Effective implementation of the output formatting requirements.The updated
versioncommand correctly implements the requirements of the PR by:
- Adding support for different output formats (JSON/YAML)
- Maintaining backward compatibility with the text output
- Using the new decorator for output format options
This implementation pattern will likely be reused across other CLI commands as mentioned in the PR objectives.
9-9:Details
❓ Verification inconclusive
Verify that the imported OutputMode and OutputType include all required formats.
The imports from
.optmodule align with the PR objective of supporting various output formats.
🏁 Script executed:
#!/bin/bash # Check what output modes are defined in the .opt module cat packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py | grep -A 20 "class OutputMode" || echo "OutputMode not found"Length of output: 551
Action Required: Confirm All Output Formats Are Exposed via CLI
The lookup in the
.optmodule shows that theOutputModeclass defines four formats—JSON,YAML,NAME, andPATH—but the CLI optionopt_output_allcurrently only allowsJSON,YAML, andNAME. Please verify whether the omission ofPATHfrom the CLI’s valid choices is intentional or if it should also be supported to meet the PR’s objective for comprehensive output formats.
- Check if
PATHis meant for internal use only or should be added to theclick.Choicelist inopt_output_all.- If
PATHshould be exposed, update the CLI option accordingly and ensureOutputTypereflects the change.
| ) | ||
| @click.option("--unsafe", is_flag=True, help="Should all driver client packages be allowed to load (UNSAFE!).") | ||
| @click.option( | ||
| "-o", |
There was a problem hiding this comment.
+1 to aligning with kubectl :)
jmp-admin, jmp-admin, and jmp-exporter CLIsjmp-admin, jmp-client, and jmp-exporter CLIs
This PR adds support for JSON, YAML, and name/path output types for all CLIs. This will allow the use of the Jumpstarter CLIs programmatically from other tools that support parsing JSON/YAML output such as VS Code extensions or other CLI tools/scripts.
-o/--output json,yaml,nameoption to CLI commands that return multiple/complex values. Behaves similarly tokubectl.-o/--output pathoption to CLI commands that just return a path. Mostly for create/delete operations.--nointeractiveoption to admin CLI commands to prevent interactive prompts when using programatically.Summary by CodeRabbit
New Features
Improvements
Tests