Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

PR #4235 introduced a circular import that broke CI checks. The import chain: lisa/__init__.pylisa.environmentlisa.nodelisa.niclisa.toolslisa.tools.remote_copy → back to lisa.

Changes

  • Import LisaException from lisa.util instead of lisa in tools/remote_copy.py
# Before
from lisa import LisaException
from lisa.util import constants

# After  
from lisa.util import LisaException, constants

This breaks the circular dependency while maintaining identical functionality.

Original prompt

can you fix the ci checker issue in #4235

File "", line 91, in find_spec
File "/home/runner/work/lisa/lisa/lisa/init.py", line 6, in
from lisa.environment import Environment
File "/home/runner/work/lisa/lisa/lisa/environment.py", line 19, in
from lisa.node import Node, Nodes
File "/home/runner/work/lisa/lisa/lisa/node.py", line 24, in
from lisa.nic import Nics, NicsBSD
File "/home/runner/work/lisa/lisa/lisa/nic.py", line 16, in
from lisa.tools import Cat, Ip, KernelConfig, Ls, Lspci, Modprobe, Readlink, Tee
File "/home/runner/work/lisa/lisa/lisa/tools/init.py", line 120, in
from .remote_copy import RemoteCopy
File "/home/runner/work/lisa/lisa/lisa/tools/remote_copy.py", line 6, in
from lisa import LisaException
ImportError: cannot import name 'LisaException' from partially initialized module 'lisa' (most likely due to a circular import) (/home/runner/work/lisa/lisa/lisa/init.py)
nox > Command coverage run -m lisa failed with exit code 1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

psachdeva-ms and others added 5 commits January 29, 2026 12:55
Add a validate method to check if the given files exist on the the local node.
Along with that enable the user to specify `files: ["*"]` in a runbook to upload
all the files from the source directory.

Signed-off-by: Piyush Sachdeva <psachdeva@microsoft.com>
Signed-off-by: Piyush Sachdeva <s.piyush1024@gmail.com>
Instead of checking the existence of the target directory on the destination
directly from _internal_run method, do it in a new method: _check_dest_dir,
and call this from _internal_run.

Signed-off-by: Piyush Sachdeva <psachdeva@microsoft.com>
Signed-off-by: Piyush Sachdeva <s.piyush1024@gmail.com.com>
`copy_between_remotes` method does scp of a file[s] (recursively) from source
node to destination node. The scp command is executed on the source node. If the
destination node is an azure vm, make sure to add the IP address of the source
node in the list of `source_address_prefixes` of the destination node for the
command to succeed.

Signed-off-by: Piyush Sachdeva <psachdeva@microsoft.com>
Signed-off-by: Piyush Sachdeva <s.piyush1024@gmail.com>
The new file_transfer transformer uses `copy_between_remotes` method to scp
file[s] from source to destination node. Its validate method verifies the
existence of files on the source node and also has the functionality to transfer
all files from source directory on source node using `files: ["*"]`.
In case the `copy_between_remotes` fails, there is also a provision to first
save files from source node to local, and then upload from the local node to
destination. For this to work, the user should set the `local_path` variable.

Signed-off-by: Piyush Sachdeva <psachdeva@microsoft.com>
Signed-off-by: Piyush Sachdeva <s.piyush1024@gmail.com>
Co-authored-by: LiliDeng <10083705+LiliDeng@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI checker issue related to circular import Fix circular import in tools/remote_copy.py Jan 29, 2026
Copilot AI requested a review from LiliDeng January 29, 2026 13:03
@LiliDeng LiliDeng closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants