fix: repair bare wildcard model-list rows - #5107
Conversation
…eak admin PUTs Legacy v1.5.10 rows persisted allowed_models as the bare string * in a serializer:json column; loading them aborts with invalid character '*' and poisons every subsequent PUT /api/providers for that provider. Adds a data-repair migration rewriting bare * to canonical ["*"] for both allowed_models and blacklisted_models (current write path already round-trips correctly; only legacy rows are affected). Affected packages: - framework/configstore/migrations.go Fixes maximhq#4318
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds a registered migration that repairs bare wildcard values in virtual key provider configuration columns, alongside tests covering canonical wildcard persistence, deserialization, and legacy-row repair. ChangesWildcard persistence repair
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant MigrationRunner
participant migrationRepairBareWildcardAllowedModels
participant Database
MigrationRunner->>migrationRepairBareWildcardAllowedModels: run registered migration
migrationRepairBareWildcardAllowedModels->>Database: update bare '*' values
Database-->>migrationRepairBareWildcardAllowedModels: return affected row counts
migrationRepairBareWildcardAllowedModels-->>MigrationRunner: complete migration
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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" 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. Comment |
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "[fix]: configstore - repair bare wildcar..." | Re-trigger Greptile |
|
@eyeveil we never allowed blank * in that field - how did you land up in this scenario ? |
…eak admin PUTs (#5107) Legacy v1.5.10 rows persisted allowed_models as the bare string * in a serializer:json column; loading them aborts with invalid character '*' and poisons every subsequent PUT /api/providers for that provider. Adds a data-repair migration rewriting bare * to canonical ["*"] for both allowed_models and blacklisted_models (current write path already round-trips correctly; only legacy rows are affected). Affected packages: - framework/configstore/migrations.go Fixes #4318
…eak admin PUTs (maximhq#5107) Legacy v1.5.10 rows persisted allowed_models as the bare string * in a serializer:json column; loading them aborts with invalid character '*' and poisons every subsequent PUT /api/providers for that provider. Adds a data-repair migration rewriting bare * to canonical ["*"] for both allowed_models and blacklisted_models (current write path already round-trips correctly; only legacy rows are affected). Affected packages: - framework/configstore/migrations.go Fixes maximhq#4318
…eak admin PUTs (maximhq#5107) Legacy v1.5.10 rows persisted allowed_models as the bare string * in a serializer:json column; loading them aborts with invalid character '*' and poisons every subsequent PUT /api/providers for that provider. Adds a data-repair migration rewriting bare * to canonical ["*"] for both allowed_models and blacklisted_models (current write path already round-trips correctly; only legacy rows are affected). Affected packages: - framework/configstore/migrations.go Fixes maximhq#4318
Summary
Repairs legacy virtual-key provider-config rows that contain a bare
*in JSON-serialized model-list columns. Those rows cannot be deserialized by GORM and can block the provider administration surface until the database is repaired manually.Changes
*values to canonical["*"]JSON inallowed_modelsandblacklisted_models.Type of change
Affected areas
Framework/configstore is affected.
How to test
Expected: the configstore package passes, including the wildcard round-trip and repair migration tests.
Screenshots/Recordings
Not applicable; no UI changes.
Breaking changes
Related issues
Fixes #4318
Security considerations
No credential material is read or changed. The migration only canonicalizes two malformed model-list values so affected configuration rows can be loaded again.
Checklist
docs/contributing/README.mdand followed the guidelines