Description
Metrics needs:
- One of our priorities for new metrics instruments is to track usage of types, as captured in T355637 and T355638. This objective (and these tickets) could benefit from storing type info (which types are used by which functions) in WikiLambda DB.
- This info would support an "inventory" style of tracking type usage, similar to how we currently track how many functions, implementations, and testers are in the system - so the counts of types and usages of types could be dashboarded.
- By associating each function with the (input and return) types it employs, in a DB table, we can avoid duplicating those relationships in various UI-interaction metrics events (events that track function edits and function calls, which will be numerous).
- We also want to track the inventory and uses of the following function "subtypes": serializer, deserializer, renderer, parser, validator (T355923).
- Question: do we want to also track the association between each {serializer, etc.} and the type it's used with?
Search needs:
- Expanded DB content could be used to expand search capabilities. E.g., "find all functions that take an input argument of type X and return an output of type Y". Somewhat related: T285424, T301712, T282020.
Notes:
- WikiLambda DB tables are declared in extensions/WikiLambda/sql/*.json.
- However we decide to capture these new requirements, we should consider moving return types out of the zobject_labels table.
- It's possible to capture all of the input and return types used by a function, and their positions, in a single string; e.g. something like "Zaaa,Zbbb,Zccc:Zddd". (However, we need to consider the impact on query efficiency and messiness.)
Desired behavior/Acceptance criteria
- The expanded DB content should meet the needs of metrics and search, as outlined above.
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist