Skip to content

Fix metric stream sink deletes and move table to ingest - #1356

Merged
Asherlc merged 13 commits into
mainfrom
Asherlc/strain-gauge-shows-zero
Jun 24, 2026
Merged

Asherlc merged 13 commits into
mainfrom
Asherlc/strain-gauge-shows-zero

Conversation

@Asherlc

@Asherlc Asherlc commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

The Redpanda metric-stream ClickHouse sink was stuck retrying ALTER TABLE ... UPDATE on _peerdb_version, leaving ~17M backlog messages and stale heart-rate data for strain and activity HR zones. Deletes now write tombstone rows via INSERT...SELECT with bumped version, which ReplacingMergeTree can apply without mutating key columns. Raw sensor samples move from postgres_fitness.metric_stream to ingest.metric_stream with ingested_at / is_deleted / version column names; migration 0034 copies legacy data and drops the old table. dbt sources, read models, bootstrap SQL, catch-up scripts, and server repositories were updated to read the new table.

Test plan

  • clickhouse-sink.test.ts and clickhouse-migrations.test.ts
  • read_model_microbatch.sql.test.ts
  • Deploy, restart metric-stream-clickhouse-sink, confirm consumer lag drains
  • Rebuild dbt sensor models and verify today's activities show HR zones

Made with Cursor


Summary by cubic

Fixes stuck deletes in the metric‑stream ClickHouse sink by switching to tombstone inserts and migrates the mirror to ingest.metric_stream with ingest metadata. This drains the backlog, restores heart‑rate analytics, and retires the legacy table.

  • Bug Fixes

    • Replaced ALTER ... UPDATE deletes with tombstone INSERT ... SELECT that bump version so ReplacingMergeTree applies deletes safely; tightened delete‑scope assertions and tests.
    • Pointed all reads/dbt sources/scripts to ingest.metric_stream; centralized INGEST_DATABASE/METRIC_STREAM_TABLE; updated ClickHouse waits/smoke tests, test bootstraps, and catch‑up/seed scripts for ingest columns; provider‑detail now reads ingest.metric_stream with row_number() version dedup; stabilized CI by mocking ClickHouse in Garmin tests and tolerating legacy table count mocks.
    • Garmin integration bootstraps ingest.metric_stream when CLICKHOUSE_URL is set; minor lint/import‑order fixes.
  • Migration

    • New table: ingest.metric_stream with ReplacingMergeTree(version); columns _peerdb_synced_atingested_at, _peerdb_is_deletedis_deleted, _peerdb_versionversion. Bootstrap creates this table directly (no ALTER add‑columns).
    • 0034_move_metric_stream_to_ingest: creates ingest, copies from postgres_fitness.metric_stream when present (legacy existence checked via system.tables with count parsed from string or number), then drops the legacy table. Adoption: run ClickHouse migrations, redeploy/restart the metric‑stream sink, rebuild dbt sensor models.

Written for commit 95d037c. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

Release Notes

  • Chores
    • Migrated metric stream data infrastructure to use a dedicated ingest database with improved data handling and versioning model. Updated internal data structures to support cleaner deletion tracking and version management across all metric ingestion pipelines.

The Redpanda sink was stuck retrying ALTER UPDATE on version keys, blocking HR data from reaching strain and activity analytics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings June 24, 2026 00:06
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @Asherlc, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Moves the ClickHouse metric_stream table from the postgres_fitness database to a new ingest database. Renames _peerdb_synced_at/_peerdb_is_deleted/_peerdb_version metadata columns to ingested_at/is_deleted/version. Replaces the ALTER TABLE UPDATE soft-delete approach with an INSERT INTO … SELECT FROM FINAL pattern. Adds ClickHouse migration 0034 to copy and drop the legacy table. Updates all consumers: repositories, dbt models, scripts, and test helpers.

Changes

metric_stream ingest schema migration

Layer / File(s) Summary
New clickhouse-table.ts: constants and DDL builders
src/metric-stream/clickhouse-table.ts
Introduces INGEST_DATABASE, METRIC_STREAM_TABLE, LEGACY_METRIC_STREAM_TABLE, metadata column definitions, metricStreamReplacingMergeTreeEngine(), and buildIngestMetricStreamCreateTableSql()—the shared foundation referenced by all downstream consumers.
clickhouse-sink.ts: row schema and delete mechanism rewrite
src/metric-stream/clickhouse-sink.ts
ClickHouseMetricStreamRow replaces _peerdb_* fields with ingested_at/is_deleted/version. markMetricStreamScopeDeletedInClickHouse switches from ALTER TABLE … UPDATE to INSERT INTO … SELECT … FROM FINAL with greatest(version+1, delete_version). Insert target becomes METRIC_STREAM_TABLE.
Migration 0034: copy legacy table to ingest, drop legacy
src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.ts, src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.test.ts, src/db/clickhouse-migrations/registry.ts
Checks system.tables for the legacy postgres_fitness.metric_stream, copies rows with _peerdb_synced_at AS ingested_at renaming, then drops the legacy table. Registered in registry.ts. Full test suite covers skip conditions and copy/drop success path.
Bootstrap + custom migration runs
src/db/clickhouse-metric-stream-bootstrap.ts, src/db/clickhouse-migrations/custom-runs.ts, src/db/clickhouse-migrations/statement-runner.ts, src/db/clickhouse.ts, src/db/clickhouse-sql-helpers.ts
Bootstrap replaces inline postgres_fitness DDL with buildIngestMetricStreamCreateTableSql(). Custom runs update drop/rebuild targets, metricStreamMirrorHasColumns, shouldReplaceMetricStreamTable, and buildMetricStreamBackfillStatement to METRIC_STREAM_TABLE. Statement runner changes readiness waits for deduped_sensor/deduped_location to ingest.metric_stream. Removes peerDbMetadataColumnAlterStatements.
Server-side read models and deduped-sensor SQL
src/db/clickhouse-read-models.ts, src/db/clickhouse-deduped-sensor.ts, src/providers/garmin/sync-step-plan.ts, packages/server/src/repositories/provider-detail-repository.ts, packages/server/src/repositories/heart-rate-repository.ts
Body-measurement, provider-stats, deduped-sensor, and heart-rate queries switched to METRIC_STREAM_TABLE with is_deleted/ingested_at/version column aliasing. provider-detail-repository tableInfo and #queryMetricStreamRecords updated.
dbt sources and SQL models
analytics/models/sources.yml, analytics/models/read_models/activity_location_sample.sql, analytics/models/read_models/provider_stats.sql, analytics/models/staging/sensor_scalar_sample.sql
sources.yml adds an ingest schema section with metric_stream_freshness configured for event_time: ingested_at. All three SQL models switch source references, deletion filters (is_deleted), and argMax version keys to the new schema.
catch-up and seed-review scripts
scripts/catch-up-clickhouse-metric-stream.ts, scripts/seed-review-clickhouse.ts
catch-up script switches INSERT target, column list, anti-join source, and waitForClickHouseTable database to INGEST_DATABASE. seed-review script changes metric_stream target table to ingest.metric_stream.
Integration test helpers
packages/server/src/routers/clickhouse-integration-test-helpers.ts
Adds ingest to IsolatedClickHouseDatabases, rewrites database-name substitution, removes metric_stream from generic rawTableSyncs, updates insertClickHouseMetricStreamRows target and column list, and drops the ingest namespace during cleanup.
Unit and integration test assertion updates
src/metric-stream/clickhouse-sink.test.ts, src/metric-stream/clickhouse-sink.integration.test.ts, packages/server/src/repositories/heart-rate-repository.integration.test.ts, packages/server/src/repositories/provider-detail-repository.integration.test.ts, packages/server/src/repositories/provider-detail-repository.test.ts, packages/server/src/routers/provider-detail.test.ts, packages/server/src/routers/clickhouse-integration-test-helpers.test.ts, src/db/clickhouse.test.ts, src/db/clickhouse-migrations.test.ts, analytics/models/read_models/read_model_microbatch.sql.test.ts, scripts/catch-up-clickhouse-metric-stream.test.ts, scripts/seed-review-clickhouse.test.ts, src/db/clickhouse-activity-summary.test.ts
All test assertions updated to expect ingest.metric_stream, is_deleted/version/ingested_at column names, 34 migrations, and the INSERT INTO … SELECT delete pattern.

Stryker ignore pattern updates

Layer / File(s) Summary
Stryker config ignore patterns
stryker.config.json, stryker.ci.config.json
Adds .adal/**, .aider-desk/**, .augment/** to ignorePatterns and repositions **/skills/stripe-projects in both Stryker config files.

Sequence Diagram(s)

