Skip to content

test(#756): pin the AWS Config seed projections and record them - #1319

Merged
scttfrdmn merged 1 commit into
mainfrom
wire-config-seeds
Oct 1, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
wire-config-seeds

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Discharges the emulator/configservice_control.go block of #756's AC3 — ten
inventory 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, an AccountID is
substrate'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.go is the
worked case). The five AWS Config seed structs are different in kind: accountId and
region are members of substrate's own control-plane request, read off the POST
body by each handleConfigSeed* to build the seed's state key — the whole mechanism
cfgsvcCtrlKeyCandidates resolves, and what lets a fixture seed "every account in
eu-west-1" or "this account in every Region". Deleting them would delete that, so
the 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* getter
returns 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_SeededResponsesCarryNoSeedScopeMember runs over the raw bytes of all
seven responses that consult a seed:

Seed Responses
recorder-status DescribeConfigurationRecorderStatus
delivery-status DescribeDeliveryChannelStatus
rule-compliance DescribeComplianceByConfigRule, GetComplianceDetailsByConfigRule
pack-status DescribeConformancePackStatus
pack-compliance DescribeConformancePackCompliance, GetConformancePackComplianceSummary

Each 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 the ever_tagged
kind 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/StopConfigurationRecorder answer an empty body, and
Put/DeleteConformancePack read a seeded pack state only to decide whether the call
is allowed. The test says so, so a reader does not mistake seven for an incomplete
list.

Ratchet

make wire-bookkeeping-check moves from 133 projected across 50 records, 186 still
reachable
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.
  • Negative control on the test: temporarily leaking accountId from the seed onto
    ConfigRecorderStatus, and a region member onto cfgsvcPackStatusShape, fails
    exactly the DescribeConfigurationRecorderStatus and DescribeConformancePackStatus
    subtests and no others — per-test, not by trusting a parent-level FAIL.
  • Negative control on the check script: misspelling the cited test name fails
    make wire-bookkeeping-check for all five records, so the third column is proven
    load-bearing rather than decorative.

Advances #756; AC3 continues with EC2's 30 lines and the smaller files, so the issue
stays open.

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.
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit d37d1e9 into main Oct 1, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the wire-config-seeds branch October 1, 2026 23:10
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.

1 participant