| 1 | { |
| 2 | pkgs, |
| 3 | packages, |
| 4 | hosts, |
| 5 | ... |
| 6 | }: |
| 7 | { |
| 8 | # The restacker planner's own tests (restack/), run in its checkPhase: |
| 9 | # how a request relates to a family, which outcomes are current and |
| 10 | # which release a family, the arithmetic of each capacity limit, and |
| 11 | # how the policy's cap is counted, one larger than any int included. |
| 12 | restack-unit = packages.restack-unwrapped; |
| 13 | |
| 14 | # valley-restacker once --report-only over a bare repository wired with |
| 15 | # the protected host's rendered hook, every change readied by its owner |
| 16 | # through the repository's own valley. Ready changes of two owners are |
| 17 | # planned; a linear stack is one family, and so are two stacks on a |
| 18 | # shared lower layer. A draft, a withdrawn change, a lone plain branch, a |
| 19 | # change landed by fast-forward and an uncertain landing are left alone, |
| 20 | # and a family with a plain branch or a draft in it is held. A change |
| 21 | # with two versions uploaded by the principal is held by the project's |
| 22 | # cap of 2. A request by name with no outcome holds; a current stale and |
| 23 | # a current reject release, the reject noted; an outcome about another |
| 24 | # head, tip or evidence, and one that does not read, hold. Requests by |
| 25 | # exact head and by range hold, the range's head fetched by the planner, |
| 26 | # and a request whose head is no commit holds every family. A cap larger |
| 27 | # than any int composes and is no practical cap, so the change the cap |
| 28 | # of 2 held is planned to restack. Every ref on origin is compared |
| 29 | # before and after each pass. Outcomes are injected on the server side, |
| 30 | # since no push may write one. |
| 31 | restack-e2e = pkgs.runCommand "valley-restack-e2e" { |
| 32 | nativeBuildInputs = [ |
| 33 | pkgs.git |
| 34 | pkgs.jq |
| 35 | packages.valley-script |
| 36 | packages.valley-restacker |
| 37 | ]; |
| 38 | initScript = hosts.protectedHost.config.systemd.services.valley-init.script; |
| 39 | passAsFile = [ "initScript" ]; |
| 40 | smokePolicy = ../../examples/policy/smoke; |
| 41 | } (builtins.readFile ./restack-e2e.sh); |
| 42 | } |