Repository navigation
test(#756): pin the CodeDeploy projections and record them - #1328
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Oct 2, 2026
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.
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.
Records the three CodeDeploy projections in
scripts/wire-bookkeeping-projected.txt, which is thesecond 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,CodeDeployGroupandCodeDeployDeploymenteach declareAccountIDandRegionunder wire-visible
jsontags — six of the inventory's lines — taggedaccountID/region, thelowercase-initial spelling, since CodeDeploy's own members are lowerCamelCase and only the
IDgivesthem away.
What the new test asserts
emulator/codedeploy_wire_test.goholds one test per record, eacht.Parallel(), each cited by oneprojected line, and between them they drive all nine routed operations:
…ApplicationResponsesCarryNoBookkeepingMember…DeploymentGroupResponsesCarryNoBookkeepingMember…DeploymentResponsesCarryNoBookkeepingMemberEach walks the whole decoded document and fails on a member named for either bookkeeping field at any
depth, reporting the
$.a.b[0].cpath. The whole document rather than the record's subtree, which isstrictly 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 createsanswer theirs flat.
Absence rather than exact membership.
emulator/rds_wire_test.go's stronger form is not taken,because
GetApplicationanswers 4 ofApplicationInfo's 6 published members,GetDeploymentGroup4of 23 and
GetDeployment6 of 31 (#1199) — an exact-membership expectation would pin that gap andhave to be rewritten by the PR that closes it. This is the form
configservice_wire_test.go,redshift_wire_test.go,stepfunctions_wire_test.goandbackup_wire_test.goalready use.Nothing passes for free. The comparison folds case, so one entry covers both the record's spelling
and the
AccountIDa projection written in the house style of the other services might introduce; andit is an equality rather than a substring test, so the account appearing inside a
serviceRoleArnvalue is not a collision. Each case asserts a published member is present before asserting a
bookkeeping one is absent, and
codedeployWireRequireScopedreads the stored record back as raw JSONto prove it held both members in the first place. Neither member carries
,omitemptyon any of thethree records and CodeDeploy routes none of the three tag operations, so no record declares
EverTaggedand 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.Nowadvances from its baseline by elapsed walltime, and pinning a date's rendering is
emulator/codedeploy_dates_test.go's job (#1207).The ratchet
Negative controls
Each was run and then restored:
accountIDadded tocodedeployAppOut→ failed exactly…ApplicationResponsesCarryNoBookkeepingMember/GetApplication, nothing else.regionadded tocodedeployGroupOut→ failed exactly…DeploymentGroupResponsesCarryNoBookkeepingMember/GetDeploymentGroup.AccountID(UpperCamelCase, the spelling the fold exists for) added tocodedeployDeploymentOut→failed exactly
…DeploymentResponsesCarryNoBookkeepingMember/GetDeploymentwithGetDeployment answered $.deploymentInfo.AccountID.deleteApplication's{}patched to carryregion→ its subtest failed. Worth noting it failedas 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.
check-wire-bookkeepingrefused 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 responsesubsection under CodeDeploy, thehouse 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), anddocs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-checkall pass. The two operation checks report no change, no operation being added orrenamed. 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
SucceededbeforeCreateDeploymentreturns) 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.