mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 04:06:42 +00:00
feat(cache): serve every checkout's own cache declarations
A checkout that declared a new cache host rendered the artefacts and reached nothing: the Nexus proxy repository, the frontend's leaf certificate and the nginx upstream map all live in the running stack, which only the owning checkout set up. cache-apply installs all three and reloads the frontend, and compose up runs it for a checkout that merely joins the network, so the manual call is left for a declaration changed between two bring-ups. The map source is no longer selectable. INFINITO_CACHE_CONF_SOURCE existed to let a worktree read the primary checkout's map instead of its own, but the frontend mounts one map and the install replaces it, so the checkout that applied last wins either way: the knob chose which file to point at, never who prevailed. Dropping it also retires the git subprocess that resolved the owning checkout on every env build. Two checkouts sharing a stack therefore overwrite each other's map, which the documentation now states instead of implying a selector could prevent it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d937f23863
commit
0d2fadce0c
11 files changed
+158
-122
No files matched your search
@@ -295,6 +295,41 @@ class TestComposeUpRetries(unittest.TestCase):
|
||||
compose._generate_package_frontend_certs.assert_called_once()
|
||||
compose._install_package_frontend_ca_in_runner.assert_called_once()
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"INFINITO_BUILD": "1",
|
||||
"INFINITO_IMAGE": "infinito-debian",
|
||||
"INFINITO_PULL_POLICY": "never",
|
||||
"CI": "",
|
||||
"GITHUB_ACTIONS": "",
|
||||
"INFINITO_RUNNING_ON_GITHUB": "",
|
||||
"INFINITO_GIT_COMMON_DIR": "/primary/.git",
|
||||
"INFINITO_CACHE_NETWORK": "infinito-nexus-core_default",
|
||||
"INFINITO_CACHE_STACK": "",
|
||||
},
|
||||
clear=False,
|
||||
)
|
||||
def test_up_applies_the_declarations_to_a_cache_stack_it_shares(self) -> None:
|
||||
compose = self._compose()
|
||||
compose._render_coredns_corefile = MagicMock()
|
||||
compose._compose_up_with_retries = MagicMock()
|
||||
compose.wait_for_healthy = MagicMock()
|
||||
compose._bootstrap_package_cache = MagicMock()
|
||||
compose._generate_package_frontend_certs = MagicMock()
|
||||
compose._apply_shared_cache = MagicMock()
|
||||
compose._install_package_frontend_ca_in_runner = MagicMock()
|
||||
|
||||
compose.up(run_entry_init=False)
|
||||
|
||||
compose._compose_up_with_retries.assert_called_once_with(
|
||||
["up", "-d", "coredns", "infinito"], attempts=6, delay_s=30
|
||||
)
|
||||
compose._generate_package_frontend_certs.assert_not_called()
|
||||
compose._bootstrap_package_cache.assert_not_called()
|
||||
compose._apply_shared_cache.assert_called_once()
|
||||
compose._install_package_frontend_ca_in_runner.assert_called_once()
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user