-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reactions Refactoring #362
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kelvinqian00
approved these changes
Jan 23, 2024
milt
added a commit
that referenced
this pull request
Jan 23, 2024
* initial spec * simplify spec * simple trigger sequence * WIP reaction backend * working basic query * added trigger statement id * add ret spec * rudimentary test * reaction query takes whole trigger statement * introduce concept of identity * delint * remove test data since there is a test * allow reaction query with empty identity * comments on test return * implement LIKE * refactor and improve naming for col snip * use all denormalized fields * escape string keys in paths * Add a tiny sleep in between statements so timestamps are ordered * Implement and test contains * add numeric comp test * remove identity logic from query-reaction * make query input a single map * SQL-197 Reaction Persistence (#307) * SQL-197 input->ruleset * SQL-197 add reaction table * SQL-197 SQL-198 add persistence for reactions and fk on xapi_statement * SQL-197 a migration that actually works * use fake timestamp types by convention and add active/inactive/soft delete bool * ReactionQueryBackend -> ReactionBackend * SQL-197 CRUD queries/commands * SQL-197 stubbed out reaction values for statement insert * SQL-197 function for storing reaction exts info on statement * SQL-197 standardize spec ns a bit * SQL-197 more spec refactor * SQL-197 remove comment * SQL-197 add reaction and trigger id as metadata * SQL-197 inputs for reaction crud sql fns * SQL-197 test for add meta * SQL-197 specs for persistence ops * SQL-197 get rid of keywords in values and path segments * SQL-197 serde for reaction ruleset * SQL-197 ruleset commands * SQL-197 return active rulesets query * SQL-197 reaction CRUD protocol and test * SQL-197 remove forward declaration in spec * SQL-197 delint * SQL-197 use :as-alias and remove kondo exception * SQL-193: adds lrsql.ops.query.generate, which takes a map of key->statement and a statement template, returning a new statement based on template * SQL-198 Reaction Function (#312) * SQL-198 move low-level queries to util and stub out reaction fn * SQL-198 dedupe test reaction * SQL-198 use new test const in reaction util test * SQL-198 add template to ruleset * SQL-198 add instrumentation fixture, now some spec-violating tests fail * SQL-198 instrument and ensure valid specs in reaction util tests * SQL-198 instrument and fix specs for ops/util/reaction * SQL-198 type new id fields on statement * SQL-198 query-active-reactions test * SQL-198 query-all-reactions test * SQL-198 correct aliasing in reaction util query test ns * SQL-198 query-statement-for-reaction * SQL-198 query-reaction-history * SQL-198 remove query-statement-for-reaction * SQL-198 refactor some more test consts * SQL-198 formatting * SQL-198 actual reaction function * SQL-198 SQL-200 pass errors * SQL-200 Reaction TX Function & Errors (#315) * SQL-200 json-friendly error shape and slight refactor * SQL-200 add error column * SQL-200 add delete mod time * SQL-200 error-reaction! command * SQL-200 clear error on ruleset update * SQL-200 react-to-statement * SQL-200 SQL-198 SQL-193 Add authority to query output based on ruleset or trigger * SQL-200 delint * SQL-200 correct testing statement * SQL-200 react-to-statement error storage test * SQL-200 delint * SQL-200 derive custom authority from template * SQL-195 Async Reaction Processing (#316) * SQL-195 config toggle for enabling reactions * SQL-195 moved react-to-statement to new reactor system component * SQL-195 reaction buffer size param * SQL-195 correct default for buffer size * SQL-195 submit new statements to reaction channel * SQL-195 working async reaction processing * SQL-195 add shutdown hook for graceful shutdown * SQL-195 added note about what happens when reaction buffer is full * SQL-202 Implicit DB serialization (#318) * SQL-202 relax json spec to allow keywords and don't eagerly serialize ruleset * SQL-202 delint * SQL-202 allow keyword keys from json parse fn * SQL-202 remove unused sql blob JSON read fn * SQL-202 implicit json reading for ruleset and error * SQL-202 auto deserialize ids and timestamps for reaction * Coerce active to boolean at lower level * some operations working. failing some tests still * WIP eod commit json extraction. Working with basic types i think * SQL-196 Reaction Management API (#321) * SQL-196 Reaction Mgmt API * format * SQL-196 minor test refactor * SQL-196 additional tests * SQL-196 new json coercion fns for reaction * SQL-196 deal in camel reaction ids * SQL-196 API accepts camel everything * SQL-206 camelize identityPaths (#323) * SQL-204 Reaction Documentation (#322) * SQL-204 initial stub out docs * SQL-204 more detailed doc for reactions * SQL-204 added index links * query now working, but parsing in core is not, needs another approach * Minor optimization in query and slight refactor * move backend specific code for sqlite result parse * contains working with dynamic casting * accounting for jsonb * stmt react_id and trigger_id insert fix * fixed spec * test fixes * linting * universal extension native comparison * added another condition to make sure only statements prior to trigger are used, in case a batch insert or another thread inserts while trigger is waiting to be processed * fixed type issue and spec * SQL-211 provide reactions toggle to FE env (#333) * SQL-212 Reaction Title (#337) * SQL-212 add title * SQL-212 handle conflict errors on reaction titles * SQL-211 handle title-conflict-error * format * SQL-211 handle title conflict on update * SQL-211 use shared lib for ruleset + descendant specs * SQL-211 remove incomplete path, now forbidden by spec * SQL-211 make identityPaths fuzzier (#356) * SQL-211 make identityPaths fuzzier * SQL-211 please linter * SQL-211 fix keyword chopping bug (#360) * SQL-224 Reactions: encode condition names (#361) * SQL-224 encode condition names * SQL-224 slight test improvement * SQL-211 release of lrs-reactions * document like op * update template desc * crib cliffs tooltip for identity path doc * maps in function position for clarity * move timestamp coercions to ops ns * Reactions Refactoring (#362) * partial refactor of big reaction query op * further break down reaction q * further refactor and commenting * remove extra spaces * def'd out test-specific constants * remove extra spacing * replace more reaction test constants * removed ugly text to its own def * reaction doc example (#363) * release version of ui --------- Co-authored-by: Daniel Bell <daniel@yetanalytics.com> Co-authored-by: Cliff Casey <cliff@yetanalytics.com> Co-authored-by: Cliff Casey <54323005+cliffcaseyyet@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactoring for Backend Reaction Code