Skip to content

feat: add pull_checks table to clickhouse#522

Open
silent-cipher wants to merge 5 commits into
feat/pull-flow-testingfrom
feat/clickhouse-pull-check
Open

feat: add pull_checks table to clickhouse#522
silent-cipher wants to merge 5 commits into
feat/pull-flow-testingfrom
feat/clickhouse-pull-check

Conversation

@silent-cipher
Copy link
Copy Markdown
Collaborator

@FilOzzy FilOzzy added this to FOC May 11, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC May 11, 2026
Copy link
Copy Markdown
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

Adds ClickHouse persistence for pull check outcomes, aligning pull-check observability with other check types (storage/retrieval/retention) by emitting one pull_checks row per completed pull check attempt.

Changes:

  • Add pull_checks table to ClickHouse startup migrations.
  • Emit a pull_checks row from PullCheckService.runPullCheck() (latencies, throughput, statuses) after completion.
  • Update pull-check unit tests to inject a ClickHouse service mock and assert inserts on the success path.
  • Remove outdated documentation claiming pull check results are not written to ClickHouse.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/checks/pull-check.md Removes outdated statement about pull-check results not being written to ClickHouse.
apps/backend/src/pull-check/pull-check.service.ts Captures pull-check outcome/latency metrics and writes a pull_checks row to ClickHouse in finally.
apps/backend/src/pull-check/pull-check.service.spec.ts Adds ClickHouse service mock wiring and asserts an insert occurs on the happy path.
apps/backend/src/clickhouse/clickhouse.schema.ts Adds ClickHouse DDL migration for the new pull_checks table.

Comment thread apps/backend/src/pull-check/pull-check.service.ts
Comment thread apps/backend/src/pull-check/pull-check.service.spec.ts
Comment thread apps/backend/src/clickhouse/clickhouse.schema.ts Outdated
PRIMARY KEY (probe_location, sp_address, timestamp)
PARTITION BY toStartOfMonth(timestamp)
TTL toDateTime(timestamp) + INTERVAL 1 YEAR`,
];
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.

We should think about resurrecting the migration code from #485 if there are going to be more schema changes.

This change should be ok because creating the table is idempotent

Copy link
Copy Markdown
Contributor

@iand iand left a comment

Choose a reason for hiding this comment

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

LGTM

@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC May 11, 2026
@BigLep BigLep requested review from SgtPooki and Copilot May 11, 2026 22:36
Copy link
Copy Markdown
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread docs/checks/pull-check.md
Comment thread apps/backend/src/clickhouse/clickhouse.schema.ts Outdated
Comment thread apps/backend/src/clickhouse/clickhouse.schema.ts
Comment thread apps/backend/src/pull-check/pull-check.service.spec.ts
Comment thread apps/backend/src/pull-check/pull-check.service.spec.ts
Comment thread apps/backend/src/pull-check/pull-check.service.ts
Comment thread docs/checks/pull-check.md
Comment thread apps/backend/src/clickhouse/clickhouse.schema.ts Outdated
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ⌨️ In Progress in FOC May 12, 2026
@silent-cipher silent-cipher requested a review from SgtPooki May 13, 2026 07:21
@BigLep BigLep moved this from ⌨️ In Progress to 🔎 Awaiting review in FOC May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting review

Development

Successfully merging this pull request may close these issues.

6 participants