Repository navigation
Integration test proves identical keys across checkout paths and machines - #151
Merged
calvin-archastro merged 1 commit intoOct 16, 2026
Conversation
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.
Epic: Aster restores real build artifacts from a shared cache, including the GitHub Actions cache
Task: Integration test proves identical keys across checkout paths and machines
Local git hooks skipped: pre-push on the submission push and the publish push. CI is the gate for what those hooks check.
Problem and author intent
Cache keys are supposed to be content-addressed and shareable across machines. A hasher regression could still fold the checkout’s absolute path,
HOME, theCIflag, or gitignored directories into a key, so the same sources would miss on another path or machine. Unit tests of individual hash inputs do not prove that the CLI’s discovered targets stay stable under those differences.This change adds an integration test that builds one fixture in two temp directories and requires every cacheable target to hash to the same key. Absolute paths,
HOME,CI, and gitignored trees must not leak into the key.What changed
Added
tests/cache_portability.rs(identical_keys_across_checkout_paths_and_machines).Before, nothing in the integration suite compared cache inputs for the same workspace living at two absolute paths, with different
HOMEvalues,CIset in only one process, and extra gitignored files in only one copy. A path, environment, or ignore-walk leak could ship without this end-to-end failure.After, the test:
.gitmarker,.gitignorefornode_modules/andtarget/, a Node app (apps/web), a Cargo workspace (crates/a,crates/b), and a Go module (services/api). Each cacheable target’saster.tomlsetscache = { runtime = ["echo fixed"] }so plugin toolchain commands are replaced and the test does not need rustc, node, or go, and does not execute targets.node_modules/andtarget/junk. Processes run withenv_clear, distinctHOMEvalues, sharedPATH, andCI=trueon only one side.aster list --json, then comparesaster cache status <address> --inputs --json.salt,platform,files,command,deps,env,path_env, andruntime. It also fails if a checkout path orHOMEappears in the inputs JSON, if no cacheable targets are found, or if//apps/web:build,//crates/a:test, or//services/api:buildis missing from the compared set.Addresses whose
cache statusfails on the first copy are recorded as skipped rather than compared. The test still requires a non-empty key map and the three addresses above.Scope
Test-only. The frozen revision is one new file:
tests/cache_portability.rs(+292 / −0, one hunk). No hasher, executor, or cache implementation files are in this diff.An advisory plan mentioned updating a macOS CI integration-test list. That file is not in the projected paths, so this revision does not show that list change.
Risk assessment
Low. No runtime behavior change. The test shells out to the
asterbinary and depends onlist/cache status --inputsJSON shape. Environment is cleared andHOME,PATH, andCIare set explicitly, which limits ambient leakage, but a future CLI or discovery change can fail this test even when the hasher itself is unchanged. Skipping a failed status on the first copy can hide a one-sided failure unless that address is one of the three required keys.User impact
None for users of the cache. CI gains a regression guard that the same fixture yields the same cache key across checkout path,
HOME,CI, and gitignored content. Artifact restore and remote cache behavior are not exercised.Testing
Canonical test:
tests/cache_portability.rs, functionidentical_keys_across_checkout_paths_and_machines. Intended invocation iscargo test --locked --test cache_portability -- --exact identical_keys_across_checkout_paths_and_machines.Upstream
format,lint, andtestchecks are reported succeeded (exit 0). Those excerpts are truncated and do not namecache_portabilityoridentical_keys_across_checkout_paths_and_machines, so this description cannot confirm from supplied CI evidence that this exact test ran. The patch is not proof the test passed. Author notes thatcargo test --test cache_portabilitypassed locally are advisory only.Follow-ups and known issues
cache statusfailure on the first copy is skipped unless the address is one of the required cacheable targets. A failure on the second copy after the first succeeded panics.testjob is unverified here.