fix: split report global keys into raw and computed across plugins

The `<plugin>-global-<property>` keys in `:report` output returned the resolved value with the built-in default substituted in, so external tooling could not distinguish a property that had been set globally to the default from one that had never been set. The bare keys for caddy, haproxy, and traefik global-only properties had the same shape. The `global-<property>` keys now hold the raw stored value and are empty when nothing has been set, and a new `computed-<property>` key holds the effective value used at runtime, falling back through the per-app value (where one exists), the global value, and the built-in default. The bare global-only keys for the three proxy plugins are removed in favor of the raw/computed pair. Closes #8631.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-13 16:39:38 -04:00
parent f3bdd7e4ec
commit 76b033234f
56 changed files with 1031 additions and 334 deletions

View File

@@ -41,27 +41,44 @@ teardown() {
}
@test "(checks:report) --global --format json" {
run /bin/bash -c "dokku checks:set --global wait-to-retire"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet checks:report --global --format json | jq -e ."
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet checks:report --global --format json | jq -r '.\"global-wait-to-retire\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet checks:report --global --format json | jq -r '.\"computed-wait-to-retire\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "60"
run /bin/bash -c "dokku checks:set --global wait-to-retire 90"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku checks:report --global --format json | jq -e ."
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku checks:report --global --format json | jq -r '.\"global-wait-to-retire\"'"
run /bin/bash -c "dokku --quiet checks:report --global --format json | jq -r '.\"global-wait-to-retire\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "90"
run /bin/bash -c "dokku checks:report --global --format json | jq -r 'has(\"wait-to-retire\")'"
run /bin/bash -c "dokku --quiet checks:report --global --format json | jq -r '.\"computed-wait-to-retire\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "false"
assert_output "90"
run /bin/bash -c "dokku checks:report --global"
echo "output: $output"
@@ -69,16 +86,22 @@ teardown() {
assert_success
assert_output_contains "global checks information"
run /bin/bash -c "dokku checks:report --global --checks-global-wait-to-retire"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "90"
run /bin/bash -c "dokku checks:set --global wait-to-retire"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku checks:report --global --checks-global-wait-to-retire"
echo "output: $output"
echo "status: $status"
assert_success
assert_output ""
run /bin/bash -c "dokku checks:report --global --checks-computed-wait-to-retire"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "60"
}
@test "(checks) checks:help" {