feat(orb): add POST /v1/orb/ingest central collector endpoint - #1234
Merged
Conversation
Receives anonymized outcome signal batches from self-hosted Orb instances (exportOrbBatch). Stores them in a new orb_signals table (migration 0056) with INSERT OR IGNORE dedup on (instance_id, pr_hash). Validates payload shape, caps batch size at 500, and skips malformed events without throwing. No auth required: all data is HMAC-anonymized by the sender before export. Route excluded from requiresApiToken so it accepts unauthenticated requests. 100% branch coverage on src/orb/ingest.ts (24 tests).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1234 +/- ##
=======================================
Coverage 94.95% 94.96%
=======================================
Files 176 177 +1
Lines 19740 19772 +32
Branches 7098 7110 +12
=======================================
+ Hits 18744 18776 +32
Misses 397 397
Partials 599 599
🚀 New features to boost your workflow:
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 058dfff | Commit Preview URL Branch Preview URL |
Jun 24 2026, 12:00 PM |
4 tasks
This was referenced Jul 5, 2026
This was referenced Jul 11, 2026
Merged
8 tasks
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /v1/orb/ingestto the main Cloudflare Worker — the central collector endpoint for anonymized outcome signal batches sent by self-hosted Orb instances viaexportOrbBatchorb_signalstable (migration0058) withUNIQUE(instance_id, pr_hash)dedup; no raw repo names or PR content stored — only HMAC-anonymized hashes + aggregate outcome metadatarequiresApiToken(unauthenticated by design; sender already HMAC-anonymizes data before export)Scope
migrations/0058_orb_signals.sql,src/orb/ingest.ts,test/integration/orb-ingest.test.ts)src/api/routes.ts(import, route registration, onerequiresApiTokenexemption)wantedPaths; noblockedPathstouchedValidation
npm run test:ci— fully green (exit 0)npm run db:migrations:check— 60 migrations, contiguous 0001..0058, no duplicatesnpm run typecheck— cleansrc/orb/ingest.ts— 100% statements / 100% branches / 100% functions (24 tests covering every??/ ternary /&&branch, both sides of each)0056_orb_events+0057_orb_installations)Safety
INSERT OR IGNOREonUNIQUE(instance_id, pr_hash)Advances #1219