Skip to content

Conversation

@muir
Copy link
Collaborator

@muir muir commented Jan 27, 2026

The previous set of breaking changes made the producer required in places where it previously was optional.
That was a cleanup but it breaks some use cases.
This change reverts some of those changes so that a tracer is redundantly required.

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 78.78788% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.16%. Comparing base (a417fc5) to head (f638720).

Files with missing lines Patch % Lines
eventpg/produce.go 69.23% 3 Missing and 1 partial ⚠️
events2/produce.go 84.61% 2 Missing ⚠️
eventdb/transaction.go 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
- Coverage   78.34%   77.16%   -1.18%     
==========================================
  Files          36       36              
  Lines        4797     4804       +7     
==========================================
- Hits         3758     3707      -51     
- Misses        794      851      +57     
- Partials      245      246       +1     
Flag Coverage Δ
go_tests 1.91% <0.00%> (-0.01%) ⬇️
nodb_tests 60.21% <ø> (-0.19%) ⬇️
pg_tests 76.03% <75.00%> (+0.69%) ⬆️
s2_tests 76.12% <85.00%> (-0.83%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request reverts some API changes to make the producer optional in the database layer. Previously, the producer was required when saving and producing events, but this broke use cases where events need to be saved without immediate production to Kafka. The changes introduce a backupTracer mechanism to provide logging functionality when a producer is not available.

Changes:

  • Added backupTracer() method to provide log.Printf as a fallback tracer when producer is nil
  • Modified SaveEventsInsideTx to accept an optional producer and use backupTracer for logging when producer is absent
  • Updated Transact and WrapTransaction to accept and pass through a backupTracer parameter
  • Removed the nil producer check that previously returned an error, allowing events to be saved without a producer

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
events2/produce.go Added backupTracer method and updated SaveEventsInsideTx to work with optional producer for binary event IDs
eventpg/produce.go Added backupTracer method and updated SaveEventsInsideTx to work with optional producer for string event IDs
eventdb/transaction.go Updated transaction wrapper functions to accept backupTracer parameter and work with optional producer

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@muir muir merged commit 95b25fe into main Jan 27, 2026
16 checks passed
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.

3 participants