Skip to content

chore(backend): remove cron healthcheck_url for /queue_health - #2793

Merged
riderx merged 2 commits into
mainfrom
chore/remove-cron-healthcheck-url
Jul 30, 2026
Merged

chore(backend): remove cron healthcheck_url for /queue_health#2793
riderx merged 2 commits into
mainfrom
chore/remove-cron-healthcheck-url

Conversation

@riderx

@riderx riderx commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary (AI generated)

  • Remove Hyperping-style cron_tasks.healthcheck_url and process_queue_with_healthcheck
  • Stop queue consumer start/success pings to external healthcheck URLs
  • Delete the Hyperping backfill script and related tests; rely on /queue_health instead

Motivation (AI generated)

Cron per-task Hyperping URLs are redundant now that Capgo has a dedicated queue healthcheck endpoint. Keeping both adds noise, failed pings, and extra request fan-out on every queue sync.

Business Impact (AI generated)

Simplifies ops monitoring around queues, reduces unnecessary outbound healthcheck traffic, and concentrates alerting on /queue_health so queue problems are detected consistently.

Test Plan (AI generated)

  • Apply migration remove_cron_healthcheck_url on a local Supabase reset
  • Confirm cron_tasks no longer has healthcheck_url
  • Confirm process_queue_with_healthcheck is dropped
  • Confirm function_queue cron tasks still dispatch via process_function_queue
  • Confirm /queue_health still reports healthy/unhealthy queues
  • Run bunx vitest run tests/queue-consumer-message-shape.unit.test.ts tests/queue-health.unit.test.ts

Generated with AI

Made with Cursor

Review in cubic

Summary by CodeRabbit

  • Breaking Changes

    • Removed cron healthcheck URL support from scheduled tasks.
    • Queue processing no longer sends healthcheck pings before or after execution.
    • Removed the healthcheck-specific queue processing operation.
  • New Features

    • Added centralized cron task processing with support for function, queue, and function-queue tasks.
    • Added safeguards to prevent concurrent cron processing and improved task scheduling behavior.

Drop Hyperping cron ping wiring now that queue health is covered by the dedicated queue healthcheck endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing chore/remove-cron-healthcheck-url (97551fe) with main (83d4b45)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Removes the Hyperping cron healthcheck mechanism, including its database column, queue-consumer pings, script, tests, and RPC typings. Adds advisory-lock guarded cron execution through process_all_cron_tasks and updates generated Supabase contracts.

Changes

Cron healthcheck removal

Layer / File(s) Summary
Database cron execution and schema
supabase/migrations/...
Adds process_all_cron_tasks() execution logic, drops process_queue_with_healthcheck, and removes cron_tasks.healthcheck_url.
Queue consumer healthcheck removal
supabase/functions/_backend/triggers/queue_consumer.ts, tests/queue-consumer-message-shape.unit.test.ts
Removes healthcheck helpers and request handling while preserving background and awaited queue processing paths.
Generated contracts and validation updates
cli/src/types/supabase.types.ts, src/types/supabase.types.ts, supabase/functions/_backend/**/supabase.types.ts, tests/security-definer-execute-hardening.test.ts
Removes the healthcheck column and RPC typings, updates queue function signatures, and removes the deleted procedure from security assertions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: codex

Suggested reviewers: dalanir

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: removing cron healthcheck_url support for queue health.
Description check ✅ Passed The description includes a clear summary and test plan, which cover the main template requirements for this backend change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@riderx
riderx marked this pull request as ready for review July 30, 2026 20:56
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_17161da3-52de-4a99-a7cf-5cbe60a9852b)

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e2b90ddd-2b0a-4955-bdae-60824f084dbf)

@coderabbitai coderabbitai Bot added the codex label Jul 30, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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 `@supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql`:
- Around line 3-24: Add the required documentation alongside the
public.process_all_cron_tasks definition, covering its cron execution frequency,
invoking roles, expected task cardinalities, relevant indexes, and worst-case
EXPLAIN (ANALYZE, BUFFERS) validation. Document the advisory-lock gating and
second_interval hot-path behavior without changing the function’s
implementation.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f10edf2d-d93d-4be9-aa60-453f44c871c1

📥 Commits

Reviewing files that changed from the base of the PR and between 83d4b45 and 97551fe.

📒 Files selected for processing (11)
  • cli/src/types/supabase.types.ts
  • scripts/create_hyperping_cron_healthchecks.ts
  • src/types/supabase.types.ts
  • supabase/functions/_backend/plugin_runtime/utils/supabase.types.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql
  • tests/create-hyperping-cron-healthchecks.unit.test.ts
  • tests/cron-healthchecks.test.ts
  • tests/queue-consumer-message-shape.unit.test.ts
  • tests/security-definer-execute-hardening.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)
💤 Files with no reviewable changes (8)
  • tests/create-hyperping-cron-healthchecks.unit.test.ts
  • tests/cron-healthchecks.test.ts
  • tests/security-definer-execute-hardening.test.ts
  • scripts/create_hyperping_cron_healthchecks.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • src/types/supabase.types.ts
  • supabase/functions/_backend/plugin_runtime/utils/supabase.types.ts
  • cli/src/types/supabase.types.ts

Comment thread supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql
@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai 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.

1 issue found and verified against the latest diff

Confidence score: 5/5

  • In supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql, dropping healthcheck_url and process_queue_with_healthcheck without Postgres-level regression coverage risks a migration that removes more than intended or misses the expected replacement path, which could cause queue-processing/runtime failures after deploy — add a DB migration test that applies this change and asserts those objects are gone while functions.process_queue remains callable.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql">

<violation number="1" location="supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql:111">
P3: The destructive schema/function removal has no Postgres-level regression coverage. Add a DB test that applies the migration and verifies `healthcheck_url` plus `process_queue_with_healthcheck` are absent while a `function_queue` cron task still dispatches through `process_function_queue`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


DROP FUNCTION IF EXISTS "public"."process_queue_with_healthcheck"("text"[], integer, "text");

ALTER TABLE "public"."cron_tasks" DROP COLUMN IF EXISTS "healthcheck_url";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The destructive schema/function removal has no Postgres-level regression coverage. Add a DB test that applies the migration and verifies healthcheck_url plus process_queue_with_healthcheck are absent while a function_queue cron task still dispatches through process_function_queue.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At supabase/migrations/20260730204645_remove_cron_healthcheck_url.sql, line 111:

<comment>The destructive schema/function removal has no Postgres-level regression coverage. Add a DB test that applies the migration and verifies `healthcheck_url` plus `process_queue_with_healthcheck` are absent while a `function_queue` cron task still dispatches through `process_function_queue`.</comment>

<file context>
@@ -0,0 +1,111 @@
+
+DROP FUNCTION IF EXISTS "public"."process_queue_with_healthcheck"("text"[], integer, "text");
+
+ALTER TABLE "public"."cron_tasks" DROP COLUMN IF EXISTS "healthcheck_url";
</file context>

@riderx
riderx merged commit 36a71e9 into main Jul 30, 2026
58 of 80 checks passed
@riderx
riderx deleted the chore/remove-cron-healthcheck-url branch July 30, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant