From 964c0fc4e9b7bd49010582bc5118047723633649 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 06:11:22 -0400 Subject: [PATCH 1/6] fix: source property-functions where fn-plugin-property-* helpers are used The release_and_deploy function and several proxy plugin scripts call fn-plugin-property-* helpers without sourcing `plugins/common/property-functions`, producing `command not found` errors during deploys. Source the helpers from `plugins/common/functions` and from each proxy plugin entry point that consumes them. --- plugins/caddy-vhosts/command-functions | 1 + plugins/caddy-vhosts/pre-restore | 1 + plugins/common/functions | 5 +---- plugins/haproxy-vhosts/command-functions | 1 + plugins/haproxy-vhosts/pre-restore | 1 + plugins/nginx-vhosts/pre-restore | 1 + plugins/openresty-vhosts/command-functions | 1 + plugins/openresty-vhosts/pre-restore | 1 + plugins/traefik-vhosts/command-functions | 1 + plugins/traefik-vhosts/pre-restore | 1 + tests/unit/core_2.bats | 21 +++++++++++++++++++++ 11 files changed, 31 insertions(+), 4 deletions(-) diff --git a/plugins/caddy-vhosts/command-functions b/plugins/caddy-vhosts/command-functions index 351cf88e5..a8d56f85f 100755 --- a/plugins/caddy-vhosts/command-functions +++ b/plugins/caddy-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/caddy-vhosts/pre-restore b/plugins/caddy-vhosts/pre-restore index 4990a7d8e..3e357b296 100755 --- a/plugins/caddy-vhosts/pre-restore +++ b/plugins/caddy-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/caddy-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/common/functions b/plugins/common/functions index a3ed2c9ef..3d5246c21 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -eo pipefail [[ $DOKKU_TRACE ]] && set -x +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" has_tty() { declare desc="return 0 if we have a tty" @@ -975,10 +976,6 @@ fn-migrate-config-to-property() { source "$PLUGIN_AVAILABLE_PATH/config/functions" fi - if ! declare -f -F fn-plugin-property-write >/dev/null; then - source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" - fi - if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then local value=$(plugn trigger config-get-global "$GLOBAL_CONFIG_VAR" || true) if [[ -n "$value" ]]; then diff --git a/plugins/haproxy-vhosts/command-functions b/plugins/haproxy-vhosts/command-functions index 20358ec13..00ac09698 100755 --- a/plugins/haproxy-vhosts/command-functions +++ b/plugins/haproxy-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/haproxy-vhosts/pre-restore b/plugins/haproxy-vhosts/pre-restore index ed637bd96..ca74e46a1 100755 --- a/plugins/haproxy-vhosts/pre-restore +++ b/plugins/haproxy-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/nginx-vhosts/pre-restore b/plugins/nginx-vhosts/pre-restore index 40565f897..e326fdb9f 100755 --- a/plugins/nginx-vhosts/pre-restore +++ b/plugins/nginx-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/openresty-vhosts/command-functions b/plugins/openresty-vhosts/command-functions index 09ad8f708..a3515429e 100755 --- a/plugins/openresty-vhosts/command-functions +++ b/plugins/openresty-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/openresty-vhosts/pre-restore b/plugins/openresty-vhosts/pre-restore index 8903a23ae..f347f2629 100755 --- a/plugins/openresty-vhosts/pre-restore +++ b/plugins/openresty-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/openresty-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/plugins/traefik-vhosts/command-functions b/plugins/traefik-vhosts/command-functions index 6e43edce1..9d7a922a1 100755 --- a/plugins/traefik-vhosts/command-functions +++ b/plugins/traefik-vhosts/command-functions @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/proxy/command-functions" source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/internal-functions" set -eo pipefail diff --git a/plugins/traefik-vhosts/pre-restore b/plugins/traefik-vhosts/pre-restore index 698d97788..6d641a3fa 100755 --- a/plugins/traefik-vhosts/pre-restore +++ b/plugins/traefik-vhosts/pre-restore @@ -1,5 +1,6 @@ #!/usr/bin/env bash source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions" +source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" source "$PLUGIN_AVAILABLE_PATH/traefik-vhosts/command-functions" set -eo pipefail [[ $DOKKU_TRACE ]] && set -x diff --git a/tests/unit/core_2.bats b/tests/unit/core_2.bats index 26cf2708c..fed11c1bf 100644 --- a/tests/unit/core_2.bats +++ b/tests/unit/core_2.bats @@ -112,6 +112,27 @@ teardown() { assert_urls "http://dokku.example.com" "http://${TEST_APP}.${DOKKU_DOMAIN}" "https://dokku.example.com" "https://${TEST_APP}.${DOKKU_DOMAIN}" "https://test.${DOKKU_DOMAIN}" "http://test.${DOKKU_DOMAIN}" } +@test "(core) sourcing common/functions exposes fn-plugin-property-* helpers" { + run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-get-default" + echo "output: $output" + echo "status: $status" + assert_success + + run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-write" + echo "output: $output" + echo "status: $status" + assert_success +} + +@test "(core) release_and_deploy does not emit command not found errors" { + run deploy_app + echo "output: $output" + echo "status: $status" + assert_success + assert_output_not_contains "fn-plugin-property-get-default: command not found" + assert_output_not_contains "fn-plugin-property-get: command not found" +} + @test "(core) git-remote (off-port)" { run deploy_app nodejs-express ssh://dokku@127.0.0.1:22333/$TEST_APP echo "output: $output" From 49dc1c1e64a0bcf73f01efb440ad8b3ce43be350 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 09:30:00 -0400 Subject: [PATCH 2/6] fix: correct the assertion --- tests/unit/core_2.bats | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/core_2.bats b/tests/unit/core_2.bats index fed11c1bf..0260004f6 100644 --- a/tests/unit/core_2.bats +++ b/tests/unit/core_2.bats @@ -131,6 +131,7 @@ teardown() { assert_success assert_output_not_contains "fn-plugin-property-get-default: command not found" assert_output_not_contains "fn-plugin-property-get: command not found" + assert_output_not_contains "/common/property-functions: No such file or directory" } @test "(core) git-remote (off-port)" { From 473bcce6887de62e9d19e10117788a45a4d258b8 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 09:32:09 -0400 Subject: [PATCH 3/6] fix: use inline source instead of global source Ensure property-functions are sourced only if not already defined. --- plugins/common/functions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/common/functions b/plugins/common/functions index 3d5246c21..08f316ff8 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -eo pipefail [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" has_tty() { declare desc="return 0 if we have a tty" @@ -637,6 +636,10 @@ release_and_deploy() { local exit_code=0 if verify_image "$IMAGE"; then + if ! declare -f -F fn-plugin-property-get-default >/dev/null; then + source "$PLUGIN_AVAILABLE_PATH/common/property-functions" + fi + IMAGE_SOURCE_TYPE="$(get_image_builder_type "$IMAGE" "$APP")" local DOKKU_APP_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "$APP" "skip-deploy" "")" local DOKKU_GLOBAL_SKIP_DEPLOY="$(fn-plugin-property-get-default "ps" "--global" "skip-deploy" "")" @@ -976,6 +979,10 @@ fn-migrate-config-to-property() { source "$PLUGIN_AVAILABLE_PATH/config/functions" fi + if ! declare -f -F fn-plugin-property-write >/dev/null; then + source "$PLUGIN_AVAILABLE_PATH/common/property-functions" + fi + if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then local value=$(plugn trigger config-get-global "$GLOBAL_CONFIG_VAR" || true) if [[ -n "$value" ]]; then From f0a4a7fc29a317c7622be8e562b7f94dd02c3805 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 13:16:28 -0400 Subject: [PATCH 4/6] chore: remove now invalid tests --- tests/unit/core_2.bats | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/unit/core_2.bats b/tests/unit/core_2.bats index 0260004f6..a0f7a4591 100644 --- a/tests/unit/core_2.bats +++ b/tests/unit/core_2.bats @@ -112,18 +112,6 @@ teardown() { assert_urls "http://dokku.example.com" "http://${TEST_APP}.${DOKKU_DOMAIN}" "https://dokku.example.com" "https://${TEST_APP}.${DOKKU_DOMAIN}" "https://test.${DOKKU_DOMAIN}" "http://test.${DOKKU_DOMAIN}" } -@test "(core) sourcing common/functions exposes fn-plugin-property-* helpers" { - run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-get-default" - echo "output: $output" - echo "status: $status" - assert_success - - run /bin/bash -c "source $PLUGIN_CORE_AVAILABLE_PATH/common/functions && declare -f -F fn-plugin-property-write" - echo "output: $output" - echo "status: $status" - assert_success -} - @test "(core) release_and_deploy does not emit command not found errors" { run deploy_app echo "output: $output" From d2680741891dacb2e0aea03895c18c2b27ce3321 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 13:17:11 -0400 Subject: [PATCH 5/6] chore: standardize on PLUGIN_AVAILABLE_PATH for source From aea322be6fb0d298f7cdf11f665b50d73d1e9a33 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 4 May 2026 13:17:49 -0400 Subject: [PATCH 6/6] chore: use old path --- plugins/common/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/common/functions b/plugins/common/functions index 08f316ff8..060cb7f34 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -637,7 +637,7 @@ release_and_deploy() { if verify_image "$IMAGE"; then if ! declare -f -F fn-plugin-property-get-default >/dev/null; then - source "$PLUGIN_AVAILABLE_PATH/common/property-functions" + source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" fi IMAGE_SOURCE_TYPE="$(get_image_builder_type "$IMAGE" "$APP")" @@ -980,7 +980,7 @@ fn-migrate-config-to-property() { fi if ! declare -f -F fn-plugin-property-write >/dev/null; then - source "$PLUGIN_AVAILABLE_PATH/common/property-functions" + source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions" fi if [[ -n "$GLOBAL_CONFIG_VAR" ]]; then