From 2209abe4f9a87622601d59e1a2257a8194e21f7d Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Fri, 28 Aug 2026 15:50:15 +0000 Subject: [PATCH 1/6] fix: prevent RUNNER detection failure Append `|| true` so the justfile can still be parsed/used on systems without a container runtime like docker or podman, instead of erroring out at command substitution time. --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 283458865..2129b6b14 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,5 @@ SESSION := "cm12345-1" -RUNNER := `command -v docker || command -v podman` +RUNNER := `command -v docker || command -v podman || true` default: compose serve From d55ed6edb1aebb1ec625f7644e9dd14cb98a4cda Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Tue, 1 Sep 2026 08:16:57 +0000 Subject: [PATCH 2/6] ci: add _check-runner to ensure container runtime availability --- justfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 2129b6b14..7fb50ecf4 100644 --- a/justfile +++ b/justfile @@ -1,6 +1,13 @@ SESSION := "cm12345-1" RUNNER := `command -v docker || command -v podman || true` +_check-runner: + #!/usr/bin/env bash + if [[ "{{ RUNNER }}" == "" ]]; then + echo "{{ style('error') }}error{{ NORMAL }}: No container runtime available - either podman or docker is required" + exit 1 + fi + default: compose serve init-example-services: @@ -10,7 +17,7 @@ init-example-services: git submodule update --init example-services fi -compose +ARGS="up -d --no-recreate": init-example-services +compose +ARGS="up -d --no-recreate": init-example-services _check-runner {{ RUNNER }} compose -f tests/system_tests/compose.yaml {{ARGS}} serve *OPTS: From f7e9f26c72c28126ea103c4da05419f4f7f12920 Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Tue, 1 Sep 2026 08:17:48 +0000 Subject: [PATCH 3/6] feat: add Just VSCode plugin and enable bash completion for just commands --- .devcontainer/devcontainer.json | 3 ++- Dockerfile | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 092c670c2..5a002a56f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -45,7 +45,8 @@ "charliermarsh.ruff", "ms-pyright.pyright", "ms-azuretools.vscode-docker", - "ms-kubernetes-tools.vscode-kubernetes-tools" + "ms-kubernetes-tools.vscode-kubernetes-tools", + "kokakiwi.vscode-just" ] } }, diff --git a/Dockerfile b/Dockerfile index 631170841..3eaedaf3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,9 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/s rm get_helm.sh RUN helm plugin install https://github.com/losisin/helm-values-schema-json.git --version 2.3.1 +# Enable bash completion for just commands +RUN echo 'source <(just --completions bash)' >> /root/terminal-config/bashrc-default + # The build stage installs the context into the venv FROM developer AS build From d440577a36de226100dfc728384b72dd5b723c00 Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Tue, 1 Sep 2026 08:19:24 +0000 Subject: [PATCH 4/6] docs: add documentation comments to Justfile for clarity and usage guidance --- justfile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 7fb50ecf4..429160865 100644 --- a/justfile +++ b/justfile @@ -8,8 +8,10 @@ _check-runner: exit 1 fi +[doc('Start the example services via compose and run the blueapi server')] default: compose serve +[doc('Clone the example-services submodule if needed but leave it alone otherwise')] init-example-services: #!/usr/bin/env bash # Clone the example-services submodule if needed but leave it alone otherwise @@ -17,33 +19,41 @@ init-example-services: git submodule update --init example-services fi +[doc('Bring up the example services with docker/podman compose')] compose +ARGS="up -d --no-recreate": init-example-services _check-runner - {{ RUNNER }} compose -f tests/system_tests/compose.yaml {{ARGS}} + {{ RUNNER }} compose -f tests/system_tests/compose.yaml {{ ARGS }} +[doc('Run the blueapi server against the system test config')] serve *OPTS: #!/usr/bin/env bash - source tests/system_tests/.env # sets required EPICS environmental variables - uv run blueapi -c tests/system_tests/config.yaml {{OPTS}} serve #start BlueAPI server using config in config.yaml file + source tests/system_tests/.env + uv run blueapi -c tests/system_tests/config.yaml {{ OPTS }} serve +[doc('Run a plan against the blueapi controller')] run PLAN PARAMS: uv run blueapi -c tests/system_tests/config.yaml controller run -i {{ SESSION }} {{ PLAN }} '{{ PARAMS }}' +[doc('Regenerate schemas, run pre-commit checks and type checking')] lint: uv run blueapi config-schema -u uv run blueapi schema -u uv run prek run --all-files uv run pyright src tests +[doc('Run the unit test suite')] unit *OPTS="-n logical": uv run pytest tests/unit_tests {{ OPTS }} +[doc('Run the system test suite')] system *OPTS: uv run pytest tests/system_tests {{ OPTS }} +[doc('Run unit tests with coverage and open the HTML report')] coverage: uv run pytest tests/unit_tests --cov --cov-report html xdg-open htmlcov/index.html +[doc('Start an interactive REPL logged in to a blueapi client')] repl: #!/usr/bin/env bash uv run --with ptpython ptpython -i <(cat << EOF From a4e36d1361b54c24d6bbabce7ed4813934eeac31 Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Wed, 2 Sep 2026 10:42:35 +0100 Subject: [PATCH 5/6] Add code review suggestions --- .devcontainer/devcontainer.json | 3 +-- Dockerfile | 3 --- justfile | 7 +++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5a002a56f..092c670c2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -45,8 +45,7 @@ "charliermarsh.ruff", "ms-pyright.pyright", "ms-azuretools.vscode-docker", - "ms-kubernetes-tools.vscode-kubernetes-tools", - "kokakiwi.vscode-just" + "ms-kubernetes-tools.vscode-kubernetes-tools" ] } }, diff --git a/Dockerfile b/Dockerfile index 3eaedaf3c..631170841 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,6 @@ RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/s rm get_helm.sh RUN helm plugin install https://github.com/losisin/helm-values-schema-json.git --version 2.3.1 -# Enable bash completion for just commands -RUN echo 'source <(just --completions bash)' >> /root/terminal-config/bashrc-default - # The build stage installs the context into the venv FROM developer AS build diff --git a/justfile b/justfile index 429160865..a207d69c6 100644 --- a/justfile +++ b/justfile @@ -14,7 +14,6 @@ default: compose serve [doc('Clone the example-services submodule if needed but leave it alone otherwise')] init-example-services: #!/usr/bin/env bash - # Clone the example-services submodule if needed but leave it alone otherwise if [[ $(git submodule status example-services) =~ ^- ]]; then git submodule update --init example-services fi @@ -23,13 +22,13 @@ init-example-services: compose +ARGS="up -d --no-recreate": init-example-services _check-runner {{ RUNNER }} compose -f tests/system_tests/compose.yaml {{ ARGS }} -[doc('Run the blueapi server against the system test config')] +[doc('Run the blueapi server with the system test config')] serve *OPTS: #!/usr/bin/env bash source tests/system_tests/.env uv run blueapi -c tests/system_tests/config.yaml {{ OPTS }} serve -[doc('Run a plan against the blueapi controller')] +[doc('Run a plan using the blueapi CLI')] run PLAN PARAMS: uv run blueapi -c tests/system_tests/config.yaml controller run -i {{ SESSION }} {{ PLAN }} '{{ PARAMS }}' @@ -53,7 +52,7 @@ coverage: uv run pytest tests/unit_tests --cov --cov-report html xdg-open htmlcov/index.html -[doc('Start an interactive REPL logged in to a blueapi client')] +[doc('Start an interactive REPL with an authenticated blueapi clien')] repl: #!/usr/bin/env bash uv run --with ptpython ptpython -i <(cat << EOF From 615acd10c3e498a0c3fe624b94b8b253bc942e7f Mon Sep 17 00:00:00 2001 From: Zoheb Shaikh <26975142+ZohebShaikh@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:03:49 +0100 Subject: [PATCH 6/6] fix typo --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index a207d69c6..6d1518087 100644 --- a/justfile +++ b/justfile @@ -52,7 +52,7 @@ coverage: uv run pytest tests/unit_tests --cov --cov-report html xdg-open htmlcov/index.html -[doc('Start an interactive REPL with an authenticated blueapi clien')] +[doc('Start an interactive REPL with an authenticated blueapi client')] repl: #!/usr/bin/env bash uv run --with ptpython ptpython -i <(cat << EOF