Skip to content

fix: sort resource and ps-scale command arguments#393

Merged
josegonzalez merged 1 commit into
mainfrom
341-bug-planned-and-executed-resource-command-argument-order-can-differ
Jul 18, 2026
Merged

fix: sort resource and ps-scale command arguments#393
josegonzalez merged 1 commit into
mainfrom
341-bug-planned-and-executed-resource-command-argument-order-can-differ

Conversation

@josegonzalez

Copy link
Copy Markdown
Member

The resource limit, resource reserve, and ps-scale tasks built their command arguments and mutation lists by ranging over a Go map, so the planned command could differ from the executed command and vary from run to run. This violated the byte-identical Commands contract that plan output and apply --verbose are meant to share, and produced noisy, non-reproducible mutation ordering.

Ordering the keys deterministically makes plan and apply render byte-identical commands and produces a stable mutation order. The other map-carrying tasks such as dokku_config already sort their keys, and list-based tasks such as dokku_ports preserve the authored order, so they are unaffected.

Fixes #341.

The resource limit, resource reserve, and ps-scale tasks built their command arguments and mutation lists by ranging over a Go map, so the planned command could differ from the executed command and vary from run to run. Ordering the keys deterministically makes plan and apply render byte-identical `Commands` and produces a stable mutation order.
@josegonzalez
josegonzalez merged commit d728293 into main Jul 18, 2026
14 checks passed
@josegonzalez
josegonzalez deleted the 341-bug-planned-and-executed-resource-command-argument-order-can-differ branch July 18, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: planned and executed resource command argument order can differ

1 participant