Skip to content

fix(#756): answer Budgets' DescribeBudget and DescribeBudgets through a projection - #1355

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/756-budgets-projection
Oct 3, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/756-budgets-projection

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

This is the eighth of ten PRs in #756's 3-line block.

The leak

describeBudget answered {"Budget": b} and describeBudgets answered {"Budgets": []Budget}, both
the persisted record. A consumer therefore read AccountId, Region and CreatedAt. I verified today
that none of these is a member of API_budgets_Budget. AccountId is a request member: the
caller already named it.

The fix

The new emulator/budgets_wire.go holds budgetOut: five of the published members (BudgetLimit,
BudgetName, BudgetType, CostFilters, TimeUnit), the ones the record models. The unmodeled
TimePeriod, CalculatedSpend, LastUpdatedTime and the rest stay absent, as #1199's scope. The
stored record is unchanged.
No existing Budgets test read a dropped member.

The citation

emulator/budgets_wire_test.go drives all five routed operations with the shared
wireAssertNoMemberJSON. It reads all three members back from the stored record first, and none of
them is ,omitempty.

Negative controls (each run, then restored)

Reverted Failed
describeBudget exactly /DescribeBudget
describeBudgets exactly /DescribeBudgets

The ratchet

before: 319 declared, 264 projected across 109 records, 9 internal across 6 records, 46 still reachable
after:  319 declared, 267 projected across 110 records, 9 internal across 6 records, 43 still reachable

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.

… 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

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit b18dcc8 into main Oct 3, 2026
18 checks passed
@scttfrdmn
scttfrdmn deleted the fix/756-budgets-projection branch October 3, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant