Repository navigation
feat(#756): count the leaks, not the declarations - #1303
Merged
Merged
Conversation
The wire-bookkeeping ratchet was written expecting each of its 330 lines to be deleted as its service was fixed. That is not how the fix works, and ECR is the proof: #1090 fixed ECR by the route the script itself recommends, and all four ECR lines are still in the baseline. They have to be — emulator/ecr_wire.go says why in as many words. `json:"-"` and retyping a field in place both change the format of every recorded run, because MemoryStateManager snapshots those bytes and a replay reads them back. A fix removes the field from the response, not from the record. So the baseline is the declaration surface and the upper bound, and a fixed record records itself in the new scripts/wire-bookkeeping-projected.txt: one line per record, citing by name the test that asserts on the raw response bytes that no unpublished member appears. That file is the opposite of the baseline — an entry there argues for itself — and the check refuses one whose type has no baseline line, or whose cited test emulator/ does not define. Pure grep, so the CI job still needs no Go toolchain. The run now reports `330 declared, 4 projected across 1 record, 326 still reachable`. The last number is what #756's third criterion drives to zero. Both file headers and the failure advice are corrected to match; the advice no longer offers `json:"-"` as a co-equal fix for a field already persisted. Refs #756
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Why
#756's remaining criteria are AC2 (an approach chosen per plugin, with the reason recorded) and AC3 (no unpublished member reaches a response body). Neither can be measured against the ratchet as it stands, because the ratchet counts the wrong thing.
scripts/wire-bookkeeping-baseline.txtholds 330 lines and its header says each is "expected to be deleted as its service is fixed." ECR is the file's own named precedent for a fix — and all four ECR lines are still in it, two releases after #1090 rendered ECR's responses fromecrRepositoryOut. They have to be.emulator/ecr_wire.gostates the reason:A fix removes the field from the response, not from the record. So the two things that would shrink the baseline are both ruled out, and a file whose number never moves is not a ratchet.
What changed
scripts/wire-bookkeeping-projected.txt—file,struct-type,Test-that-proves-it. One line per persisted record rendered through a wire struct. It is deliberately the opposite posture to the baseline: an entry there is a defect owed a fix and the reason is stated once for all of them; an entry here is a site that should stay, so it argues for itself in the third column. Seeded withECRRepository, citing the test that already exists —TestECR_RepositoryResponsesCarryNoBookkeepingMember(emulator/ecr_wire_shape_test.go:119), which asserts on the raw bodies of all three sites that answer a repository, with a presence anchor so the absences cannot pass vacuously.scripts/check-wire-bookkeeping.shrefuses a projected entry whose type has no baseline line (a projection for a record with no bookkeeping field is a stale claim), and one whose cited testemulator/does not define (so the citation cannot decay into a comment as tests are renamed). Both aregrep, so the CI job still needs no Go toolchain — its comment now says so.330 declared, 4 projected across 1 record, 326 still reachable (#756). 326 is the number AC3 drives to zero.If you ADDED a fieldadvice no longer offersjson:"-"as a co-equal option for a field already written to state — citing the replay reasoning above. It stays fine for a field that has never been persisted.The baseline itself and its
--writeare untouched: still purely lexical, still awk-regenerable, which is why the category could not live in it.Verification
./scripts/check-wire-bookkeeping.sh→330 declared, 4 projected across 1 record, 326 still reachable. No baseline line added or removed.ECRImage(no baseline line). Each fails with exit 1 and names what is wrong. The baseline advice block no longer prints for a projected-file failure, since it is about something else.shellcheckclean;bash -nclean.make version-check discarded-unmarshal-checkgreen.make testgreen (no Go file changed in this PR).Deviation from plan
The plan called for writing
emulator/ecr_wire_test.go. It already exists asemulator/ecr_wire_shape_test.goand is better than the one drafted — it also checks the tag and policies are still readable through the operations that publish them. So this PR adds no test and cites that one instead, which is the first evidence the citation design fits what the tree already does.Refs #756— the issue stays open. EFS is next (nine lines, and the sharp case the script's own header names: substrate declaresCreatedAtwhere AWS publishesCreationTime).