Area
Backend — Database / Models
Category
Test coverage
Description
The model package is the most imported package in the backend (133 files depend on it) yet has essentially zero test coverage — 1 test file with 1 test (TestVerboseID).
This package defines all 72 GORM models, migration logic, custom types, and helper methods. Bugs here propagate everywhere.
Documentation needs:
- Inline documentation for all exported types and methods
- Relationship documentation between models (FK, many-to-many)
- Migration behavior documentation
Test coverage priorities:
- Custom types — JSONB, Vector, Timestamp, Int64ID marshaling/unmarshaling
- VerboseID — edge cases beyond the single existing test
- GORM hooks — BeforeCreate on Project, Workspace, Session, SystemConfiguration
- Helper methods — GetUserProperties, SetUserProperties, GetSlackAttachment, AdminEmailAddresses
- Migration — verify secure_id_generator() output format
- AllWorkspaceSettings defaults — ensure all flags default to enabled
See src/backend/model/MODULE.md for full analysis.
Affected Files / Packages
src/backend/model/model.go (2,516 lines)
src/backend/model/sessionalerts.go
src/backend/model/stringarray.go
src/backend/model/timestamp.go
src/backend/model/id.go
src/backend/model/pricing.go
src/backend/model/model_test.go (11 lines — only 1 test)
Area
Backend — Database / Models
Category
Test coverage
Description
The
modelpackage is the most imported package in the backend (133 files depend on it) yet has essentially zero test coverage — 1 test file with 1 test (TestVerboseID).This package defines all 72 GORM models, migration logic, custom types, and helper methods. Bugs here propagate everywhere.
Documentation needs:
Test coverage priorities:
See
src/backend/model/MODULE.mdfor full analysis.Affected Files / Packages