Skip to content

test(#756): pin the CodeDeploy projections and record them - #1328

Merged
scttfrdmn merged 1 commit into
mainfrom
test/756-codedeploy-wire-projections
Oct 2, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
test/756-codedeploy-wire-projections

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Records the three CodeDeploy projections in scripts/wire-bookkeeping-projected.txt, which is the
second half of #756's AC3 for this service. #1327 built the projections; this proves they hold, which
is the only thing the inventory accepts in place of deleting a field.

CodeDeployApp, CodeDeployGroup and CodeDeployDeployment each declare AccountID and Region
under wire-visible json tags — six of the inventory's lines — tagged accountID/region, the
lowercase-initial spelling, since CodeDeploy's own members are lowerCamelCase and only the ID gives
them away.

What the new test asserts

emulator/codedeploy_wire_test.go holds one test per record, each t.Parallel(), each cited by one
projected line, and between them they drive all nine routed operations:

Test Operations
…ApplicationResponsesCarryNoBookkeepingMember CreateApplication, GetApplication, ListApplications, DeleteApplication
…DeploymentGroupResponsesCarryNoBookkeepingMember CreateDeploymentGroup, GetDeploymentGroup, DeleteDeploymentGroup
…DeploymentResponsesCarryNoBookkeepingMember CreateDeployment, GetDeployment

Each walks the whole decoded document and fails on a member named for either bookkeeping field at any
depth, reporting the $.a.b[0].c path. The whole document rather than the record's subtree, which is
strictly stronger and also the only thing that is one place here: the three gets nest the record's
members under an envelope (application, deploymentGroupInfo, deploymentInfo) while the creates
answer theirs flat.

Absence rather than exact membership. emulator/rds_wire_test.go's stronger form is not taken,
because GetApplication answers 4 of ApplicationInfo's 6 published members, GetDeploymentGroup 4
of 23 and GetDeployment 6 of 31 (#1199) — an exact-membership expectation would pin that gap and
have to be rewritten by the PR that closes it. This is the form configservice_wire_test.go,
redshift_wire_test.go, stepfunctions_wire_test.go and backup_wire_test.go already use.

Nothing passes for free. The comparison folds case, so one entry covers both the record's spelling
and the AccountID a projection written in the house style of the other services might introduce; and
it is an equality rather than a substring test, so the account appearing inside a serviceRoleArn
value is not a collision. Each case asserts a published member is present before asserting a
bookkeeping one is absent, and codedeployWireRequireScoped reads the stored record back as raw JSON
to prove it held both members in the first place. Neither member carries ,omitempty on any of the
three records and CodeDeploy routes none of the three tag operations, so no record declares
EverTagged and the vacuity trap #1304 fell into on EFS cannot arise.

The six operations that never rendered a record are driven anyway, because "every response that
answers the record" is what the projected file asks for and a reader should not have to work out
whether the list of nine is complete or a sample. Their maps are hand-built, and hand-built is what a
later edit can add a field to.

No assertion equates a timestamp: TimeController.Now advances from its baseline by elapsed wall
time, and pinning a date's rendering is emulator/codedeploy_dates_test.go's job (#1207).

The ratchet

before: 319 declared, 165 projected across 65 records, 154 still reachable
after:  319 declared, 171 projected across 68 records, 148 still reachable

Negative controls

Each was run and then restored:

  1. accountID added to codedeployAppOut → failed exactly
    …ApplicationResponsesCarryNoBookkeepingMember/GetApplication, nothing else.
  2. region added to codedeployGroupOut → failed exactly
    …DeploymentGroupResponsesCarryNoBookkeepingMember/GetDeploymentGroup.
  3. AccountID (UpperCamelCase, the spelling the fold exists for) added to codedeployDeploymentOut →
    failed exactly …DeploymentResponsesCarryNoBookkeepingMember/GetDeployment with
    GetDeployment answered $.deploymentInfo.AccountID.
  4. deleteApplication's {} patched to carry region → its subtest failed. Worth noting it failed
    as a missing anchor rather than as an absence, the anchor for that case being the empty object
    itself; so at that one site the anchor is the stricter of the two assertions. It is a regression
    guard either way.
  5. A cited test name misspelled → check-wire-bookkeeping refused the line:
    "emulator/ defines no such test. The citation is the only thing holding the projection".

Docs

A ### The account and Region a record carries reach no response subsection under CodeDeploy, the
house heading already used for Step Functions, Redshift and Backup. It is not linked from the
service lede, and that follows the existing convention rather than departing from it: four sections
now share that heading, so an in-document anchor would be ambiguous and position-dependent, and none
of the other three is linked either.

Verification

make lint (0 issues), make test (race, -count=1), and docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check all pass. The two operation checks report no change, no operation being added or
renamed. No production code changes in this PR.

Not in scope

#756 stays open — AC3's remaining large block is EC2's 30 lines, which need their own plan, then a
long tail. #1199 (the member gaps), #1196 (a deployment is Succeeded before CreateDeployment
returns) and #1198 (three unpublished refusal codes) are filed and documented; touching any of them
here would widen a block whose point is the six baseline lines.

Three records — CodeDeployApp, CodeDeployGroup and CodeDeployDeployment — each
declare AccountID and Region under wire-visible json tags, six of the inventory's
lines. #1327 projected all three through emulator/codedeploy_wire.go; this records
that the projection holds, which is what scripts/wire-bookkeeping-projected.txt
asks for before it will discharge a line.

emulator/codedeploy_wire_test.go holds one test per record, together driving all
nine routed operations and walking each decoded document for a member named for
either at any depth, reporting the $.a.b[0].c path. Absence rather than exact
membership, because GetApplication answers 4 of 6 published members,
GetDeploymentGroup 4 of 23 and GetDeployment 6 of 31 (#1199), so an exact
expectation would pin that gap and have to be rewritten by the PR closing it.

The comparison folds case, so one entry covers both the record's spelling and the
AccountID a projection in the house style of the other services might introduce,
and it is an equality rather than a substring test, so the account inside a
serviceRoleArn value is not a collision. Each case asserts a published member is
present before asserting a bookkeeping one is absent, and the stored record is read
back as raw JSON, so neither half can pass vacuously. Neither member carries
,omitempty on any of the three records and CodeDeploy routes none of the three tag
operations, so no record declares EverTagged and #1304's trap does not arise.

check-wire-bookkeeping goes from 165 projected across 65 records to 171 across 68,
and from 154 still reachable to 148, of the same 319 declared.

#756 stays open: EC2's 30 lines and a long tail remain in AC3.
@codecov

codecov Bot commented Oct 2, 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 f83f685 into main Oct 2, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the test/756-codedeploy-wire-projections branch October 2, 2026 02:14
scttfrdmn added a commit that referenced this pull request Oct 2, 2026
EC2VPC, EC2Subnet, EC2SecurityGroup, EC2InternetGateway, EC2RouteTable,
EC2NATGateway and EC2ElasticIP each declare AccountID and Region under
wire-visible json tags, fourteen of the inventory's lines. None reaches a
response: emulator/ec2_types.go carries no xml tag, every ec2XMLResponse site is
handed a struct declared for its operation, and no XML-tagged field anywhere is
typed as a record. So EC2 was already projected in code, as Redshift was, and
what it lacked was the citation.

emulator/ec2_wire_test.go holds one test per record, together driving
thirty-seven routed operations and walking the raw XML for an element named for
a bookkeeping member at any depth. The member list names the snake_case
account_id in its own right, because EC2 spells the account three ways and a
fold reaches only accountId and accountID; a control run without that entry
lets a leaked <account_id> pass.

check-wire-bookkeeping goes from 171 projected across 68 records to 185 across
75, and from 148 still reachable to 134, of the same 319 declared.

Also sorts scripts/wire-bookkeeping-projected.txt into byte order: #1328 had put
CodeDeploy's lines after Cognito's.

#756 stays open: EC2's storage, image and compute records follow.
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