sequenceDiagram
  participant MetricStreamProducer
  participant clickhouse_sink as clickhouse-sink.ts
  participant ingest_metric_stream as ingest.metric_stream (ReplacingMergeTree)
  participant migration_0034 as migration 0034
  participant legacy_table as postgres_fitness.metric_stream (legacy)

  MetricStreamProducer->>clickhouse_sink: event
  clickhouse_sink->>ingest_metric_stream: INSERT INTO ingest.metric_stream<br/>(ingested_at, is_deleted=0, version=0)

  MetricStreamProducer->>clickhouse_sink: delete scope
  clickhouse_sink->>ingest_metric_stream: INSERT INTO SELECT FROM FINAL<br/>WHERE is_deleted=0<br/>SET is_deleted=1, version=greatest(version+1, delete_version)

  migration_0034->>legacy_table: SELECT count() FROM system.tables
  legacy_table-->>migration_0034: count > 0
  migration_0034->>ingest_metric_stream: INSERT INTO SELECT FROM legacy<br/>(_peerdb_synced_at AS ingested_at, _peerdb_is_deleted AS is_deleted, _peerdb_version AS version)
  migration_0034->>legacy_table: DROP TABLE IF EXISTS
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Asherlc/dofek#1260: Introduced the Redpanda metric-stream pipeline and the ingest table schema with ingested_at/is_deleted/version columns that this PR fully adopts across all consumers.
  • Asherlc/dofek#1174: Touches buildDedupedLocationReadModelStatements in src/db/clickhouse-metric-stream-bootstrap.ts—the same function this PR modifies to switch from postgres_fitness.metric_stream to METRIC_STREAM_TABLE.
  • Asherlc/dofek#1206: Added peerDbMetadataColumnAlterStatements bootstrap/repair logic for metric_stream; this PR removes that helper and replaces the column strategy entirely.

Suggested labels

area/server, area/db, type/bug, breaking-change

Suggested reviewers

  • cubic-dev-ai
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing metric stream sink deletes and relocating the table to the ingest schema. It uses imperative mood, is 55 characters (under 70 limit), and has no trailing punctuation.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Storybook previews for e04a844b are ready:

This comment updates automatically on each PR push.

Asherlc and others added 7 commits June 23, 2026 17:07
The metric stream bootstrap no longer adds PeerDB metadata columns via ALTER TABLE.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add the ingest database to isolated ClickHouse test bootstrap objects, guard optional query in migration 0034, and tighten sink tombstone test assertions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Update test expectations and Biome formatting for the ingest database rename, and make migration 0034 tolerate legacy table count query mocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align integration test seeds and dbt microbatch event_time with ingest.metric_stream column names, and exclude agent skill symlinks from Stryker sandboxes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve Stryker ignorePatterns conflicts by keeping both the
stripe-projects exclusion from main and the local tool-directory ignores.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Asherlc
Asherlc enabled auto-merge (squash) June 24, 2026 01:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/db/clickhouse-read-models.ts (1)

854-1034: 📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift

Split this file to satisfy the 1000-line rule.

Line 1034 shows clickhouse-read-models.ts exceeds the project limit. Move a large SQL builder, such as provider stats, into a focused module before growing this file further. As per coding guidelines, “Max 1000 lines per file.” As per path instructions, “Files must stay under 1000 lines.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/db/clickhouse-read-models.ts` around lines 854 - 1034, The
buildProviderStatsReadModelSql function is contributing to the
clickhouse-read-models.ts file exceeding the 1000-line limit. Extract this
function into a new dedicated file (for example, a separate module focused on
provider stats SQL generation), then import and use it in
clickhouse-read-models.ts. This will reduce the size of the current file and
comply with the project's file size guidelines.

Sources: Coding guidelines, Path instructions

packages/server/src/repositories/heart-rate-repository.ts (1)

41-48: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the stale deletion-column note.

The query now filters is_deleted = 0, but the method comment still documents _peerdb_is_deleted = 0.

Proposed fix
-   * version-deduplicated (`FINAL` + `_peerdb_is_deleted = 0`) but NOT collapsed
+   * version-deduplicated (`FINAL` + `is_deleted = 0`) but NOT collapsed
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/repositories/heart-rate-repository.ts` around lines 41 -
48, The JSDoc comment for the heart rate repository method documents filtering
by `_peerdb_is_deleted = 0`, but the actual implementation now uses `is_deleted
= 0`. Update the documentation comment to reflect the current deletion-column
name being used in the query, replacing the reference to `_peerdb_is_deleted`
with `is_deleted` to keep the documentation accurate and consistent with the
implementation.
packages/server/src/repositories/provider-detail-repository.ts (1)

328-328: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Omit recordId instead of passing an empty-string sentinel.

When recordId is absent, the SQL does not include {recordId:String}, so the params object should omit the key rather than pass "". As per coding guidelines, “No empty strings as absent values.” As per path instructions, “Prefer null/undefined over empty strings for absent values.”

Proposed fix
-        recordId: recordId ?? "",
+        ...(recordId ? { recordId } : {}),
         limit,
         offset,

