Skip to content

chore(proto): pull the uuid rule on Usage.user_id - #2068

Merged
AmanGIT07 merged 2 commits into
mainfrom
chore/bump-proton-usage-user-id-uuid
Dec 1, 2026
Merged

AmanGIT07 merged 2 commits into
mainfrom
chore/bump-proton-usage-user-id-uuid

Conversation

@AmanGIT07

@AmanGIT07 AmanGIT07 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pins PROTON_COMMIT to e0e28b44, the commit on proton main from raystack/proton#506, and regenerates proto/v1beta1. CreateBillingUsage now rejects a usage whose user_id is set but is not a uuid. An empty user_id still passes.

Changes

  • Only models.pb.go changes. Its diff is the proto definition that the file stores as bytes, which now carries the uuid rule on Usage.user_id.
  • TestUsageAPI gains two cases. A user_id that is not a uuid fails with InvalidArgument, and the error names user_id. A usage without a user_id gets past validation and stops at the credit check, because its amount is larger than the balance.

Technical Details

  • A request with several usages is rejected whole when one user_id fails the rule. The validation interceptor checks the whole request before the handler runs, so none of its usages is stored.
  • Rows already stored with a user_id that is not a uuid stay as they are. The rule only stops new ones.
  • A uuid without dashes or in braces is now rejected, the same as on every other uuid field.

Test Plan

  • go build ./... and go vet ./test/e2e/regression/
  • e2e TestUsageAPI in BillingRegressionTestSuite passes, with the two new cases
  • With the old pin, case 12 fails: the usage with user_id not-a-uuid is stored with no error. Case 13 passes at both pins.
  • golangci-lint run on the changed packages reports no issues
  • make proto at the old pin (94668c36) gives the committed files byte for byte, so the whole diff comes from the new rule
  • make proto at the new pin (e0e28b44) gives the committed files byte for byte
  • The rule, run directly with protovalidate: an empty, a lowercase and an uppercase user_id pass. One without dashes, one in braces and not-a-uuid fail. A request with a valid usage and a not-a-uuid usage fails on usages[1].user_id.

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.
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
frontier Ready Ready Preview Dec 1, 2026 2:29pm UTC

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Added regression coverage for usage requests with malformed or missing user IDs, including checks for the expected validation and insufficient-credits errors. The tests confirm that malformed identifiers receive a clear error, while requests without an identifier pass validation and proceed to the insufficient-credits check.

The Makefile changes the Proton commit used by the proto target. The billing regression test adds usage request cases for a non-UUID user ID and a missing user ID.

Changes: Proton revision

Layer / File(s) Summary
Update pinned Proton commit
Makefile
The proto target uses a new Proton commit value.

Usage API regression tests

Layer / File(s) Summary
Add usage request validation cases
test/e2e/regression/billing_test.go
The test expects InvalidArgument when UserId is not a UUID. When UserId is absent, it expects an insufficient-credits error for the requested amount.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: rohilsurana

Merge Risk: Minimal · up to 06e7e · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 2

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 245c0f2 and 06e7e4b.

Files selected for processing: 1

  • Makefile

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@coveralls

coveralls commented Nov 30, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 46667828346

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.006%) to 56.462%

Details

  • Coverage decreased (-0.006%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 7 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

7 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
internal/store/postgres/org_tokens_repository.go 7 85.64%

Coverage Stats

Coverage Status
Relevant Lines: 42492
Covered Lines: 23992
Line Coverage: 56.46%
Coverage Strength: 22.13 hits per line

💛 - Coveralls

@AmanGIT07
AmanGIT07 merged commit f363a26 into main Dec 1, 2026
8 checks passed
@AmanGIT07
AmanGIT07 deleted the chore/bump-proton-usage-user-id-uuid branch December 1, 2026 14:34

This branch was successfully deployed

1 active deployment
Preview — 06e7e4ba Deployed Dec 1, 2026 by vercel[bot]
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.

3 participants