Skip to content

Update dependencies, add tests, CI workflows, and CLAUDE.md#22

Merged
peterborodatyy merged 8 commits into
masterfrom
update-deps-add-tests-and-ci
Mar 21, 2026
Merged

Update dependencies, add tests, CI workflows, and CLAUDE.md#22
peterborodatyy merged 8 commits into
masterfrom
update-deps-add-tests-and-ci

Conversation

@peterborodatyy

@peterborodatyy peterborodatyy commented Mar 20, 2026

Copy link
Copy Markdown
Contributor
  • Upgrade Go from 1.17 to 1.25 and update all dependencies to latest versions
  • Migrate from abandoned mintance/go-clickhouse to the official ClickHouse/clickhouse-go/v2 (v2.43.0) with native TCP protocol — faster binary encoding, LZ4 compression, type-safe batch inserts
  • Refactor all code to follow the Google Go Style Guide: doc comments on all exports, proper import grouping, DB not Db, NewParser not GetParser, any not interface{}, errors.Is, maps.Keys/slices.Collect,
    lowercase error strings, no panic in library code
  • Add unit tests (20 tests) covering config parsing, env var overrides, NGINX field type conversion, log parsing, and ClickHouse row building
  • Add integration tests against a real ClickHouse instance (build tag: integration)
  • Add GitHub Actions CI: lint (gofmt + go vet), unit tests, integration tests with ClickHouse service container — runs on PRs to master
  • Add release workflow: auto version bump, GitHub release with binary, multi-arch Docker image push (amd64/arm64) to Docker Hub on PR merge
  • Modernize Makefile: remove legacy glide/gometalinter targets, add lint, test, test-integration
  • Modernize Dockerfile: use go mod download for layer caching, remove unnecessary build tools
  • Remove legacy files: glide.yaml, glide.lock
  • Move Grafana assets to grafana/ folder
  • Rewrite README: current badges (Go Reference, Go Report Card, CI, Docker Pulls, share buttons), structured docs, env var reference table
  • Add CONTRIBUTING.md: dev setup, make targets, code style guide, PR checklist

Breaking Changes

  • ClickHouse default port changed from 8123 (HTTP) to 9000 (native TCP)
  • Config field db now maps to DB internally (YAML key unchanged)

peterborodatyy and others added 8 commits March 20, 2026 19:46
- Update Go from 1.17 to 1.25 and all dependencies to latest versions
- Replace deprecated ioutil.ReadFile with os.ReadFile
- Update Dockerfile to golang:1.25-alpine
- Fix flag.Parse() in config init() to work with go test
- Add unit tests for config, nginx, and clickhouse packages (19 tests)
- Add GitHub Actions workflow to run tests on PRs
- Add GitHub Actions workflow to create releases on PR merge to master
- Add CLAUDE.md with project documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace mintance/go-clickhouse with ClickHouse/clickhouse-go/v2 (native TCP)
- Refactor all packages per Google Go Style Guide:
  - Add package and function doc comments (godoc format)
  - Fix naming: Db→DB, GetParser→NewParser, interface{}→any
  - Extract config inline structs into named types
  - Fix import grouping: stdlib, third-party, project
  - Lowercase error strings, add field context to error logs
  - Replace panic with graceful error handling in ParseLogs
  - Use maps.Keys/slices.Collect/strings.Join over reflect/custom helpers
  - Use errors.Is for EOF comparison
- Reduce lock contention: copy log slice before I/O in flush loop
- Add integration tests with real ClickHouse (build tag: integration)
- Update CI workflow with ClickHouse service container for integration tests
- Update config-sample.yml default port to 9000 (native TCP)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rewrite README with current project state: Go 1.25, native TCP,
  official clickhouse-go/v2, Prometheus metrics, env var table
- Remove outdated badges (Docker build status, golang 1.5+)
- Add structured sections: features, quick start, config reference,
  NGINX/ClickHouse setup, metrics, Grafana
- Add CONTRIBUTING.md with dev setup, code style guide, PR process

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- README: add Go Reference, Go Report Card, CI, Docker Pulls, share
  buttons (X, Reddit); add How It Works section; link to config-sample.yml;
  reference grafana/ folder; move dev setup details to CONTRIBUTING
- CONTRIBUTING: add Make targets table, project structure, full code
  style guide, modernized build commands
- Makefile: remove legacy glide/gometalinter targets; add lint, test,
  test-integration targets
- Dockerfile: use go mod download for layer caching, remove make dependency
- Move Grafana dashboard and screenshot to grafana/ folder
- Remove legacy glide.yaml and glide.lock

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Recent ClickHouse images generate a random password for the default
user. Set CLICKHOUSE_PASSWORD="" on the service container to allow
passwordless access. Also make integration test helpers read all
credentials from env vars (user, password, host, port) via a shared
testConnOpts helper to avoid hardcoded auth in multiple places.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build and push multi-arch (amd64, arm64) Docker images on PR merge.
Tags both version-specific and latest. Requires DOCKERHUB_USERNAME
and DOCKERHUB_TOKEN secrets configured in the repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@peterborodatyy
peterborodatyy merged commit 722abe7 into master Mar 21, 2026
3 checks passed
@peterborodatyy
peterborodatyy deleted the update-deps-add-tests-and-ci branch March 21, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant