Repository navigation
fix(#756): stop filing published members as bookkeeping leaks - #1306
Merged
Merged
Conversation
The wire-bookkeeping check keys on the Go identifier, because that is the only stable key — one AccountID renders as `json:"a"` and one Region as `json:"r"`, so a tag-name scan would miss both. The cost is that a field whose identifier is one of the five but whose *member* the service publishes is recorded as a defect owed a deletion, and deleting it would drop something AWS does publish. Ten such lines were in the baseline. Each was checked against the operation's own reference page rather than classified by eye: ECS `Service.createdAt`, ACM `CertificateDetail.CreatedAt`, Redshift Data `DescribeStatement.CreatedAt`, Batch `JobDetail.createdAt`, Health `Event.region`, EC2 `SpotPlacementScore.region`, Organizations `CreateAccountStatus.AccountId`, IAM `RoleLastUsed.Region` and `RoleUsageType.Region`, and `ecrRepositoryOut .CreatedAt` — a field on the wire struct #1090 *added* to fix ECR, so the baseline was filing the fix as part of the defect. They join `batchJobSummary.CreatedAt` in a per-site exclusion map keyed file/type/field, so an exclusion cannot spread to another struct by accident. Batch's JobDetail line had been kept on purpose, on the argument that BatchJob's AccountID and Region leak alongside it; that is the wrong unit of analysis — the exclusion is per field, and a leaking sibling says nothing about this one. Those two siblings stay in the baseline, where JobDetail publishing neither is what puts them. The honest count is 320 declared, 13 projected, 307 still reachable. Two of the ten publish the right name and the wrong type: ACM's and Redshift Data's CreatedAt are time.Time, so they render RFC3339 where both services' JSON protocol publishes epoch seconds. That is a live decode failure rather than a cosmetic one, and it is filed as #1305 and named at the exclusion, because "not a bookkeeping leak" must not read as "correct". Refs #756 Refs #1305
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
FirehoseDeliveryStream.CreatedAt renders as json:"CreateTimestamp", and API_DeliveryStreamDescription publishes CreateTimestamp, Type: Timestamp, Required: No. It is the case the identifier key costs the most — the rendered name was right all along, and only the Go name collides with the five. Its AccountID and Region stay in the baseline; that same page publishes neither. The type is still wrong (time.Time renders RFC3339 where Firehose's JSON protocol publishes epoch seconds), so #1305 now names three fields rather than two. 319 declared, 13 projected, 306 still reachable. Refs #756 Refs #1305
4 tasks done
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.
The wire-bookkeeping ratchet reported 330 declared, 13 projected, 317 still reachable after the
EFS projection landed (#1304). The denominator was wrong.
scripts/check-wire-bookkeeping.shkeys on the Go identifier, not the rendered json tag, becausethe identifier is the only stable key — one
AccountIDrenders asjson:"a"and oneRegionasjson:"r", and a tag-name scan would miss both. The cost of that choice is a false positive class:a field whose Go identifier is one of the five but whose member the service actually publishes.
A line in the baseline means "owed a deletion", and deleting one of these would drop a member AWS
does publish — so the entry is worse than useless, it points at the wrong fix.
Eleven such lines were in the baseline. Each was verified against the operation's own AWS reference
page rather than classified by eye:
ecs_types.go ECSService.CreatedAtAPI_Service→createdAtacm_types.go ACMCertificate.CreatedAtAPI_CertificateDetail→CreatedAt, Timestampredshiftdata_types.go RedshiftDataStatement.CreatedAtAPI_DescribeStatement→CreatedAtbatch_plugin.go BatchJob.CreatedAtAPI_JobDetail→createdAt, Type: Long, epoch msfirehose_types.go FirehoseDeliveryStream.CreatedAtAPI_DeliveryStreamDescription→CreateTimestamp, Timestamphealth_plugin.go HealthEvent.RegionAPI_Event→regionec2_spot_placement_control.go ec2SpotPlacementScoreSeed.RegionAPI_SpotPlacementScore→regionorganizations_types.go OrgCreateAccountStatus.AccountIDAPI_CreateAccountStatus→AccountIdiam_types.go IAMRoleLastUsed.RegionAPI_RoleLastUsed→Regioniam_service_linked_roles.go IAMSLRRoleUsage.RegionAPI_RoleUsageType→Regionecr_wire.go ecrRepositoryOut.CreatedAtAPI_Repository→createdAtThe last is the sharpest illustration: that struct is the wire struct #1090 added to fix ECR, so
the baseline was filing the fix as part of the defect.
Firehose's is the case the identifier key costs the most. The field is tagged
json:"CreateTimestamp", so the rendered name was right all along — only the Go identifiercollides, and the field-name scan that exists to catch
json:"a"catches this too. ItsAccountIDand
Regionstay in the baseline; that same page publishes neither.All eleven join
batchJobSummary.CreatedAtin a per-site exclusion map, keyed file/type/field so anexclusion cannot spread to another struct by accident. The narrowness is load-bearing and was
checked:
batchJobSummary.CreatedAtis excluded whileBatchJob.AccountIDandBatchJob.Regionremain, and all four
ECRRepositorylines remain.One retraction
BatchJob.CreatedAtwas not an oversight — the previous header kept it deliberately, on theargument that
BatchJob'sAccountIDandRegionleak alongside it. That is the wrong unit ofanalysis: the exclusion is per field, and a leaking sibling says nothing about this one. AWS's
API_JobDetailpublishescreatedAtasType: Long, "the Unix timestamp (in milliseconds) forwhen the job was created", which is exactly what the field is (
int64, epoch ms, set fromp.tc.Now().UnixNano() / int64(time.Millisecond)), andDescribeJobsmarshals the persisted recordstraight into
{"jobs": […]}. The header now says so and retracts the old reasoning.AccountIDand
Regionstay in the baseline, whereJobDetailpublishing neither is what puts them.The honest count
No projected entry changed; no EFS or
ECRRepositoryline moved.Not a leak is not the same as correct — #1305
Three of the eleven publish the right name and the wrong type. ACM's, Redshift Data's and
Firehose's are
time.Time, so they render RFC3339 where all three services' JSON protocol publishesa Timestamp as epoch seconds (ECS already uses
EpochSeconds, which is what right looks like). Thatis a live decode failure for an SDK consumer, not a cosmetic one. It is filed as #1305 — which this
PR widens from two fields to three — and named at the point of exclusion, because "excluded from
this check" must not read as "correct".
Also recorded
The header's "the count is an upper bound" paragraph now names two structs that are matched but
cannot leak, rather than one:
accountRegionRequest.AccountID(a request decode struct) andorgPendingAccountOutcome.AccountID(a control-plane seed record, read at request time and renderedinto no body). Both stay in the baseline and are named instead of excluded, because there is no
lexical way to tell such a struct from a response struct, and excluding by a name suffix would be a
heuristic that silently drops real surface.
Verification
make lint(0 issues),make test(race,-count=1, all green), and all seven drift gates:docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check.Refs #756
Refs #1305