Repository navigation
core: test exec reuse across commits of a remote workspace - #14939
Merged
Merged
Conversation
A module function run with `-W <repo>@<sha>` reads its workspace from a Git tree, whose identity is its commit. Exec work on a filtered Workspace.directory read must be reused across commits that leave the selected files unchanged, as it is for a local checkout. Content-keyed filtered workspace reads (#14829) made that so. Its tests load a Git ref as a workspace through the API; this adds the CLI flow: a module in the repository, a fresh session per commit, a read with include and gitignore mounted next to a cache volume, and an exec whose output is random. A README-only commit must reuse the exec; a commit inside the selection must re-run it. The test fails with #14829's content keying removed, on the README-only commit. Signed-off-by: Erik Sipsma <[email protected]>
A CLI started in a container joins the test's session unless the exec asks for a new one. Run each call in its own session, as each CI run is, so only the cache connects one call to the next. Signed-off-by: Erik Sipsma <[email protected]>
grouville
self-requested a review
October 29, 2026 06:29
grouville
approved these changes
Oct 29, 2026
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.
What this adds
A regression test for #14903: with
-W <repo>@<sha>, an exec that mounts a filteredWorkspace.directoryread re-ran on every commit, even when the files it read were unchanged.#14829 fixed this by keying filtered reads by the content of the files they select, not by their recipe over the Git root, whose identity is its commit. Its tests load a Git ref as a workspace through the API. This test covers the flow from the issue:
dagger -W <repo>@<sha> call;ws.directory("/", include: ["app/**"], gitignore: true)mounted next to a cache volume, under an exec whose output is random.A second session at the same commit and a README-only commit must both reuse the exec. A commit that changes the selected files must re-run it.
Tests
New subtest:
TestContextualWorkspace/TestContextualWorkspaceCaching/unrelated_commits_of_a_remote_workspace_do_not_invalidate_scoped_workspace_inputs. It runs in thetestBasecheck.Closes #14903.