From d1fe05cba1747f24fa16a51348fd0387f54897e6 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 02:33:44 +0000 Subject: populate flake-input: remove uploads left behind Uploads an interrupted run left behind in .populate/flake-uploads only got removed before the same source uploaded again. Delivering a flake or flake input removes its upload directory now, and the empty .populate/flake-inputs once the last roots are gone. An edge case leaves an upload behind between two deploys. --- tests/scenarios.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/scenarios.nix b/tests/scenarios.nix index 6dbb84d..eb6bbec 100644 --- a/tests/scenarios.nix +++ b/tests/scenarios.nix @@ -956,6 +956,23 @@ assert !(krops.isLocalTarget (targets.remote "/")); ''; }; }) + # An upload an interrupted run left behind. + (s "upload-leftover" { + phases = [ + { + sources.x.flake = { flake = "/fixtures/top"; fetchOnTarget = true; }; + check = checkFlake { attr = "msg"; expected = "top:dep+inner,sub"; }; + mutate = '' + mkdir -p "$T"/.populate/flake-uploads/x/tree + echo half > "$T"/.populate/flake-uploads/x/tree/half + ''; + } + { + sources.x.flake = { flake = "/fixtures/top"; fetchOnTarget = true; }; + check = checkFlake { attr = "msg"; expected = "top:dep+inner,sub"; }; + } + ]; + }) ] ++ lib.optional (targetKind == "local") # The target has the path the input is locked to. (s "uselocal" { -- cgit v1.3.1