feat: accept --global on :report subcommands

Every `:report` subcommand now recognizes `--global` as a scope selector that limits the report to globally-configured properties, including in JSON form via `--global --format json`. Previously this combination was rejected because `--global` was treated as an info flag, conflicting with `--format`. The shared `common.ParseReportArgs` helper now returns a `ReportArgs` struct exposing the parsed scope; each Go and bash report selects a global-only flag map when scope is global, and skips per-app verification.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-29 04:47:15 -04:00
parent ec70e10c5d
commit 8282981361
61 changed files with 1379 additions and 518 deletions

View File

@@ -831,3 +831,31 @@ teardown() {
assert_failure
assert_output_contains "--format flag cannot be specified when specifying an info flag"
}
@test "(git:report) --global" {
run /bin/bash -c "dokku git:report --global"
echo "output: $output"
echo "status: $status"
assert_success
assert_output_contains "global git information"
assert_output_contains "Global deploy branch"
}
@test "(git:report) --global --format json" {
run /bin/bash -c "dokku git:report --global --format json | jq -e ."
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku git:report --global --format json | jq -r '.\"global-deploy-branch\"'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "master"
run /bin/bash -c "dokku git:report --global --format json | jq -r 'has(\"deploy-branch\")'"
echo "output: $output"
echo "status: $status"
assert_success
assert_output "false"
}