Repository navigation
fix(#756): answer Budgets' DescribeBudget and DescribeBudgets through a projection - #1355
Merged
Merged
Conversation
… a projection describeBudget and describeBudgets handed the persisted Budget to the caller, so a consumer read AccountId, Region and CreatedAt, none of which API_budgets_Budget publishes. They now answer emulator/budgets_wire.go's budgetOut. The stored record is unchanged. emulator/budgets_wire_test.go drives all five routed operations and is cited in scripts/wire-bookkeeping-projected.txt, taking it from 264 projected across 109 records to 267 across 110, and from 46 still reachable to 43. #756 stays open.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
This is the eighth of ten PRs in #756's 3-line block.
The leak
describeBudgetanswered{"Budget": b}anddescribeBudgetsanswered{"Budgets": []Budget}, boththe persisted record. A consumer therefore read
AccountId,RegionandCreatedAt. I verified todaythat none of these is a member of
API_budgets_Budget.AccountIdis a request member: thecaller already named it.
The fix
The new
emulator/budgets_wire.goholdsbudgetOut: five of the published members (BudgetLimit,BudgetName,BudgetType,CostFilters,TimeUnit), the ones the record models. The unmodeledTimePeriod,CalculatedSpend,LastUpdatedTimeand the rest stay absent, as #1199's scope. Thestored record is unchanged. No existing Budgets test read a dropped member.
The citation
emulator/budgets_wire_test.godrives all five routed operations with the sharedwireAssertNoMemberJSON. It reads all three members back from the stored record first, and none ofthem is
,omitempty.Negative controls (each run, then restored)
describeBudget/DescribeBudgetdescribeBudgets/DescribeBudgetsThe ratchet
Verification
All of these pass:
make lint: 0 issues.make test: race,-count=1.docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check.#756 stays open.