refactor: rename computed-* helpers, expose computed vector and network keys

Addresses review feedback on #8640. fn-archive-max-size,
fn-archive-max-files, fn-git-deploy-branch, and fn-git-keep-git-dir are
renamed with `computed` in the function name so the names match the
resolved-with-default semantic they implement, and every caller is
updated in lockstep. logs:report renames the misordered
--logs-vector-global-image and --logs-vector-global-networks to
--logs-global-vector-image and --logs-global-vector-networks, makes the
global getters return the raw stored value, and adds
--logs-computed-vector-image, --logs-computed-vector-networks, and
--logs-computed-vector-sink. network:report --global gains the
computed-* keys for attach-post-create, attach-post-deploy,
initial-network, and tld so external tooling can read the resolved
value at global scope. The --quiet flag is dropped from every
:report --format json | jq invocation across the PR's bats files; the
report's --format json output is the only stdout and the flag is
redundant.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-23 04:47:03 -04:00
parent e70f7918a3
commit 357e12bd83
22 changed files with 200 additions and 174 deletions

View File

@@ -72,7 +72,7 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet network:report --global --format json | jq -r '.\"network-global-tld\"'"
run /bin/bash -c "dokku network:report --global --format json | jq -r '.\"network-global-tld\"'"
echo "output: $output"
echo "status: $status"
assert_success
@@ -83,19 +83,19 @@ teardown() {
echo "status: $status"
assert_success
run /bin/bash -c "dokku --quiet network:report --global --format json | jq -r '.\"network-global-tld\"'"
run /bin/bash -c "dokku network:report --global --format json | jq -r '.\"network-global-tld\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "example.test"
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-tld\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-tld\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "example.test"
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-tld\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-computed-tld\"'"
echo "output: $output"
echo "status: $status"
assert_success
@@ -112,26 +112,26 @@ teardown() {
run /bin/bash -c "dokku network:set --global attach-post-create"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-attach-post-create\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-attach-post-create\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku network:set --global attach-post-create create-network-x"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-create\"'"
assert_success
assert_output "create-network-x"
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-create\"'"
assert_success
assert_output "create-network-x"
@@ -146,22 +146,22 @@ teardown() {
run /bin/bash -c "dokku network:set --global attach-post-deploy"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-attach-post-deploy\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-attach-post-deploy\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku network:set --global attach-post-deploy deploy-network-x"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-attach-post-deploy\"'"
assert_success
assert_output "deploy-network-x"
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-deploy\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-computed-attach-post-deploy\"'"
assert_success
assert_output "deploy-network-x"
@@ -176,22 +176,22 @@ teardown() {
run /bin/bash -c "dokku network:set --global initial-network"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-initial-network\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-initial-network\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
assert_success
assert_output ""
run /bin/bash -c "dokku network:set --global initial-network initial-network-x"
assert_success
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-global-initial-network\"'"
assert_success
assert_output "initial-network-x"
run /bin/bash -c "dokku --quiet network:report $TEST_APP --format json | jq -r '.\"network-computed-initial-network\"'"
run /bin/bash -c "dokku network:report $TEST_APP --format json | jq -r '.\"network-computed-initial-network\"'"
assert_success
assert_output "initial-network-x"