fix: add NoCache option to host directory uploads#96
Closed
grouville wants to merge 9 commits into
Closed
Conversation
…al behaviors users rely on: * Persistence of work across sessions (files and changes remain intact through restarts). * Automatic change tracking and audit trails for effective debugging. * Graceful handling of problematic files, including Python cache, binary files, and large files. * Isolation of multiple environments to support safe parallel operations. * Reliable persistence of environment configuration (base images, setup commands). Detailed testing includes: * Git operations, specifically handling command errors, worktree paths, and empty directories. * Selective file staging to manage Python cache and binary files appropriately. * Verification of configuration persistence and environment isolation. Adopted a behavior-driven testing approach focusing on user-experienced behaviors rather than internal implementation details. Modified git.go to support test isolation via the `CONTAINER_USE_CONFIG_DIR` environment variable. Introduced test helpers to streamline the creation of isolated test environments. Documented known limitations clearly with skipped tests for currently unresolved issues related to Python cache, binary directories, and environment variables. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
make it work Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Updated the test to use commands that developers actually run: - Creating build directories (common in CI/CD) - Writing to build output logs (typical build process) - Creating coverage directories (test runners like pytest) These are more representative of real-world scenarios where commands produce no git-trackable changes but should still be audited. Related to issue dagger#82
The test now: - Simulates Python cache directories without needing Python installed - Verifies that development continues normally with __pycache__ present - Serves as a regression test for Python workflows - Renamed from PythonCache to PythonDevelopmentWorkflow for clarity The original bug appears to have been fixed - __pycache__ directories are properly ignored by git and don't interfere with operations.
Concurrency was properly implemented -- added a test showing that in a sequencial environment, every git operation is sequential and working Removed the impossible concurrency test Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Previously, when uploading local directories to container environments, Dagger would cache the directory contents. This caused subsequent uploads to use stale cached versions instead of the latest local changes. This fix adds NoCache: true to all dag.Host().Directory() calls to ensure fresh reads of local files on each upload. Also enables and updates the TestUploadAfterModification integration test to verify this behavior works correctly. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
Contributor
|
the upload tools fell out in the repository refactor, so this will need to be reexamined. that said: i'm not entirely sure this is the right way to fix the test... NoCache definitely gives correct behavior for Upload, but i'm fairly certain that url transformer was also used for environment_source? (keyword was) if that's true, the most recent container should have all the accumulated changes from the run_command and file_write tools, right? so busting the cache and re-uploading the base directory with those changes creates a weird situation where we then go and re-apply those writes on top of a different base. |
Contributor
|
Is this still needed? |
Member
Author
|
Not needed anymore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased on top of #65
> Maybee it is being fixed by the new environment
Summary
NoCache: trueto alldag.Host().Directory()calls inurlToDirectory()Test plan
TestUploadAfterModificationintegration test