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 committed 2026-05-27 07:17:00 -04:00
1 parent 5925efedc7
commit 3bf6c72451
48 files changed
+928 -77

No files matched your search

+18
View File
@@ -158,3 +158,21 @@ assert_k3s_global_unset_set() {
run /bin/bash -c "dokku scheduler-k3s:set --global token"
assert_success
}
@test "(scheduler-k3s:report) emits new stripped JSON keys alongside legacy" {
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r 'has(\"global-deploy-timeout\") and has(\"scheduler-k3s-global-deploy-timeout\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r 'has(\"computed-deploy-timeout\") and has(\"scheduler-k3s-computed-deploy-timeout\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r 'has(\"global-namespace\") and has(\"scheduler-k3s-global-namespace\")'"
assert_success
assert_output "true"
run /bin/bash -c "dokku scheduler-k3s:report --global --format json | jq -r 'has(\"computed-namespace\") and has(\"scheduler-k3s-computed-namespace\")'"
assert_success
assert_output "true"
}