Repository navigation
fix(dir): add ListTags endpoint - #1877
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
4085005 to
9968071
Compare
0b2d5ec to
8566d48
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
| if err := d.gormDB. | ||
| Table("skills"). | ||
| Select("records.schema_version, skills.name"). | ||
| Joins("INNER JOIN records ON records.record_cid = skills.record_cid"). |
There was a problem hiding this comment.
IIRC, the data in skills/domain/modules is just an index of the data available in records table. Fetching the data from these tables only means that "there are records that have these skills/domains/modules". Do we really need to join the tables here or we can just fetch? or is this just to get the schema version out?
There was a problem hiding this comment.
Yes, it's for getting the schema version
It's similar to how it's implemented right now, we get the schema version from the record (see catalogTags, mergeSortedTags)
That said, I know it's not ideal. I would suggest normalizing the database like:
skills -> (id, schema_version, name, label)
record_skills -> (record_cid, skill_id)
So skills should store the skills (and each schema version would have their own skills)
And the records <-> skills association is stored in the associative table record_skills
With a normalized db, we wouldn't need JOIN or DISTINCT for this. It's outside the scope of this issue to normalize the database but I'm happy to do it in a follow-up
There was a problem hiding this comment.
We've discussed with @paralta and we think there's no reason to include OASF schema version in the tag filters. For example, filtering for "Banking" should include both OASF v1.0.0 and v1.1.0 "Banking" domains. This is better UX
This simplifies these queries as there's no need for JOIN anymore. We will keep including the OASF schema version in the Catalog Entries for now, we will only remove them from the tags
So, for example:
- tag filter:
oasf:*:domains:finance_and_business/banking - catalog entry:
oasf:1.0.0:domains:finance_and_business/bankingoroasf:1.1.0:domains:finance_and_business/banking
Signed-off-by: Bendegúz Csirmaz <[email protected]>
8566d48 to
4127da5
Compare
let's add a ListTags endpoint that will return all catalog tags from the database
we will use this on the frontend instead of extracting tags from the agents