Conversation
WalkthroughThis change refactors import statements across numerous modules, scripts, and documentation files throughout the codebase. Imports are updated to reference more granular submodules, removing broad or aggregated imports from higher-level modules. Several Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EnvContext (jumpstarter.utils.env)
participant Client
User->>EnvContext: enter env() context manager
EnvContext->>EnvContext: Read JUMPSTARTER_HOST from environment
EnvContext->>EnvContext: Get permission flags (_allow_from_env)
EnvContext->>Client: Create client from host/path
EnvContext-->>User: yield Client
User->>EnvContext: exit env() context manager
EnvContext->>Client: Close client (if needed)
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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: 2
🧹 Nitpick comments (2)
packages/jumpstarter/jumpstarter/utils/env.py (1)
11-32: Good implementation of async context manager.The
env_asyncimplementation correctly handles:
- Environment variable checking with clear error messaging
- Permission handling via
_allow_from_env()- Proper resource cleanup in the
finallyblock- Well-documented function purpose
Consider adding type hints to the function parameters and return type for better code maintainability.
-async def env_async(portal, stack): +async def env_async(portal: BlockingPortal, stack: ExitStack):packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py (1)
12-13: Modularized configuration imports
Imports now come directly fromjumpstarter.config.commonandjumpstarter.config.exporterinstead of the aggregatedjumpstarter.config, improving clarity and reducing namespace noise.Consider aliasing the imported
ObjectMeta(e.g.,from jumpstarter.config.common import ObjectMeta as ConfigObjectMeta) to distinguish it fromV1ObjectMetaand avoid potential confusion.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (48)
conftest.py(1 hunks)docs/source/api-reference/drivers/dbus.md(1 hunks)docs/source/api-reference/drivers/proxy.md(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/__init__.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create.py(2 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create_test.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete.py(2 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete_test.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res.py(2 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res_test.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/install.py(1 hunks)packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py(1 hunks)packages/jumpstarter-cli-common/jumpstarter_cli_common/__init__.py(0 hunks)packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py(1 hunks)packages/jumpstarter-cli-driver/jumpstarter_cli_driver/__init__.py(1 hunks)packages/jumpstarter-cli-driver/jumpstarter_cli_driver/driver.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/__init__.py(0 hunks)packages/jumpstarter-cli/jumpstarter_cli/config_client.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/config_exporter.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/create.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/delete.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/get.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/j.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/jmp.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/login.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/run.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/shell.py(1 hunks)packages/jumpstarter-cli/jumpstarter_cli/update.py(1 hunks)packages/jumpstarter-driver-network/jumpstarter_driver_network/adapters/novnc.py(1 hunks)packages/jumpstarter-driver-network/jumpstarter_driver_network/adapters/portforward.py(1 hunks)packages/jumpstarter-driver-opendal/README.md(1 hunks)packages/jumpstarter-driver-sdwire/README.md(1 hunks)packages/jumpstarter-driver-uboot/README.md(1 hunks)packages/jumpstarter-driver-ustreamer/README.md(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py(1 hunks)packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py(1 hunks)packages/jumpstarter/jumpstarter/client/base.py(1 hunks)packages/jumpstarter/jumpstarter/client/core.py(1 hunks)packages/jumpstarter/jumpstarter/common/streams.py(1 hunks)packages/jumpstarter/jumpstarter/common/utils.py(1 hunks)packages/jumpstarter/jumpstarter/config/__init__.py(0 hunks)packages/jumpstarter/jumpstarter/config/client_config_test.py(1 hunks)packages/jumpstarter/jumpstarter/config/user_config_test.py(1 hunks)packages/jumpstarter/jumpstarter/driver/base.py(1 hunks)packages/jumpstarter/jumpstarter/exporter/session.py(1 hunks)packages/jumpstarter/jumpstarter/streams/__init__.py(0 hunks)packages/jumpstarter/jumpstarter/utils/env.py(1 hunks)
💤 Files with no reviewable changes (4)
- packages/jumpstarter-cli/jumpstarter_cli/init.py
- packages/jumpstarter/jumpstarter/config/init.py
- packages/jumpstarter/jumpstarter/streams/init.py
- packages/jumpstarter-cli-common/jumpstarter_cli_common/init.py
🧰 Additional context used
🧬 Code Graph Analysis (16)
conftest.py (1)
packages/jumpstarter/jumpstarter/config/exporter.py (2)
ExporterConfigV1Alpha1(72-175)ExporterConfigV1Alpha1DriverInstance(34-69)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/exporters.py (2)
packages/jumpstarter/jumpstarter/config/common.py (1)
ObjectMeta(13-15)packages/jumpstarter/jumpstarter/config/exporter.py (1)
ExporterConfigV1Alpha1(72-175)
packages/jumpstarter-cli/jumpstarter_cli/jmp.py (2)
packages/jumpstarter-cli-common/jumpstarter_cli_common/alias.py (1)
AliasedGroup(4-46)packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py (1)
version(49-56)
packages/jumpstarter-cli-driver/jumpstarter_cli_driver/driver.py (1)
packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)
packages/jumpstarter-cli/jumpstarter_cli/j.py (1)
packages/jumpstarter/jumpstarter/utils/env.py (1)
env(35-44)
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/install.py (1)
packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py (2)
version(49-56)get_client_version(12-14)
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (3)
packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
OutputMode(23-27)packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)packages/jumpstarter-cli-common/jumpstarter_cli_common/time.py (1)
time_since(4-32)
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get.py (1)
packages/jumpstarter-cli-common/jumpstarter_cli_common/alias.py (1)
AliasedGroup(4-46)
packages/jumpstarter-cli-driver/jumpstarter_cli_driver/__init__.py (2)
packages/jumpstarter-cli-common/jumpstarter_cli_common/alias.py (1)
AliasedGroup(4-46)packages/jumpstarter-cli-common/jumpstarter_cli_common/version.py (1)
version(49-56)
packages/jumpstarter-cli/jumpstarter_cli/get.py (4)
packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py (1)
opt_config(90-91)packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1)
handle_exceptions(30-44)packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
OutputMode(23-27)packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)
packages/jumpstarter-cli/jumpstarter_cli/create.py (4)
packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py (1)
opt_config(90-91)packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1)
handle_exceptions(30-44)packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
OutputMode(23-27)packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)
packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py (1)
packages/jumpstarter/jumpstarter/config/client.py (2)
ClientConfigV1Alpha1(37-274)ClientConfigV1Alpha1Drivers(32-34)
packages/jumpstarter-cli/jumpstarter_cli/config_exporter.py (2)
packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
OutputMode(23-27)packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)
packages/jumpstarter-cli/jumpstarter_cli/run.py (2)
packages/jumpstarter-cli/jumpstarter_cli/config.py (1)
config(8-9)packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py (1)
opt_config(90-91)
packages/jumpstarter/jumpstarter/common/utils.py (1)
packages/jumpstarter/jumpstarter/utils/env.py (1)
env(35-44)
packages/jumpstarter-cli/jumpstarter_cli/update.py (4)
packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py (1)
opt_config(90-91)packages/jumpstarter-cli-common/jumpstarter_cli_common/exceptions.py (1)
handle_exceptions(30-44)packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py (1)
OutputMode(23-27)packages/jumpstarter-cli-common/jumpstarter_cli_common/table.py (1)
make_table(1-31)
🪛 GitHub Actions: Run Tests
conftest.py
[error] 22-22: ImportError: cannot import name 'RouterStream' from 'jumpstarter.streams' in conftest.py
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: e2e
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-utils Dockerfile.utils)
- GitHub Check: build-and-push-image (jumpstarter-dev/jumpstarter-dev .devfile/Containerfile)
- 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 (54)
packages/jumpstarter-cli-driver/jumpstarter_cli_driver/driver.py (1)
4-4: Import Path Updated for make_table
The import has been correctly adjusted to pullmake_tablefrom its new submodule (jumpstarter_cli_common.table), in line with the recent modularization.packages/jumpstarter-cli-driver/jumpstarter_cli_driver/__init__.py (1)
5-7: Imports updated to granular submodules
TheAliasedGroup,opt_log_level, andversionimports now come directly from their specific submodules, aligning with the broader refactoring and improving modularity and clarity.packages/jumpstarter-driver-network/jumpstarter_driver_network/adapters/novnc.py (1)
8-8: Stream import path updated correctly
Importingforward_streamfromjumpstarter.streams.commonaligns with the new modular structure and matches its usage in theNovncAdapter.packages/jumpstarter-driver-network/jumpstarter_driver_network/adapters/portforward.py (1)
8-8: Stream import path updated correctly
Switching tojumpstarter.streams.common.forward_streamis consistent with the broader refactor and satisfies the usage in both TCP and Unix port‐forward adapters.packages/jumpstarter/jumpstarter/driver/base.py (1)
36-38: Stream class imports updated correctly
The explicit imports ofAiohttpStreamReaderStream,create_memory_stream, andMetadataStreamfrom their submodules accurately replace the removed aggregatedjumpstarter.streamsimport and cover all usages in the driver’s resource handling.packages/jumpstarter/jumpstarter/client/base.py (1)
15-15: BlockingStream import path updated correctly
ImportingBlockingStreamfromjumpstarter.streams.blockingaligns with the new streams package structure and supports its use in the blockingstreamcontext manager.packages/jumpstarter/jumpstarter/common/streams.py (1)
10-11: RouterStream and forward_stream imports updated correctly
Switching tojumpstarter.streams.router.RouterStreamandjumpstarter.streams.common.forward_streamfollows the modularization of the streams package and matches their use inconnect_router_stream.packages/jumpstarter/jumpstarter/exporter/session.py (1)
21-23: Import refactoring looks good.The changes properly refactor the stream imports to reference specific submodules rather than the higher-level
jumpstarter.streamsmodule. This follows better import practices by making dependencies more explicit and granular, which can help with maintainability and potentially improve import times.packages/jumpstarter/jumpstarter/client/core.py (1)
24-27: Import refactoring is consistent and well-organized.The stream-related imports have been appropriately refactored to use specific submodules rather than importing from the aggregated
jumpstarter.streamspackage. This is consistent with the changes made in other files and aligns with the PR objective to improve import granularity throughout the codebase.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/__init__.py (2)
2-3: Explicit submodule imports enhance clarity and reduce coupling.Importing
AliasedGroupandversiondirectly from their respective submodules aligns with the updated module boundaries and removes reliance on root‑level re‑exports. This improves maintainability and makes dependencies more explicit.
2-3:Details
✅ Verification successful
Verify no residual root‑level imports remain.
To ensure the refactor is complete, please search for any remaining legacy imports from the
jumpstarter_cli_commonroot.
🏁 Script executed:
#!/bin/bash # Search for outdated root‑level imports of AliasedGroup or version rg "from jumpstarter_cli_common import (AliasedGroup|version)\b"Length of output: 66
Could be missing other import patterns—let’s broaden the search:
🏁 Script executed:
#!/bin/bash # Search all import statements that reference jumpstarter_cli_common at the root rg -n "^\s*(from|import)\s+jumpstarter_cli_common(\b|\.)"Length of output: 5550
All root‑level imports of
jumpstarter_cli_commonhave been removed.A global search for any
from jumpstarter_cli_common import …or bareimport jumpstarter_cli_commonreturned only submodule imports (e.g.jumpstarter_cli_common.opt,jumpstarter_cli_common.table, etc.), confirming no residual root‑level imports remain.packages/jumpstarter-cli/jumpstarter_cli/config_exporter.py (1)
9-9: Movemake_tableimport to granulartablesubmodule
Aligns with the codebase refactor by importingmake_tablefromjumpstarter_cli_common.table. Ensure this function remains available under that module.packages/jumpstarter/jumpstarter/utils/env.py (2)
1-9: Import organization looks good.The imports are well-organized with standard libraries first, followed by third-party libraries (anyio), then internal imports, with appropriate spacing. This follows Python best practices for import organization.
34-44: Clean synchronous wrapper around async context manager.The synchronous
env()function correctly wraps the async context manager using anyio'sstart_blocking_portal()andportal.wrap_async_context_manager(). This pattern effectively bridges the synchronous and asynchronous worlds.The docstring clearly explains the purpose and usage of this context manager.
packages/jumpstarter-cli/jumpstarter_cli/j.py (1)
6-6: Import path updated correctly to use the new module location.The import statement has been updated to reference the new location of the
envcontext manager, which matches the refactoring described in the PR summary.packages/jumpstarter/jumpstarter/common/utils.py (1)
12-14:Details
✅ Verification successful
Re-export pattern implemented correctly for backward compatibility.
The code now imports and re-exports the
envfunction from its new location. The use of__all__correctly specifies what should be exported when using star imports.Note that other functions in this module (
serve_async,serve,launch_shell) are not included in__all__. If these functions are part of the public API, consider including them as well.
🏁 Script executed:
#!/bin/bash # Check if the non-listed functions in __all__ are imported elsewhere in the codebase echo "Checking for imports of serve, serve_async, and launch_shell from jumpstarter.common.utils" rg "from jumpstarter.common.utils import (.*)(serve|launch_shell)" --type py echo "Checking for direct imports of these functions" rg "from jumpstarter.common.utils import serve" --type py rg "from jumpstarter.common.utils import serve_async" --type py rg "from jumpstarter.common.utils import launch_shell" --type pyLength of output: 5953
Re-export pattern is correct and safe.
- The patch cleanly moves
envinto its own module and re-exports it here.__all__only affectsfrom … import *; all existing explicit imports ofserve,serve_async, andlaunch_shellwill continue to work unchanged.- We verified that:
serveis explicitly imported in numerous tests and drivers.launch_shellis explicitly imported in the CLI.serve_asyncisn’t imported anywhere else.- No code imports
env_asyncfrom this module.- No star‑imports of
jumpstarter.common.utilswere detected in the codebase.No further changes are required.
packages/jumpstarter-driver-opendal/README.md (1)
32-32: Updated import forExporterConfigV1Alpha1DriverInstance.Switched from the top‑level
jumpstarter.configto the granularjumpstarter.config.exportermodule, matching the refactored configuration structure.packages/jumpstarter-cli/jumpstarter_cli/run.py (1)
5-5: Refactored import path foropt_config.Now imports
opt_configfromjumpstarter_cli_common.configin line with the modularization of the CLI common package.docs/source/api-reference/drivers/dbus.md (1)
21-21: Corrected import tojumpstarter.config.exporter.Aligns the doctest example with the new submodule organization of the config package.
docs/source/api-reference/drivers/proxy.md (1)
27-27: Revised import forExporterConfigV1Alpha1DriverInstance.Changed to the dedicated
jumpstarter.config.exporterpath to reflect the removal of aggregated exports fromjumpstarter.config.packages/jumpstarter-driver-sdwire/README.md (1)
21-21: Aligned import with refactored config submodule.Now imports
ExporterConfigV1Alpha1DriverInstancefromjumpstarter.config.exporter, consistent with other driver documentation updates.packages/jumpstarter-driver-ustreamer/README.md (1)
21-21: Update doctest import path
The example now importsExporterConfigV1Alpha1DriverInstancefromjumpstarter.config.exporter, matching the refactored module layout.packages/jumpstarter-driver-uboot/README.md (1)
21-21: Synchronize driver README import
ImportingExporterConfigV1Alpha1DriverInstancefromjumpstarter.config.exporterreflects the updated module structure and keeps documentation accurate.packages/jumpstarter-cli/jumpstarter_cli/delete.py (2)
2-2: Importopt_configfrom specific submodule
Theopt_configdecorator is now imported fromjumpstarter_cli_common.configrather than the top‑level package, making the dependency explicit and aligning with the common‑package restructuring.
4-4: Import output helpers from dedicated module
OutputMode,OutputType, andopt_output_name_onlyhave been moved tojumpstarter_cli_common.optto reduce top‑level exports and improve modularity in the CLI utilities.packages/jumpstarter/jumpstarter/config/client_config_test.py (1)
11-12: Refine test imports for configuration modules
Tests now importClientConfigV1Alpha1andClientConfigV1Alpha1Driversfromjumpstarter.config.client, andObjectMetafromjumpstarter.config.common, in line with the new modular export strategy.packages/jumpstarter-kubernetes/jumpstarter_kubernetes/clients.py (1)
13-14: LGTM! Import paths updated to more specific modules.The imports have been updated to reference the specific submodules instead of the general
jumpstarter.configmodule. This is in line with the PR's objective to make imports more granular.conftest.py (1)
10-10: LGTM! Consolidated imports from specific submodule.The import statement has been properly updated to import both
ExporterConfigV1Alpha1andExporterConfigV1Alpha1DriverInstancefrom the more granularjumpstarter.config.exportermodule.packages/jumpstarter-cli-common/jumpstarter_cli_common/config.py (1)
6-8: LGTM! Import paths updated to more specific modules.The imports have been properly updated to reference each configuration class from its specific submodule, instead of importing all from the general
jumpstarter.configmodule.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/print.py (1)
2-4: LGTM! Import paths updated to more specific modules.The imports have been properly updated to reference each utility from its specific submodule within
jumpstarter_cli_common. This is consistent with the PR's goal of more granular imports.packages/jumpstarter/jumpstarter/config/user_config_test.py (1)
7-9: Import modularization for user config tests
Imports have been updated to reference dedicated submodules (client,common,user) instead of the aggregatedjumpstarter.configmodule. This aligns with the broader refactoring and improves clarity.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/get.py (1)
5-13: Refined imports fromjumpstarter_cli_common
The CLI command group now explicitly importsAliasedGroupfromjumpstarter_cli_common.aliasand option decorators fromjumpstarter_cli_common.opt, eliminating the monolithic package import. This change is consistent with the project-wide modularization and preserves functionality.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res.py (2)
4-11: Use granular imports for CLI options
Refactoring to importPathOutputTypeand related decorators fromjumpstarter_cli_common.optimproves modularity and avoids exposing the entire parent package.
20-22: Direct imports for config classes
Switched to importingClientConfigV1Alpha1,ExporterConfigV1Alpha1, andUserConfigV1Alpha1from their specific submodules (client,exporter,user). This aligns with the repo-wide effort to remove top-level re-exports and enhances maintainability.packages/jumpstarter-cli/jumpstarter_cli/login.py (2)
2-2: Importopt_configfrom granular submodule
opt_configis now imported fromjumpstarter_cli_common.configinstead of the umbrella package, aligning with the modular import strategy.
5-6: Refined config class imports
Configuration classesClientConfigV1Alpha1,ClientConfigV1Alpha1Drivers, andObjectMetaare now pulled directly fromjumpstarter.config.clientandjumpstarter.config.commonrespectively, matching the new module boundaries without altering behavior.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/import_res_test.py (1)
13-15: Update test imports to match submodule layout
Test now importsClientConfigV1Alpha1,ClientConfigV1Alpha1Drivers,ObjectMeta, andExporterConfigV1Alpha1from their dedicated submodules. This keeps test code in sync with the refactored module structure.packages/jumpstarter-cli/jumpstarter_cli/get.py (2)
2-2: Correct granularity: config import
opt_configis now correctly imported fromjumpstarter_cli_common.config, matching the new modular structure. No functional change.
4-5: Correct granularity: opt and table imports
OutputMode,OutputType,opt_output_all, andmake_tableare accurately imported from their respectivejumpstarter_cli_commonsubmodules, and all usages align with their definitions.packages/jumpstarter-cli/jumpstarter_cli/create.py (2)
4-4: Correct granularity: config import
opt_configis properly imported fromjumpstarter_cli_common.configin line with the refactoring.
6-7: Correct granularity: opt and table imports
OutputMode,OutputType,opt_output_all, andmake_tableimports are updated to reference their dedicated submodules underjumpstarter_cli_common, and they match the definitions.packages/jumpstarter-cli/jumpstarter_cli/update.py (2)
4-4: Correct granularity: config import
opt_configis now imported fromjumpstarter_cli_common.config, consistent with the new package boundaries.
6-7: Correct granularity: opt and table imports
OutputMode,OutputType,opt_output_all, andmake_tableare correctly sourced fromjumpstarter_cli_common.optandjumpstarter_cli_common.table, with no break in functionality.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete_test.py (1)
14-17: Correct granularity: config class imports
ClientConfigV1Alpha1,ClientConfigV1Alpha1Drivers,ObjectMeta,ExporterConfigV1Alpha1,UserConfigV1Alpha1, andUserConfigV1Alpha1Configare correctly imported from their new dedicated submodules underjumpstarter.config. All types are used downstream in test setup.packages/jumpstarter-cli/jumpstarter_cli/shell.py (2)
5-5: Correct granularity: config import
opt_configis properly imported fromjumpstarter_cli_common.config, reflecting the refactored common utilities module.
10-11: Correct granularity: client/exporter config imports
ClientConfigV1Alpha1andExporterConfigV1Alpha1are correctly imported fromjumpstarter.config.clientandjumpstarter.config.exporterrespectively, aligning with the new modular structure.packages/jumpstarter-cli/jumpstarter_cli/config_client.py (1)
4-16: LGTM: Well-organized import refactoring.The imports have been nicely reorganized to reference specific submodules rather than broader modules, which improves modularity and makes dependencies more explicit.
Instead of importing from the top-level modules, imports now come from more granular sources:
- Exceptions from
jumpstarter_cli_common.exceptions- Options from
jumpstarter_cli_common.opt- Table utilities from
jumpstarter_cli_common.table- Configuration classes from specific submodules (
client,common,user)This aligns with the PR's goal of improving modularity and performance.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create_test.py (1)
17-19: LGTM: Improved import organization.Configuration classes are now imported from their specific submodules instead of the broader
jumpstarter.configmodule:
ClientConfigV1Alpha1andClientConfigV1Alpha1Driversfromjumpstarter.config.clientObjectMetafromjumpstarter.config.commonExporterConfigV1Alpha1fromjumpstarter.config.exporterThis change aligns with the broader import refactoring effort across the codebase, improving modularity without changing any functionality.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/create.py (2)
5-16: LGTM: Refactored imports from general to specific modules.The import statements have been updated to pull from more specific submodules rather than the broader package:
AliasedGroupnow comes directly fromjumpstarter_cli_common.alias- Options like
OutputMode, etc. now come fromjumpstarter_cli_common.optThis creates cleaner dependencies and improves modularity.
25-27: LGTM: Configuration imports from specialized modules.Configuration classes are now imported from their specific submodules:
ClientConfigV1Alpha1fromjumpstarter.config.clientExporterConfigV1Alpha1fromjumpstarter.config.exporterUserConfigV1Alpha1fromjumpstarter.config.userThis makes dependencies more explicit and supports the codebase modularization.
packages/jumpstarter-cli-admin/jumpstarter_cli_admin/delete.py (2)
5-14: LGTM: Improved granularity in CLI common imports.The import statements have been refactored to use specific submodules:
AliasedGroupnow comes fromjumpstarter_cli_common.alias- Various options now come from
jumpstarter_cli_common.optThis follows the pattern established across the codebase and improves modularity.
23-25: LGTM: Modularized configuration imports.Configuration classes are now imported from their dedicated submodules:
ClientConfigV1Alpha1fromjumpstarter.config.clientExporterConfigV1Alpha1fromjumpstarter.config.exporterUserConfigV1Alpha1fromjumpstarter.config.userThis change is consistent with the rest of the import refactoring effort.
packages/jumpstarter-cli/jumpstarter_cli/jmp.py (1)
5-7:Details
✅ Verification successful
Granularize imports from jumpstarter_cli_common
Refactoring these imports to point at their specific submodules (alias,opt,version) correctly follows the recent removal of re-exports injumpstarter_cli_common.__init__.pyand improves clarity.
Please verify that no residual top-level imports fromjumpstarter_cli_commonremain elsewhere in the codebase.
🏁 Script executed:
#!/bin/bash # Search for any stale top-level imports from jumpstarter_cli_common rg "from jumpstarter_cli_common import " .Length of output: 44
🏁 Script executed:
#!/bin/bash # Combined search for any stale top-level imports of jumpstarter_cli_common rg -n -E "(^import\s+jumpstarter_cli_common(\s|\.))|(^from\s+jumpstarter_cli_common\s+import\s+)" .Length of output: 225
🏁 Script executed:
#!/bin/bash # Re-check for any stale top-level imports of jumpstarter_cli_common using literal search rg -n -F "import jumpstarter_cli_common" . || true rg -n -F "from jumpstarter_cli_common import " . || trueLength of output: 109
No stale top-level imports found – ready to merge
I searched the entire repo for bothimport jumpstarter_cli_commonandfrom jumpstarter_cli_common importand found no occurrences. The granularized imports injmp.pycorrectly reference the new submodules.packages/jumpstarter-cli-admin/jumpstarter_cli_admin/install.py (1)
4-5:Details
✅ Verification successful
Update import paths for common utilities
The decoratorsopt_contextandopt_kubeconfigare now imported fromjumpstarter_cli_common.opt, andget_client_versionis imported fromjumpstarter_cli_common.version. This matches the recent refactoring ofjumpstarter_cli_common/__init__.py. Please verify that:
packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.pydefines bothopt_contextandopt_kubeconfig.packages/jumpstarter-cli-common/jumpstarter_cli_common/version.pydefinesget_client_version.- There are no lingering references to the old aggregate imports elsewhere in the CLI admin commands.
You can run this script to confirm:
🏁 Script executed:
#!/bin/bash # Verify opt_context & opt_kubeconfig definitions rg -n "def opt_context" -n packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py rg -n "def opt_kubeconfig" -n packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py # Verify get_client_version definition rg -n "def get_client_version" -n packages/jumpstarter-cli-common/jumpstarter_cli_common/version.pyLength of output: 315
🏁 Script executed:
#!/bin/bash # List files in the common utilities directory ls -1 packages/jumpstarter-cli-common/jumpstarter_cli_common # Search for opt_context occurrences (definitions and assignments) rg -n "opt_context" -n packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py # Search for opt_kubeconfig occurrences (definitions and assignments) rg -n "opt_kubeconfig" -n packages/jumpstarter-cli-common/jumpstarter_cli_common/opt.pyLength of output: 492
🏁 Script executed:
#!/bin/bash # Check for any legacy aggregate imports in CLI admin commands rg -n "from jumpstarter_cli_common import" -n packages/jumpstarter-cli-admin # Check for any direct references to jumpstarter_cli_common without submodule rg -n "jumpstarter_cli_common\." -n packages/jumpstarter-cli-adminLength of output: 1783
Import paths are correct and up‑to‑date
opt_context(line 16) andopt_kubeconfig(line 12) are defined inpackages/jumpstarter-cli-common/jumpstarter_cli_common/opt.py.get_client_version(line 12) is defined inpackages/jumpstarter-cli-common/jumpstarter_cli_common/version.py.- No legacy
from jumpstarter_cli_common import …imports remain inpackages/jumpstarter-cli-admin.All imports align with the refactored common package—LGTM.
Summary by CodeRabbit