Apply the same change in both parameter objects.

Also applies to: 378-378

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/server/src/repositories/provider-detail-repository.ts` at line 328,
The current implementation at line 328 uses an empty string as a sentinel value
when recordId is absent, which violates the coding guideline that prefers null
or undefined over empty strings for absent values. Instead of using the null
coalescing operator to provide an empty string fallback, conditionally include
the recordId property in the params object only when recordId has a value,
otherwise omit the key entirely. Apply this same change to both parameter
objects referenced in the diff at lines 328 and 378.

Sources: Coding guidelines, Path instructions

src/providers/garmin/sync-step-plan.ts (1)

147-170: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not hide failures from the new metric-stream query.

If ingest.metric_stream is missing or unhealthy, this catch logs and returns an empty date set, so sync proceeds with false state. Report the exception and let the provider sync surface it through SyncResult.errors instead of swallowing it. As per coding guidelines, “Always report errors to Sentry” and “Use SyncResult to report successes and failures in provider sync. Never swallow API errors.” As per path instructions, “Never silently swallow errors — every unexpected catch must call captureException().”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/providers/garmin/sync-step-plan.ts` around lines 147 - 170, The catch
block in the metric-stream query is silently swallowing errors by logging them
and returning an empty Set, which prevents failures from being properly
reported. Replace the logger.warn call with a captureException() call to report
the error to Sentry, and instead of returning an empty Set, rethrow the error or
return a rejection so that the sync failure is properly surfaced through the
SyncResult.errors mechanism for the provider sync.

