fix: align ps/cron :report --global keys with plugin convention

The `ps` and `cron` plugins emitted `:report --format json` keys that
skipped the `<plugin>-` prefix or `-global-` infix used by every other
plugin, forcing external consumers to special-case those names. Rename
the affected report flags so they match the `<plugin>-global-<property>`
and `<plugin>-computed-<property>` convention introduced in 0.38.0, and
add the previously missing `computed-` siblings to both the per-app and
`--global` reports so the shape lines up with caddy, haproxy, and
traefik.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-25 13:37:56 -04:00
parent 99b949da4a
commit 3feedd8786
7 changed files with 143 additions and 38 deletions

View File

@@ -19,23 +19,25 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
var flags map[string]common.ReportFunc
if appName == "--global" {
flags = map[string]common.ReportFunc{
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
"--ps-computed-procfile-path": reportComputedProcfilePath,
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
}
} else {
flags = map[string]common.ReportFunc{
"--deployed": reportDeployed,
"--processes": reportProcesses,
"--ps-can-scale": reportCanScale,
"--ps-restart-policy": reportRestartPolicy,
"--ps-computed-procfile-path": reportComputedProcfilePath,
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--ps-procfile-path": reportProcfilePath,
"--restore": reportRestore,
"--running": reportRunningState,
"--global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
"--computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
"--stop-timeout-seconds": reportStopTimeoutSeconds,
"--deployed": reportDeployed,
"--processes": reportProcesses,
"--ps-can-scale": reportCanScale,
"--ps-restart-policy": reportRestartPolicy,
"--ps-computed-procfile-path": reportComputedProcfilePath,
"--ps-global-procfile-path": reportGlobalProcfilePath,
"--ps-procfile-path": reportProcfilePath,
"--restore": reportRestore,
"--running": reportRunningState,
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
}
extraFlags := addStatusFlags(appName, infoFlag)