-
Notifications
You must be signed in to change notification settings - Fork 35
Release: Bookmark queries, LogChefQL parser rewrite, and Bun migration #61
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
Open
mr-karan
wants to merge
17
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
Replace pnpm with Bun and Vite with rolldown-vite for significantly faster frontend tooling: - Build: ~2.3s (was >55s) - Dev server: ~1s (was ~3s) - Install: ~8s (was ~25s) Changes: - Switch package manager from pnpm to Bun - Replace vite with rolldown-vite for build/dev - Keep standard vite for vitest (SSR compatibility) - Update CI workflow to use Bun - Update Justfile commands
Closes #5 This enables teams to share collection URLs and update the underlying queries in the future without resharing the URLs - the same link continues to work with updated content. Features added: - Bookmark toggle (is_bookmarked field) - bookmarked queries sort to top - Shareable URLs: /logs/collection/{teamId}/{sourceId}/{collectionId} - CollectionRedirect component for URL handling - Star icon in dropdown and collections view - Copy link functionality with toast notification - "Update Current Query" in Explorer to save modified queries back - Query name links now use shareable URL format Backend changes: - Migration adding is_bookmarked column - Toggle bookmark API endpoint (PATCH) - Updated query ordering (bookmarked first) Frontend changes: - Added patch method to apiClient - Fixed isEditingExistingQuery detection (query_id param) - Fixed SaveQueryModal to use content from initialData in edit mode - Added @update handler in SavedQueriesView - Updated getQueryUrl to return shareable collection URLs Prompts: "implement issue #5 bookmark favorite queries"
Co-authored-by: Rohan Verma <[email protected]> Closes #60 Closes #5
- Upgrade all frontend dependencies (bun update) - Upgrade all Go dependencies (go get -u) - Migrate golangci-lint config from v1 to v2 format - Add bookmark feature to CHANGELOG with contributor credit - Remove .vite build artifacts from tracking - Apply go fmt formatting changes
- Replace hand-written tokenizer/parser with formal grammar definitions - Add detect.go for query type detection (LogChefQL vs SQL) - Add grammar.go with token types and parsing rules - Improve error messages with position-aware reporting - Expand test coverage for edge cases The new grammar-based parser is more maintainable and provides better error diagnostics for malformed queries.
- Add ctx parameter to NewOIDCProvider, AddSource, checkSource, GetHealth, CreateTemporaryClient - Update all call sites to pass context - Add nolint:contextcheck for legitimate background goroutines (health checks, token cleanup) Fixes contextcheck linter warnings about non-inherited contexts.
Extract focused helper functions from high-complexity methods: - ExtractFirstNumeric: findFirstValue, convertToFloat64, deref helpers - parseEngineParams: findMatchingParen, splitEngineParams, stripQuotes - GetFieldDistinctValues: normalizeFieldValuesParams, extractFieldValues - GetHistogramData: windowToIntervalFunc, buildHistogramQuery, parseHistogramResults - UpdateAlert: applyAlertUpdates, applyQueryTypeUpdate, applyThresholdUpdates - UpdateUser: applyUserUpdates, applyRoleUpdate, applyStatusUpdate - handleGenerateAISQL: validateAIConfig, getSourceSchemaForAI, callAIToGenerateSQL Reduces gocyclo scores from 21-36 down to <15 for all functions.
- Remove unused exported functions from sqlite layer - Remove unused middleware and handler code - Simplify metrics initialization and registration - Clean up alerts manager and server handlers - Remove redundant type conversions and nil checks - Fix minor linting issues (gocritic, unused params) No functional changes - pure cleanup for maintainability.
State Management: - Consolidate explore store with cleaner state transitions - Add useHistogramState and useUrlState composables - Remove deprecated useExploreUrlSync (replaced by useUrlState) - Simplify context store initialization URL Handling: - Centralize URL state synchronization - Fix route sync edge cases Stores: - Cleaner base store patterns - Improved teams store with better loading states - Simplified saved queries management Components: - SaveQueryModal improvements - Better histogram visualization state - Cleaner alert views
Added alecthomas/participle/v2 parser generator library used by the new grammar-based LogChefQL parser.
- Remove duplicate teamId/sourceId state from teamsStore and exploreStore - contextStore is now the single source of truth for team/source context - teamsStore.currentTeamId and exploreStore.sourceId are now computed from contextStore - Remove sync watchers that copied state between stores Bug fixes: - Fix logout flow: clear contextStore and skip contextGuard for public routes - Fix 'Loading Explorer...' stuck: continue initialization after URL update - Fix URL spam while typing: only sync query content on execution, not keystroke Files refactored: - stores/teams.ts: currentTeamId -> computed from contextStore - stores/explore.ts: sourceId -> computed from contextStore - stores/alertHistory.ts: read teamId/sourceId from contextStore - router/index.ts: only run contextGuard for authenticated routes - composables/useUrlState.ts: remove live query sync, fix init flow
- alerts.ts: Remove lastLoaded duplicate state, add watcher to clear alerts when context changes - savedQueries.ts: Remove selectedTeamId from state, read from contextStore, add watcher to clear queries on context change - Remove dead code: useRouteSync.ts (not imported anywhere) This ensures all stores properly react to context changes and don't hold stale data when team/source switches.
…release workflow - Update QueryService tests to use async translateLogchefQLToSQLAsync with mocked API - Remove deprecated sync method tests to reduce dead code - Replace pnpm with Bun in release.yml for frontend build consistency
- Create exploreHistogram.ts store for histogram state and API calls - Create exploreAI.ts store for AI SQL generation - Refactor explore.ts to delegate to new stores via composition - Remove unused useHistogramState.ts composable (duplicate of store) - Remove dead fetchHistogramData from HistogramService - Clean up unused variables and imports Reduces explore.ts complexity while maintaining same public API.
- Remove unused prepareQueryParams function from explore.ts - Remove dead validateSQLWithDetails wrapper (called non-existent import) - Remove dead analyzeQuery wrapper (called non-existent import) - Remove dead generateDefaultSQLTemplate method - Remove dead validateSQL method - Clean up unused imports from QueryService.ts These methods were either never called externally or called functions that weren't imported, making them dead code.
Remove unused exports and files that are no longer referenced: - api/logchefql.ts: createDebouncedValidator, clearTranslationCache - api/types.ts: isErrorResponse, isAPIListResponse, isPaginatedResponse - lib/utils.ts: registerSeverityField - composables/useConnectionValidation.ts (entire file) - composables/useFormHandling.ts (entire file)
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.
Summary
This release includes a new feature, major refactoring, and tooling improvements.
✨ New Feature
/logs/collection/:teamId/:sourceId/:collectionId🔧 Major Changes
LogChefQL Parser Rewrite - Replaced hand-written tokenizer with grammar-based parser using participle
Frontend Tooling Migration - pnpm + Vite → Bun + rolldown-vite
Frontend State Management - Refactored stores and composables
🐛 Fixes