Sources: Coding guidelines, Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/server/src/repositories/heart-rate-repository.integration.test.ts`:
- Around line 15-16: Extract the duplicated SeedRow type definition and seed()
function from heart-rate-repository.integration.test.ts into a new
test-helpers.ts file in the same packages/server/src/repositories/ directory.
Move the identical SeedRow interface and seed() function setup code that is
duplicated between heart-rate-repository.integration.test.ts and
provider-detail-repository.integration.test.ts into the shared test-helpers.ts
file, then import these utilities from test-helpers.ts in both integration test
files to eliminate duplication and prevent future schema drift.

In `@packages/server/src/repositories/heart-rate-repository.ts`:
- Around line 64-67: In the heart-rate-repository.ts file, the query filtering
on ingest.metric_stream uses an incorrect type specification for the userId
parameter. Change the placeholder from {userId:String} to {userId:UUID} in the
WHERE clause to match the actual UUID column type of user_id in the
ingest.metric_stream table and maintain consistency with all other queries
reading this table.

In `@scripts/seed-review-clickhouse.ts`:
- Line 154: The buildCopyStatement function currently hardcodes metadata column
names (_peerdb_synced_at, _peerdb_is_deleted, _peerdb_version) for all table
copies, but ingest.metric_stream uses different names (ingested_at, is_deleted,
version). Refactor the ReviewRawTableCopy interface to include metadataColumns
and metadataExpressions fields. Update buildCopyStatement to use these fields
from the table copy configuration instead of hardcoding the default _peerdb_*
names. Then modify each table copy entry to specify its metadata columns:
postgres_fitness.* entries should use the default _peerdb_* names, while the
ingest.metric_stream entry should specify its custom column names (ingested_at,
is_deleted, version).

In `@src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.ts`:
- Around line 10-27: Replace the manual type checking in isLegacyTableCountRow
and the fallback-to-zero behavior in parseLegacyTableCount with Zod schema
validation. Define a Zod schema that validates the expected shape of the count
payload with a field "count" that is a string, then use this schema to parse and
validate the rows array in parseLegacyTableCount. When the payload does not
match the expected schema, throw an error instead of returning 0. Apply the same
Zod validation approach to the other affected parsing functions in the migration
file (around lines 41-42 and 75-81) to ensure all data crossing the runtime
boundary is properly validated and fails fast rather than silently continuing
with invalid data.

---

Outside diff comments:
In `@packages/server/src/repositories/heart-rate-repository.ts`:
- Around line 41-48: The JSDoc comment for the heart rate repository method
documents filtering by `_peerdb_is_deleted = 0`, but the actual implementation
now uses `is_deleted = 0`. Update the documentation comment to reflect the
current deletion-column name being used in the query, replacing the reference to
`_peerdb_is_deleted` with `is_deleted` to keep the documentation accurate and
consistent with the implementation.

In `@packages/server/src/repositories/provider-detail-repository.ts`:
- Line 328: The current implementation at line 328 uses an empty string as a
sentinel value when recordId is absent, which violates the coding guideline that
prefers null or undefined over empty strings for absent values. Instead of using
the null coalescing operator to provide an empty string fallback, conditionally
include the recordId property in the params object only when recordId has a
value, otherwise omit the key entirely. Apply this same change to both parameter
objects referenced in the diff at lines 328 and 378.

In `@src/db/clickhouse-read-models.ts`:
- Around line 854-1034: The buildProviderStatsReadModelSql function is
contributing to the clickhouse-read-models.ts file exceeding the 1000-line
limit. Extract this function into a new dedicated file (for example, a separate
module focused on provider stats SQL generation), then import and use it in
clickhouse-read-models.ts. This will reduce the size of the current file and
comply with the project's file size guidelines.

In `@src/providers/garmin/sync-step-plan.ts`:
- Around line 147-170: The catch block in the metric-stream query is silently
swallowing errors by logging them and returning an empty Set, which prevents
failures from being properly reported. Replace the logger.warn call with a
captureException() call to report the error to Sentry, and instead of returning
an empty Set, rethrow the error or return a rejection so that the sync failure
is properly surfaced through the SyncResult.errors mechanism for the provider
sync.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7c2ffb23-2965-4f75-8859-670d6fd3f3e0

📥 Commits

Reviewing files that changed from the base of the PR and between ca16819 and 8ec05b6.

📒 Files selected for processing (37)
  • analytics/models/read_models/activity_location_sample.sql
  • analytics/models/read_models/provider_stats.sql
  • analytics/models/read_models/read_model_microbatch.sql.test.ts
  • analytics/models/sources.yml
  • analytics/models/staging/sensor_scalar_sample.sql
  • packages/server/src/repositories/heart-rate-repository.integration.test.ts
  • packages/server/src/repositories/heart-rate-repository.ts
  • packages/server/src/repositories/provider-detail-repository.integration.test.ts
  • packages/server/src/repositories/provider-detail-repository.test.ts
  • packages/server/src/repositories/provider-detail-repository.ts
  • packages/server/src/routers/clickhouse-integration-test-helpers.test.ts
  • packages/server/src/routers/clickhouse-integration-test-helpers.ts
  • packages/server/src/routers/provider-detail.test.ts
  • scripts/catch-up-clickhouse-metric-stream.test.ts
  • scripts/catch-up-clickhouse-metric-stream.ts
  • scripts/seed-review-clickhouse.test.ts
  • scripts/seed-review-clickhouse.ts
  • src/db/clickhouse-activity-summary.test.ts
  • src/db/clickhouse-deduped-sensor.ts
  • src/db/clickhouse-metric-stream-bootstrap.ts
  • src/db/clickhouse-migrations.test.ts
  • src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.test.ts
  • src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.ts
  • src/db/clickhouse-migrations/custom-runs.ts
  • src/db/clickhouse-migrations/registry.ts
  • src/db/clickhouse-migrations/statement-runner.ts
  • src/db/clickhouse-read-models.ts
  • src/db/clickhouse-sql-helpers.ts
  • src/db/clickhouse.test.ts
  • src/db/clickhouse.ts
  • src/metric-stream/clickhouse-sink.integration.test.ts
  • src/metric-stream/clickhouse-sink.test.ts
  • src/metric-stream/clickhouse-sink.ts
  • src/metric-stream/clickhouse-table.ts
  • src/providers/garmin/sync-step-plan.ts
  • stryker.ci.config.json
  • stryker.config.json
💤 Files with no reviewable changes (1)
  • src/db/clickhouse-sql-helpers.ts

Comment thread packages/server/src/repositories/heart-rate-repository.integration.test.ts Outdated
Comment thread packages/server/src/repositories/heart-rate-repository.ts
Comment thread scripts/seed-review-clickhouse.ts
Comment thread src/db/clickhouse-migrations/0034_move_metric_stream_to_ingest.ts Outdated
Asherlc and others added 5 commits June 23, 2026 21:30
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Align ClickHouse migration mocks with the new count-field Zod validation and mock ClickHouse in Garmin tests so CI does not attempt real connections.

Co-authored-by: Cursor <cursoragent@cursor.com>
Accept numeric legacy table counts from ClickHouse, fix Biome import order, and bootstrap ingest.metric_stream in Garmin integration tests when CLICKHOUSE_URL is set.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve provider-detail metric stream conflicts by using ingest.metric_stream with row_number() version dedup from main.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Asherlc
Asherlc merged commit be13979 into main Jun 24, 2026
75 checks passed
@Asherlc
Asherlc deleted the Asherlc/strain-gauge-shows-zero branch June 24, 2026 05:14
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