From e7b137385a8432df81f39f782f68bea26ec2964d Mon Sep 17 00:00:00 2001 From: piquel Date: Fri, 20 Nov 2026 11:29:15 +0100 Subject: [PATCH] fix(infra): just preview waits on the branch it deployed `just preview` read the branch to wait on after the deploy, which takes minutes, so switching branch meanwhile made the wait look for the wrong preview. It now reads the branch once, before deploying; `preview-delete` does the same. Closes #647 --- just/infra.just | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/just/infra.just b/just/infra.just index 9f1c9a4a6..a39823623 100644 --- a/just/infra.just +++ b/just/infra.just @@ -1,14 +1,22 @@ set working-directory := '..' -# `--slot NAME` keeps several previews of one branch. +# `--slot NAME` keeps several previews of one branch. The branch is read before +# deploying, so switching branch during the deploy doesn't change the preview +# it waits for. # Deploy this worktree, uncommitted changes included, to its preview; print its URLs. preview *args: + #!/usr/bin/env bash + set -euo pipefail + branch=$(git branch --show-current) piquelctl --timeout 30m preview deploy sourceorigin --local {{ args }} - piquelctl --timeout 10m preview wait sourceorigin "$(git branch --show-current)" {{ args }} --ready routes + piquelctl --timeout 10m preview wait sourceorigin "$branch" {{ args }} --ready routes # Delete this worktree's preview with its database. preview-delete *args: - piquelctl --timeout 5m preview delete sourceorigin "$(git branch --show-current)" {{ args }} --yes + #!/usr/bin/env bash + set -euo pipefail + branch=$(git branch --show-current) + piquelctl --timeout 5m preview delete sourceorigin "$branch" {{ args }} --yes # Each telemetry config is checked by the image infra/telemetry.toml runs it # with, so by the version that will read it. Needs piquelctl and Docker.