feat(schema-migrations): upgrade hardcoded frontend queries in place#34063
Conversation
|
Size Change: +3.1 kB (+0.12%) Total Size: 2.58 MB
|
There was a problem hiding this comment.
PR Summary
This PR reintroduces the schema migration system for frontend queries by implementing version control through the setLatestVersionsOnQuery utility, ensuring consistent schema versioning across the application.
- Added version control to Monaco editor components in
frontend/src/lib/monaco/codeEditorLogic.tsxandhogQLAutocompleteProvider.tsto ensure proper schema versioning during query editing and autocompletion - Refactored
getFreshQuerytosetLatestVersionsOnQueryinfrontend/src/queries/utils.tswith new recursion control feature for fine-grained version management - Applied versioning across critical query components (experiments, funnels, retention) with explicit recursion control to prevent deep recursion issues
- Enhanced HogQL query handling in
frontend/src/lib/api.tsto ensure version consistency before backend transmission - Added comprehensive test coverage in
frontend/src/queries/utils.setLatestVersionsOnQuery.test.tsfor both recursive and non-recursive version setting
23 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
| ? setLatestVersionsOnQuery( | ||
| { | ||
| kind: NodeKind.HogQLASTQuery, | ||
| query: queryInput, | ||
| }, | ||
| { recursion: false } | ||
| ) |
There was a problem hiding this comment.
style: Consider moving the common options object { recursion: false } to a constant since it's used twice
andehen
left a comment
There was a problem hiding this comment.
Tested the branch locally, and experiment queries are working fine ✅
Is wrapping the input to performQuery with setLatestVersionsOnQuery something temporary, or something we need to care about in the future?
This is part of a schema migrations system that will allow us to evolve the query schema e.g. changing a boolean property to an enum. The system makes the assumption that nodes without an explicit version are version |
Reverts the revert #34045
#33650