Repository navigation
fix(footprint): consistent snake_case keys in -o json - #781
Merged
Merged
Conversation
`spawn footprint -o json` emitted snake_case at the top level and
PascalCase inside it:
{"control_plane": [{"Service": "logs", "Kind": "log-group", ...}]}
because footprintReport had json tags and ControlPlaneResource did not. A
machine contract should not require knowing which half of the struct you
are reading.
Found while using the command's own output to scope #780 — a Counter over
r['service'] raised KeyError, which is the kind of thing the author never
hits because they wrote the struct.
Note what did NOT catch this: the cross-repo API surface gate (#679) is
unchanged by this commit, because it deliberately drops struct tags — "a
tag change alters JSON/DynamoDB encoding, which matters a great deal, but
it is not part of the COMPILE contract this gate guards". That is still
the right scope, but it means a JSON wire-contract change is invisible to
it. Worth knowing; not worth widening the gate, since taskproto's wire
format has its own round-trip tests and footprint's is new.
No consumer exists to break: `spawn footprint` landed in #771 hours ago
and is unreleased.
The Tier 0 JSON test is unaffected — it asserts the top-level keys, which
were already snake_case.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spawn footprint -o jsonemitted snake_case at the top level and PascalCaseinside it:
{"control_plane": [{"Service": "logs", "Kind": "log-group", ...}]}because
footprintReporthad json tags andControlPlaneResourcedid not. Amachine contract shouldn't require knowing which half of the struct you're
reading.
Found while using the command's own output to scope #780 — a
Counteroverr['service']raisedKeyError, which is exactly the kind of thing the authornever hits because they wrote the struct.
What did not catch this
The cross-repo API surface gate (#679) is unchanged by this commit, because it
deliberately drops struct tags — "a tag change alters JSON/DynamoDB encoding,
which matters a great deal, but it is not part of the COMPILE contract this gate
guards."
That's still the right scope, but it means a JSON wire-contract change is
invisible to it. Worth knowing; not worth widening the gate, since
taskproto'swire format has its own round-trip tests and
footprint's is brand new.No consumer to break
spawn footprintlanded in #771 hours ago and is unreleased. The Tier 0 JSONtest is unaffected — it asserts the top-level keys, which were already
snake_case.