Skip to content

Test and document field reorder safety in tables.toml#151

Merged
larsewi merged 3 commits intomasterfrom
field-reorder-test-and-docs
May 7, 2026
Merged

Test and document field reorder safety in tables.toml#151
larsewi merged 3 commits intomasterfrom
field-reorder-test-and-docs

Conversation

@larsewi
Copy link
Copy Markdown
Owner

@larsewi larsewi commented May 7, 2026

Summary

  • Add an integration test (tests/accept_field_reorder.rs) that reorders fields in tables.toml between two blocks with an unchanged CSV and asserts the resulting patch carries no inserts, deletes, or updates and survives a wire round-trip. Locks in the property shipped in Fix record corruption when fields are reordered in table config #150.
  • Update README.md to note that, when header = true, the order in which fields are declared under a table is cosmetic and reordering them does not invalidate existing state. Also fix two British spellings in the boolean-sentinel paragraph (recognisedrecognized, honouredhonored).
  • Update CONTRIBUTING.md to describe layout-change detection in terms of the canonical field list (primary keys first, then subsidiaries; each group sorted lexicographically by name) and to call out that reordering is a no-op while add/remove/rename still triggers the full-state fallback.

larsewi and others added 3 commits May 7, 2026 12:06
Lock in the property that field declaration order in `tables.toml` is
cosmetic: when the underlying CSV is unchanged but the operator swaps
fields in the config between two blocks, the resulting patch carries no
inserts, deletes, or updates, and survives a wire round-trip.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Note in README.md that when `header = true`, reordering fields in the
config does not invalidate existing state. Update the layout-change
description in CONTRIBUTING.md to refer to the canonical field list
(primary keys first, then subsidiaries; each group sorted lexicographically
by name) and to call out that reordering is a no-op while add/remove/rename
still triggers the full-state fallback.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`recognised` -> `recognized`, `honoured` -> `honored`, matching the
American-English spelling convention used elsewhere in the project.

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@larsewi larsewi added the chore Internal change, excluded from release notes label May 7, 2026
@larsewi larsewi merged commit 4dd3908 into master May 7, 2026
6 checks passed
@larsewi larsewi deleted the field-reorder-test-and-docs branch May 7, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Internal change, excluded from release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant