fix: align Go-plugin :report JSON keys with bash-strip convention

Every Go-implemented plugin's `:report --format json` now emits keys without the redundant `<plugin>-` head segment, matching the shape bash plugins have always emitted. The CLI flag names and `:set` semantics are unchanged. For backwards compatibility during the 0.38.x patch series, the legacy `<plugin>-<property>` keys are emitted side-by-side with the new keys, and a future major release will drop the legacy keys. `common.ReportSingleApp` is refactored to accept a `ReportSingleAppInput` struct with a `Validate()` method so the input is checked before any work runs, which also catches the latent `"docker options"` reportType bug at the API boundary.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-27 07:17:00 -04:00
parent 5925efedc7
commit 3bf6c72451
48 changed files with 928 additions and 77 deletions

View File

@@ -965,3 +965,28 @@ teardown() {
assert_success
assert_output_contains "Stopping and removing vector container"
}
@test "(logs:report) emits new stripped JSON keys alongside legacy" {
run create_app
assert_success
run /bin/bash -c "dokku logs:report $TEST_APP --format json | jq -r 'has(\"vector-sink\") and has(\"logs-vector-sink\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku logs:report $TEST_APP --format json | jq -r 'has(\"global-vector-sink\") and has(\"logs-global-vector-sink\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku logs:report $TEST_APP --format json | jq -r 'has(\"computed-vector-sink\") and has(\"logs-computed-vector-sink\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku logs:report $TEST_APP --format json | jq -r 'has(\"max-size\") and has(\"logs-max-size\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku logs:report --global --format json | jq -r 'has(\"global-vector-image\") and has(\"logs-global-vector-image\")'"
assert_success
assert_output "true"
}