Repository navigation
test(#756): pin the AWS Config seed projections and record them - #1319
Merged
Merged
Conversation
AWS Config's five control-plane seed records account for ten of #756's inventory lines, and they are not what the rest of that inventory describes. Everywhere else an AccountID is substrate's bookkeeping grafted onto a resource record that a handler marshals onto the wire; these are members of substrate's own control-plane request, read off the POST body to build the seed's state key, which is the whole mechanism cfgsvcCtrlKeyCandidates resolves. Deleting them would delete the ability to seed one account or one Region, so the inventory's narrower discharge -- a field written and never read -- was never available. What is true instead is that no AWS response carries one: each seed is read at request time and its named values are copied onto a published shape, so the projection already lived in the code. What was missing was the citation the projected inventory requires. TestConfigWire_SeededResponsesCarryNoSeedScopeMember supplies it over the raw bytes of all seven responses that consult a seed, walking each document so the claim is "no such member at any depth" rather than "not at the top level" -- the account ID and the Region both appear legitimately in these same bodies inside a Config ARN, so only an assertion about the member name is available. make wire-bookkeeping-check moves to 143 projected across 55 records, 176 still reachable, of the same 319 declared.
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 1, 2026
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.
Discharges the
emulator/configservice_control.goblock of #756's AC3 — teninventory lines across five records — the largest non-EC2 block in the baseline.
Why these ten are not what the inventory otherwise describes
Everywhere else in
scripts/wire-bookkeeping-baseline.txt, anAccountIDissubstrate's bookkeeping grafted onto a resource record that a handler then
marshals onto the wire, and the fix is a wire struct (
emulator/ecr_wire.gois theworked case). The five AWS Config seed structs are different in kind:
accountIdandregionare members of substrate's own control-plane request, read off the POSTbody by each
handleConfigSeed*to build the seed's state key — the whole mechanismcfgsvcCtrlKeyCandidatesresolves, and what lets a fixture seed "every account ineu-west-1" or "this account in every Region". Deleting them would delete that, sothe inventory's narrower discharge (a field written and never read) was never
available here.
What holds instead is that no AWS response carries one: every
seeded*getterreturns the struct and its caller copies named fields onto a published shape. The
projection already lived in the code; what was missing was the citation the projected
inventory demands before it will accept a record.
What the test asserts
TestConfigWire_SeededResponsesCarryNoSeedScopeMemberruns over the raw bytes of allseven responses that consult a seed:
recorder-statusDescribeConfigurationRecorderStatusdelivery-statusDescribeDeliveryChannelStatusrule-complianceDescribeComplianceByConfigRule,GetComplianceDetailsByConfigRulepack-statusDescribeConformancePackStatuspack-complianceDescribeConformancePackCompliance,GetConformancePackComplianceSummaryEach subtest asserts a presence anchor first — the seeded value has to be in the
body — so the absence below is an assertion about a response that actually consulted
the seed. The absence is a recursive member-name walk rather than a substring check:
the account ID and the Region both appear legitimately in these same bodies inside a
Config ARN, so only an assertion about the member name is available, and the walk
states "nowhere in the document". A failure names the exact path, e.g.
$.ConfigurationRecordersStatus[0].accountId.Neither member carries
omitempty, so there is no vacuity trap of theever_taggedkind the projected file's header warns about — a seed that was found at all had both
populated, and the seeds here are scoped to the exact account/Region pair the signed
test request resolves to so the most specific lookup candidate is the one that
answers.
Four more operations consult a seed and are deliberately absent, because they carry
none of it:
Start/StopConfigurationRecorderanswer an empty body, andPut/DeleteConformancePackread a seeded pack state only to decide whether the callis allowed. The test says so, so a reader does not mistake seven for an incomplete
list.
Ratchet
make wire-bookkeeping-checkmoves from 133 projected across 50 records, 186 stillreachable to 143 projected across 55 records, 176 still reachable, of the same
319 declared.
Verification
make lint— 0 issues.make test(race,-count=1) — green.make docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check— all pass;nothing but the ratchet line moved.
accountIdfrom the seed ontoConfigRecorderStatus, and aregionmember ontocfgsvcPackStatusShape, failsexactly the
DescribeConfigurationRecorderStatusandDescribeConformancePackStatussubtests and no others — per-test, not by trusting a parent-level FAIL.
make wire-bookkeeping-checkfor all five records, so the third column is provenload-bearing rather than decorative.
Advances #756; AC3 continues with EC2's 30 lines and the smaller files, so the issue
stays open.