Skip to content

Integration test proves identical keys across checkout paths and machines - #151

Merged
calvin-archastro merged 1 commit into
mainfrom
factory/tsk_0Rm4DB0GhJIjTX333Fsjn9-f6c1cc7c-1d3f-402d-adaa-
Oct 16, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
factory/tsk_0Rm4DB0GhJIjTX333Fsjn9-f6c1cc7c-1d3f-402d-adaa-

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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, the CI flag, 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 HOME values, CI set 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:

  • Builds a fixture with a .git marker, .gitignore for node_modules/ and target/, a Node app (apps/web), a Cargo workspace (crates/a, crates/b), and a Go module (services/api). Each cacheable target’s aster.toml sets cache = { runtime = ["echo fixed"] } so plugin toolchain commands are replaced and the test does not need rustc, node, or go, and does not execute targets.
  • Places the two copies at different absolute paths. Only the second copy gets node_modules/ and target/ junk. Processes run with env_clear, distinct HOME values, shared PATH, and CI=true on only one side.
  • Discovers addresses with aster list --json, then compares aster cache status <address> --inputs --json.
  • Fails if keys differ, printing a component diff over salt, platform, files, command, deps, env, path_env, and runtime. It also fails if a checkout path or HOME appears in the inputs JSON, if no cacheable targets are found, or if //apps/web:build, //crates/a:test, or //services/api:build is missing from the compared set.

Addresses whose cache status fails 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 aster binary and depends on list / cache status --inputs JSON shape. Environment is cleared and HOME, PATH, and CI are 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, function identical_keys_across_checkout_paths_and_machines. Intended invocation is cargo test --locked --test cache_portability -- --exact identical_keys_across_checkout_paths_and_machines.

Upstream format, lint, and test checks are reported succeeded (exit 0). Those excerpts are truncated and do not name cache_portability or identical_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 that cargo test --test cache_portability passed locally are advisory only.

Follow-ups and known issues

  • The planned macOS CI integration-test list update is not in this revision.
  • The test compares input keys only. It does not run targets, write artifacts, or restore from a shared or GitHub Actions cache.
  • A cache status failure 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.
  • Supplied CI logs are truncated, so coverage of this test in the succeeded test job is unverified here.

@calvin-archastro
calvin-archastro requested a review from a team October 15, 2026 19:47
@calvin-archastro
calvin-archastro merged commit 1f8e6ad into main Oct 16, 2026
12 checks passed
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.

1 participant