feat(preferences): add custom traits config loader#1362
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull Request Test Coverage Report for Build 21579288946Details
💛 - Coveralls |
Allow custom preference traits to be loaded from a YAML config file at startup, merged with DefaultTraits. - Add LoadTraitsFromFile() to load and merge custom traits - Add yaml tags to Trait struct for YAML unmarshaling - Add CustomTraitsPath config option in server config - Custom traits can add new traits or override defaults Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ee4a819 to
5b68e01
Compare
- Update Service to accept custom traits parameter - Load custom traits from config file in cmd/serve.go - Describe() now returns configured traits instead of hardcoded defaults Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@whoAbhishekSah Do we have to call them custom-traits? Can this be simply traits. |
|
@ravisuhag The idea is to "extend" the existing hardcoded DefaultTraits traits at runtime. We can call it "additional" as well, to show in the code that these are added with the hardcoded ones. For the handlers/service and repository, the traits are in a single list: [Default + Custom/Additional]. The word "custom" is used in |
|
We can simply call it "traits" in our PR body, documentation, etc., once the PR is merged. |
Summary
Allow custom preference traits to be loaded from a YAML config file at startup.
Changes:
LoadTraitsFromFile()- loads and merges custom traits with defaultsTraitstruct for YAML unmarshalingCustomTraitsPathconfig option in server configcmd/serve.goto load traits at startupMerge behavior:
resource_type+nameoverride defaultsExample config:
Example custom-traits.yaml:
Part of: #1347
Test plan
🤖 Generated with Claude Code