Skip to content

Make Question chains easily extractible from BigQuery Event Store #649

Closed
@thclark

Description

@thclark

Feature request

Use Case

We want to be able to extract the sequence of all events that were triggered throughout the process of a grandparent question being executed.

Current db

Screenshot 2024-04-24 at 11 18 46

Proposed Solution

This means we have to maintain a linked list so that a grandchild's events can be associated with a grandparent's questions.

Defining terms

  • Originator: refers to the ultimate service or question which triggered the entire tree of questions (and the corresponding sequence of events from each). Synonymous with "ultimate ancestor/parent".

Implementation

  • If each event has a parent_question_uuid and a question_uuid then we have a linked list that we can traverse
  • We probably should also require an originator_question_uuid (for subscription purposes and for eliminating the need to recurse queries to resolve the linked list in some query scenarios).
  • Rename the current originator column to parent
  • Make a new column called originator to record the originator service
  • Update get_events function
  • Consider updating to ordering by datetime for events (keep the order column for now, we may require it later). This is to allow proper ordering of all events in a question chain.
  • Update cloud function
  • Redeploy cloud function where needed
  • Update and redeploy bigquery table where needed
  • Test with example service
  • Write test of question chaining
  • Update documentation
  • Test with existing service

Metadata

Metadata

Assignees

Labels

backendRelated to the back endtech-debtTechnical debt (tidy up, refactoring, restructuring, caused by laziness now)

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions