Skip to content

Conversation

@dvasilas
Copy link
Collaborator

Implement the core log processing logic.

Best reviewed commit by commit.

When no offset exists, max() returns NULL which ClickHouse driver
converts to Unix epoch (1970-01-01).
Use maxOrNull() and sql.NullTime to properly detect NULL values.
Return Go zero time for missing offsets, enabling reliable IsZero() checks.
This makes the case in which a bucket does not have a committed offset
yet more explicit.
Add OffsetManagerInterface and UploaderInterface to enable
tests to use custom implementations (for injecting errors).
Existing implementations already satisfy these interfaces.
- S3TestHelper for bucket/object operations
- CountingUploader for tracking upload attempts
- InsertTestLogWithTargetBucket for inserting test data
- FailingOffsetManager for simulating offset commit failures
- Discovery cycle with configurable interval
- Parallel batch processing with worker pool
- Retry logic
- Error classification (permanent vs transient)
Transform stub main into complete application
- Load and validate configuration
- Set up logging
- Create and initialize processor
- Signal handling
- Shutdown timeout with cleanup
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 68.18182% with 168 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.22%. Comparing base (15510f4) to head (ca263f9).

Files with missing lines Patch % Lines
cmd/log-courier/main.go 0.00% 63 Missing ⚠️
pkg/logcourier/processor.go 79.16% 44 Missing and 11 partials ⚠️
pkg/testutil/s3.go 69.49% 28 Missing and 8 partials ⚠️
pkg/util/logging.go 0.00% 12 Missing ⚠️
pkg/testutil/clickhouse.go 96.92% 2 Missing ⚠️

❌ Your project check has failed because the head coverage (77.22%) is below the adjusted base coverage (85.02%). You can increase the head coverage or adjust the Removed Code Behavior.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
pkg/logcourier/logfetch.go 89.47% <100.00%> (+0.18%) ⬆️
pkg/logcourier/offset.go 87.87% <100.00%> (+0.78%) ⬆️
pkg/s3/uploader.go 100.00% <ø> (ø)
pkg/testutil/clickhouse.go 92.44% <96.92%> (+1.81%) ⬆️
pkg/util/logging.go 0.00% <0.00%> (ø)
pkg/testutil/s3.go 69.49% <69.49%> (ø)
pkg/logcourier/processor.go 79.16% <79.16%> (ø)
cmd/log-courier/main.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
- Coverage   85.43%   77.22%   -8.22%     
==========================================
  Files          12       15       +3     
  Lines         515     1036     +521     
==========================================
+ Hits          440      800     +360     
- Misses         52      195     +143     
- Partials       23       41      +18     
Flag Coverage Δ
unit 77.22% <68.18%> (-8.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants