Skip to content

Conversation

@Ishirui
Copy link
Contributor

@Ishirui Ishirui commented Dec 23, 2025

Create two commands, dda env dev fs import and dda env dev fs export that allow for easily moving files and directories in and out of dev envs.

This is useful as an addition to standard bind mounts, because people might not think of bind-mounting something into the container upon creation. Such a feature was heavily requested by our users.

The feature was implemented by making the necessary changes to the dev env interface to make sure that such a feature will also be supported by other dev env types (remote VMs...). As much logic as possible was made agnostic to the type of dev env in question (everything in src/dda/env/dev/fs.py)

image image

@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch 2 times, most recently from bffa189 to b055041 Compare December 29, 2025 11:21
@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch from b055041 to dbe0c30 Compare December 29, 2025 11:21
@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch from dbe0c30 to 95901d4 Compare January 2, 2026 14:26
@Ishirui Ishirui changed the title Pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands [ACIX-1225] Create dda env dev fs import and export commands Jan 2, 2026
@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch from eb939cb to 721dada Compare January 2, 2026 17:42
@Ishirui Ishirui marked this pull request as ready for review January 2, 2026 17:42
@Ishirui Ishirui requested a review from a team as a code owner January 2, 2026 17:42
Copilot AI review requested due to automatic review settings January 2, 2026 17:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements dda env dev fs import and dda env dev fs export commands that enable easy file transfer between the host filesystem and development environments. The feature is designed to be extensible to different environment types (not just Linux containers) by implementing the functionality through the dev env interface.

Key Changes:

  • Added abstract export_files and import_files methods to the dev environment interface
  • Implemented core file operation logic in src/dda/env/dev/fs.py that's agnostic to environment type
  • Created CLI commands for export, import, and an internal localimport command for use inside containers

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/dda/env/dev/interface.py Added abstract methods export_files and import_files to the dev environment interface
src/dda/env/dev/fs.py New module containing environment-agnostic file operation logic (import_from_dir, determine_final_copy_target, handle_overwrite)
src/dda/env/dev/types/linux_container.py Implemented export_files and import_files methods for Linux containers using docker cp and shared directories; added per-instance shared directory mount
src/dda/utils/fs.py Enhanced temp_directory function to accept optional dir parameter for controlling where temporary directories are created
src/dda/cli/env/dev/fs/__init__.py New CLI group for filesystem operations
src/dda/cli/env/dev/fs/export/__init__.py CLI command for exporting files from dev environments to host
src/dda/cli/env/dev/fs/import/__init__.py CLI command for importing files from host to dev environments
src/dda/cli/env/dev/fs/localimport/__init__.py Internal CLI command (hidden) used inside dev environments to perform the actual file import
tests/env/dev/test_fs.py Comprehensive unit tests for the file operation logic in fs.py
tests/env/dev/test_interface.py Updated interface test stub to include new methods
tests/env/dev/types/test_linux_container.py Updated tests for shared directory path changes and added tests for export/import orchestration
tests/env/dev/fixtures/fs_tests/* Test fixture files for verifying file operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

…inuxContainer.export_files`

    Revert "fix(fs): Make sure we `docker cp` into the temporary directory"

    This reverts commit 82d700a.

    # This is the commit message #2:

    Revert "feat(env): Implement `LinuxContainer.import_files`"

    This reverts commit d12ba33.

    # This is the commit message #3:

    Revert "feat(env): Implement hidden `localimport` command to easily call `import_from_dir` in dev envs"

    This reverts commit 08d4b2e.

    # This is the commit message #4:

    Revert "refactor(env): Move host filesystem import logic to `fs.py`"

    This reverts commit 95901d4.

    # This is the commit message #5:

    Revert "feat(env): Implement `LinuxContainer.export_files`"

    This reverts commit 3cd4d22.
- Only accept a single source argument
- `--force` will be pretty much always implied (depending on the semantics of `cp/mv`)
- `--recursive` is always implied
- We'll reimplement `mkpath` if a customer asks for it
@Ishirui Ishirui requested a review from ofek January 12, 2026 13:47
@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch 2 times, most recently from aed5786 to 50a9153 Compare January 12, 2026 14:39
@Ishirui Ishirui force-pushed the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch from 50a9153 to b392a7c Compare January 12, 2026 15:31
Copy link
Contributor

@ofek ofek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@Ishirui Ishirui merged commit 68af61f into main Jan 13, 2026
20 checks passed
@Ishirui Ishirui deleted the pierrelouis.veyrenc/ACIX-1225-env-dev-fs-commands branch January 13, 2026 13:16
github-actions bot pushed a commit that referenced this pull request Jan 13, 2026
* feat(env): Create `fs` command group with `export` and `import` command stubs

* feat(fs): Implement skeleton for `export` and `import` commands

* fix(fs): Pass non-host paths as `str`

* feat(env): Implement `LinuxContainer.export_files`

* refactor(env): Move host filesystem import logic to `fs.py`

* feat(env): Implement hidden `localimport` command to easily call `import_from_dir` in dev envs

* feat(fs): Allow passing `dir` to `temp_directory`

* feat(env): Implement `LinuxContainer.import_files`

* fix(linux_container): Actually mount the shared directory into the container

* fix(env): Small fixes for `import` command

* fix(fs): Make sure we `docker cp` into the temporary directory

* refactor: Copilot-suggested review changes

* Revert initial implementation of `LinuxContainer.export_files` and `LinuxContainer.export_files`

    Revert "fix(fs): Make sure we `docker cp` into the temporary directory"

    This reverts commit 82d700a.

    # This is the commit message #2:

    Revert "feat(env): Implement `LinuxContainer.import_files`"

    This reverts commit d12ba33.

    # This is the commit message #3:

    Revert "feat(env): Implement hidden `localimport` command to easily call `import_from_dir` in dev envs"

    This reverts commit 08d4b2e.

    # This is the commit message #4:

    Revert "refactor(env): Move host filesystem import logic to `fs.py`"

    This reverts commit 95901d4.

    # This is the commit message #5:

    Revert "feat(env): Implement `LinuxContainer.export_files`"

    This reverts commit 3cd4d22.

* refactor(fs): Simplify interface for `import` and `export` commands

- Only accept a single source argument
- `--force` will be pretty much always implied (depending on the semantics of `cp/mv`)
- `--recursive` is always implied
- We'll reimplement `mkpath` if a customer asks for it

* feat(fs): Implement `LinuxContainer.export_path`

* feat(fs): Create `dda.utils.fs::cp_r` function for matching `cp -r` behavior with `shutil` methods

* feat(fs): Implement `LinuxContainer.import_path`

* fix: Update copyright years

* fix(docs): Misnamed parameter

* fix(tests): Fix for windows paths 68af61f
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.

4 participants