Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
58d050a
chore(frontend): migrate to Bun + rolldown-vite
mr-karan Dec 23, 2025
7f0f41a
feat(collections): add bookmark and shareable URL support
rhnvrm Dec 19, 2025
0bbedb1
Merge PR #60: feat(collections): add bookmark and shareable URL support
mr-karan Dec 24, 2025
47d1e51
chore: upgrade deps, migrate golangci-lint to v2, update changelog
mr-karan Dec 24, 2025
4e99ba3
refactor(logchefql): rewrite parser with grammar-based approach
mr-karan Dec 26, 2025
0d0191a
fix(lint): add context propagation for contextcheck compliance
mr-karan Dec 26, 2025
3672f3f
refactor: reduce cyclomatic complexity by extracting helper functions
mr-karan Dec 26, 2025
eb43cb8
chore: remove dead code and simplify backend
mr-karan Dec 26, 2025
33f6f17
refactor(frontend): improve state management and URL sync
mr-karan Dec 26, 2025
ec6b26f
chore(deps): add participle/v2 for LogChefQL grammar
mr-karan Dec 26, 2025
810657a
docs: update CHANGELOG with parser rewrite and refactoring
mr-karan Dec 26, 2025
8a25dc0
refactor(frontend): establish single source of truth for context state
mr-karan Dec 26, 2025
45a0d40
refactor(frontend): fix remaining state management issues in stores
mr-karan Dec 26, 2025
7707613
fix(ci): update tests for async LogchefQL translation and use Bun in …
mr-karan Dec 26, 2025
1a62285
refactor(frontend): extract histogram and AI stores from explore store
mr-karan Dec 26, 2025
ea43022
refactor(frontend): remove dead query utility code
mr-karan Dec 26, 2025
da40376
refactor(frontend): remove dead code from api, utils, and composables
mr-karan Dec 26, 2025
7895ca2
fix(frontend): resolve team/source context switching race conditions
mr-karan Dec 29, 2025
eb36e7e
fix(frontend): display saved query content when editing from Collections
mr-karan Dec 29, 2025
5c7b3e7
fix: saved query navigation, validation, and responsive toolbar
mr-karan Dec 29, 2025
af29356
refactor(frontend): centralize context management with single source …
mr-karan Dec 29, 2025
e83bf5d
docs: add changelog entries for saved query and context fixes
mr-karan Dec 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "23"
cache: "pnpm"
cache-dependency-path: frontend/pnpm-lock.yaml
bun-version: latest

- name: Install dependencies
working-directory: frontend
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

# FIXME: Re-enable TypeScript checks after fixing pending local type errors
# - name: Run TypeScript checks
# working-directory: frontend
# run: pnpm typecheck
# run: bun run typecheck

- name: Run tests
working-directory: frontend
run: pnpm test:ci
run: bun run test:ci

- name: Build frontend
working-directory: frontend
run: pnpm build
run: bun run build
19 changes: 5 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,13 @@ jobs:
with:
just-version: "1.13.0"

- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
version: 10
bun-version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: "23"
cache: "pnpm"
# Specify the path to the lock file for caching
cache-dependency-path: frontend/pnpm-lock.yaml

# Install frontend dependencies
- name: Install dependencies
run: cd frontend && pnpm install
- name: Install frontend dependencies
run: cd frontend && bun install --frozen-lockfile

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
171 changes: 76 additions & 95 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,110 +1,91 @@
version: "2"
run:
tests: true
linters:
enable:
- gofmt
- goimports
- gosimple
- govet
- staticcheck
- errcheck

- unused
- bodyclose
- contextcheck
- misspell
- gocritic
- gocyclo
- gosec
- misspell
- revive
- ineffassign
- unconvert
- unparam
- gocritic

disable:
- exhaustruct
- depguard

linters-settings:
goimports:
local-prefixes: github.com/mr-karan/logchef

govet:
enable-all: true
disable:
- fieldalignment
- shadow

gocyclo:
min-complexity: 20

gosec:
excludes:
- G104

revive:
- exhaustruct
settings:
gocritic:
disabled-checks:
- hugeParam
- emptyStringTest
enabled-tags:
- diagnostic
- style
- performance
gocyclo:
min-complexity: 20
gosec:
excludes:
- G104
govet:
disable:
- fieldalignment
- shadow
enable-all: true
revive:
rules:
- name: exported
arguments:
- checkPrivateReceivers
- disableStutteringCheck
severity: warning
disabled: false
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: exported
severity: warning
disabled: false
arguments:
- "checkPrivateReceivers"
- "disableStutteringCheck"

gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- hugeParam
- emptyStringTest

run:
timeout: 5m

tests: true

skip-dirs:
- vendor
- frontend
- design
- deploy
- dev/experiment

skip-files:
- ".*\\.generated\\.go$"

output:
format: colored-line-number

print-issued-lines: true

print-linter-name: true

- linters:
- errcheck
path: _test\.go
- linters:
- dupl
- gocyclo
- gosec
path: _test\.go
- linters:
- gosec
text: 'G107: Potential HTTP request made with variable url'
- linters:
- gocritic
- revive
text: 'TODO:'
- linters:
- contextcheck
text: Function `GetHealth` should pass the context parameter
paths:
- third_party$
- builtin$
- examples$
issues:
max-issues-per-linter: 50

max-same-issues: 3

exclude-rules:
- path: _test\.go
linters:
- errcheck

- path: _test\.go
linters:
- gocyclo
- gosec
- dupl

- text: "G107: Potential HTTP request made with variable url"
linters:
- gosec

- text: "TODO:"
linters:
- revive
- gocritic

- text: "Function `GetHealth` should pass the context parameter"
linters:
- contextcheck
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/mr-karan/logchef
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- **Bookmark Favorite Queries** - Star saved queries for quick access ([#60](https://github.com/mr-karan/logchef/pull/60))
- Bookmarked queries appear at top of collections dropdown
- Copy shareable URL for any saved query
- Direct link format: `/logs/collection/:teamId/:sourceId/:collectionId`

### Changed
- **LogChefQL Parser Rewrite** - Replaced hand-written tokenizer with grammar-based parser using [participle](https://github.com/alecthomas/participle)
- Better error messages with position-aware diagnostics
- More maintainable and extensible grammar definitions
- Improved query type detection (LogChefQL vs SQL)
- **Frontend Tooling Migration** - Switched from pnpm + Vite to Bun + rolldown-vite
- Build time: ~2.3s (was >55s)
- Dev server start: ~1s (was ~3s)
- Install time: ~8s (was ~25s)
- **Frontend State Management** - Refactored stores and composables
- Centralized URL state synchronization
- Cleaner explore store with better state transitions
- Improved context and teams store initialization

### Fixed
- Proper context propagation throughout backend (contextcheck compliance)
- Reduced cyclomatic complexity in high-complexity functions
- **Saved Query Navigation** - Switching between saved queries no longer shows stale content
- **Saved Query Validation** - Backend now accepts relative-only time ranges (was: "absolute start time must be positive")
- **Cross-Page Context** - Team/source selection preserved when navigating between Explorer, Collections, and Alerts
- **Sidebar Navigation** - Links now include full context params (team + source)

### Contributors
- [@rhnvrm](https://github.com/rhnvrm) - Bookmark favorite queries feature ([#60](https://github.com/mr-karan/logchef/pull/60))

## [1.0.0] - 2025-12-22

The 1.0 release marks Logchef as production-ready. Eight months of development brought alerting, a proper backend query language, field exploration, and many UX improvements.
Expand Down
10 changes: 5 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ build-backend: sqlc-generate
build-ui:
@echo "Building frontend..."
cd frontend && \
[ -d "node_modules" ] || pnpm install --frozen-lockfile --silent && \
pnpm build
[ -d "node_modules" ] || bun install --frozen-lockfile && \
bun run build

# Build frontend with bundle analysis
build-ui-analyze:
@echo "Building frontend with bundle analysis..."
cd frontend && \
[ -d "node_modules" ] || pnpm install --frozen-lockfile --silent && \
pnpm build:analyze
[ -d "node_modules" ] || bun install --frozen-lockfile && \
bun run build:analyze

# Run the server with config
run: build
Expand All @@ -63,7 +63,7 @@ run-backend: build-backend

# Run only the frontend server
run-frontend:
cd frontend && pnpm dev
cd frontend && bun run dev

# Run the documentation server locally
run-docs:
Expand Down
4 changes: 0 additions & 4 deletions frontend/.npmrc

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/.vite/deps/_metadata.json

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/.vite/deps/package.json

This file was deleted.

Loading