Repository navigation
chore(proto): pull the uuid rule on Usage.user_id - #2068
Conversation
Pins PROTON_COMMIT to d03e73fc, the head of raystack/proton#506, and regenerates proto/v1beta1. CreateBillingUsage now rejects a user_id that is set but is not a uuid.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Coverage Report for CI Build 46667828346Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Coverage decreased (-0.006%) to 56.462%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions7 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
Summary
Pins
PROTON_COMMITto e0e28b44, the commit on proton main from raystack/proton#506, and regeneratesproto/v1beta1.CreateBillingUsagenow rejects a usage whoseuser_idis set but is not a uuid. An emptyuser_idstill passes.Changes
models.pb.gochanges. Its diff is the proto definition that the file stores as bytes, which now carries the uuid rule onUsage.user_id.TestUsageAPIgains two cases. Auser_idthat is not a uuid fails with InvalidArgument, and the error namesuser_id. A usage without auser_idgets past validation and stops at the credit check, because its amount is larger than the balance.Technical Details
user_idfails the rule. The validation interceptor checks the whole request before the handler runs, so none of its usages is stored.user_idthat is not a uuid stay as they are. The rule only stops new ones.Test Plan
go build ./...andgo vet ./test/e2e/regression/TestUsageAPIinBillingRegressionTestSuitepasses, with the two new casesuser_idnot-a-uuidis stored with no error. Case 13 passes at both pins.golangci-lint runon the changed packages reports no issuesmake protoat the old pin (94668c36) gives the committed files byte for byte, so the whole diff comes from the new rulemake protoat the new pin (e0e28b44) gives the committed files byte for byteuser_idpass. One without dashes, one in braces andnot-a-uuidfail. A request with a valid usage and anot-a-uuidusage fails onusages[1].user_id.