Conversation
## Summary Adds support for user-scoped pricing overrides by introducing a `user_id` field to the model config scope schema, adds a `BudgetOverrideModeNone` constant for the zero/default override state, and excludes the derived `virtual_key_count` field from schema sync validation since it is a non-persisted, response-only field. ## Changes - Added `user_id` field to `config.schema.json` under model config scopes to support user-scoped pricing overrides - Added `BudgetOverrideModeNone` (`""`) as an explicit named constant for the default/zero value of `BudgetOverrideMode` - Added `virtual_key_count` to the `ignoreGoFields` map in the schema sync script, since `TableCustomer.VirtualKeyCount` is a `gorm:"-"` derived field populated only on read and is not user-configurable via `config.json` ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [x] Core (Go) - [x] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs ## How to test ```sh go test ./... ``` - Verify that a model config scope with a `user_id` field passes schema validation. - Verify that the schema sync script no longer flags `virtual_key_count` as an unrecognized field. - Verify that `BudgetOverrideModeNone` correctly represents the default (empty string) override mode. ## Screenshots/Recordings N/A ## Breaking changes - [ ] Yes - [x] No ## Related issues N/A ## Security considerations The `user_id` field in pricing override scopes should be validated server-side to ensure callers can only apply overrides to users within their authorized scope. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable
|
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes define an explicit no-override budget mode, add ChangesConfiguration schema alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Comment |
No description provided.