Repository navigation
fix(#756): pin RDS's projection and report the published creation time - #1311
Merged
Merged
Conversation
RDS is the first service #756 has reached that was already answering through a separate item struct rather than encoding its records, so its sixteen baseline lines were reachable-by-declaration with nothing pinning them shut — the position ECS's four already-projecting records were in at #1308. The rendering layer moves out of the 1,361-line rds_plugin.go into emulator/rds_wire.go and emulator/rds_wire_test.go asserts it: 239 still reachable -> 223. RDS is also the first query-protocol service on the projected list, so the assertion is a stronger analogue of the JSON one — the body's whole set of element *paths* is compared against the published shape's, which catches a member rendered at the wrong depth as well as one that should not be there. That is how the three adjacent defects below were found; the negative control confirms every one of the seventeen sites fails when a leaked member is added. Deciding the projection's membership settled three published members substrate held the value for and reported wrongly or not at all: the creation time, now reported as InstanceCreateTime, ClusterCreateTime and SnapshotCreateTime; DeleteDBCluster, which reported three of the eleven members it held; and the cluster's DBSubnetGroup, nested where API_DBCluster publishes a flat string. Writing the test surfaced a fourth — Start, Stop and RebootDBInstance answered an unnamed <Result> element, the result field being untagged so the placeholder substitution had nothing to match. Neither AccountID nor Region has a published home on any RDS shape, and API_DBSnapshot.SourceRegion is not one: it carries a value only for a copy substrate does not perform. Refs #756
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
added a commit
that referenced
this pull request
Oct 1, 2026
…tion times (#1312) ElastiCache was already answering every resource through an item struct rather than encoding its records, as RDS was at #1311: its four records declare eleven bookkeeping fields and not one could reach a body. What was missing was the assertion that this holds, so this adds elasticache_wire_test.go and moves the rendering layer into elasticache_wire.go. 223 still reachable -> 212. Writing the assertion settled one divergence: substrate stamped a creation instant on the cache cluster and the replication group and reported it on neither, though API_CacheCluster publishes CacheClusterCreateTime and API_ReplicationGroup publishes ReplicationGroupCreateTime. Both are now reported, as pointers so a zero time is omitted rather than rendered as the year-one instant. Neither AccountID nor Region has a published home on any of the four shapes; all four publish ARN, from which a caller recovers both. Refs #756
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.
What this is
#756's AC3 — no unpublished member reaches a response body — measured byscripts/check-wire-bookkeeping.sh. RDS was the largest remaining block: 16 baseline lines across5 records. The ratchet moves 239 → 223 still reachable, 80 → 96 projected, across 31 → 36
records. No baseline line added or removed.
Why this one is different
RDS already projected.
grep 'RDSDB[A-Za-z]* .*xml:'matches nothing: every one of the seventeen sites that answers a resource hands an item struct tordsXMLResponse, so no bookkeeping member could reach a body even before this change. What was missing was the *assertion* that this holds — the position ECS's four already-projecting records were in at #1308. So this is a pin, not a new rendering layer:emulator/rds_wire.goholds the item structs and converters moved out of the 1,361-linerds_plugin.go, andemulator/rds_wire_test.gois whatscripts/wire-bookkeeping-projected.txt` cites.Neither
AccountIDnorRegionhas a published home on any RDS shape — every one publishes theresource's ARN, from which a caller recovers both.
API_DBSnapshot.SourceRegionis not thathome: it carries a value only for a cross-account or cross-Region copy, which substrate does not
perform, so reporting the request's Region there would tell a caller the snapshot had been copied.
The assertion
RDS is the first query-protocol (XML) service on the projected list; the eight already there are
JSON or REST-JSON, where absence is asserted by decoding to
map[string]json.RawMessage. Theanalogue used here is stronger: the body is walked with
xml.NewDecoderand the whole set of elementpaths inside the record's element is compared against the published shape's. That subsumes every
absence check at once, cannot go vacuous the way a bare
NotContainscan, and additionally catches apublished member rendered at the wrong depth — which is how the cluster's
DBSubnetGroupnestingsurvived.
ever_taggedis,omitempty, so each record that declaresEverTaggedis tagged throughAddTagsToResourceand anchored on bothListTagsForResourceand the stored record's raw JSONbefore any absence assertion runs. The snapshot is tagged too, even though
RDSDBSnapshotdeclaresno such field:
taggingStampRecordEverTaggededits raw JSON, so the member lands on the recordanyway, and the test proves it cannot reach a body.
Four adjacent defects, folded in
A projection has to choose a membership and a nesting anyway (the #1310 precedent), so choosing the
published one costs nothing.
CreatedAtis stamped on instance, cluster and snapshot and no item struct carried it, though AWS publishes one on each of the three shapes under a different nameInstanceCreateTime(API_DBInstance),ClusterCreateTime(API_DBCluster),SnapshotCreateTime(API_DBSnapshot) — allType: Timestamp, Required: NoDeleteDBClusterreported 3 of the 11 members it held, its inline struct declaring onlyDBClusterIdentifier,StatusandDBClusterArnAPI_DeleteDBCluster's response element is the wholeDBClusterDBSubnetGroupwas nested asDBSubnetGroup>DBSubnetGroupName, so an SDK decodingDBCluster.DBSubnetGroupread"". The nested form is correct on the instance, which is how it reached the clusterAPI_DBCluster.DBSubnetGroupisType: String;API_DBInstance.DBSubnetGroupis the object<Result>element — found by the assertion above. The result field was untagged, soencoding/xmlnamed the element from the field and theXMLResultsubstitution had nothing to match; an SDK found no result element in a200API_StartDBInstancepublishesStartDBInstanceResultAll three cluster sites now share one
xmlDBClusterItem, so a fourth cannot diverge again.Not a #1305 instance. The Query protocol's default timestamp format is ISO8601 and
encoding/xmlrenders atime.Timeas RFC3339Nano, so no format change was needed — unlike Glue'sJSON protocol, which publishes epoch seconds.
redshift_plugin.go:84is the in-tree precedent. #1305still stands for ACM, Redshift Data and Firehose.
Each new timestamp is a
*time.Time, not a bare one:,omitemptyhas no effect on a struct type inencoding/xmlany more than inencoding/json, so a plain field would report0001-01-01T00:00:00Zwhere AWS omits aRequired: Nomember.Verification
make lint— 0 issues.make test(race,-count=1) — all packages pass.make docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check— all pass.ok — 319 declared, 96 projected across 36 records, 223 still reachable (#756).AccountID,Region,CreatedAtandever_taggedtemporarily added to allfive item structs and projected from the records. Every one of the seventeen sites failed — 8
instance, 3 cluster, 3 snapshot, 2 subnet group, 2 parameter group (18 assertion points; Start,
Stop and Reboot share one site). Restored from a backup, all green again.
rds_wire.go;setDBInstanceStatus93.5%.Compatibility
A consumer asserting on an RDS response body sees four changes, all toward what AWS publishes:
CreateDBInstance,DescribeDBInstances,ModifyDBInstance,DeleteDBInstance,Start/Stop/RebootDBInstanceandRestoreDBInstanceFromDBSnapshotnow carryInstanceCreateTime; the three cluster operations carryClusterCreateTime; the three snapshotoperations carry
SnapshotCreateTime.DeleteDBClusteranswers the fullDBClusterrather than three members.DBCluster.DBSubnetGroupis now a flat string. A consumer readingDBCluster/DBSubnetGroup/DBSubnetGroupNamemust readDBCluster/DBSubnetGroupinstead. Theinstance's nested form is unchanged.
Start/Stop/RebootDBInstanceanswerStartDBInstanceResult/StopDBInstanceResult/RebootDBInstanceResultrather thanResult. An SDK that read nothing from these now reads theinstance.
No stored record changes, so a recorded run replays unchanged and the Resource Groups Tagging API —
which reads the records, not these responses — still reports an RDS resource's tags and whether it
has ever been tagged.
Refs #756 — AC3 continues with Kinesis, ElastiCache,
cfn_deployer.go CFNStackState, and SSO (whichneeds a rename:
AccountIDis a misspelling of publishedAccountId).