Skip to content

fix(orb): backfillOrbInstallations is fully implemented and tested but never wired to anything #8882

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

src/orb/installations.ts:44-65's backfillOrbInstallations doc comment claims it "Reconciles the registry against GitHub's authoritative installation list -- recovers installs whose installation webhook fired before the receiver's secret was configured (so they were never recorded)." Confirmed via grep across src/: it's only referenced by its own definition and by test/unit/orb-app-auth.test.ts. No route, cron, or script anywhere ever calls it, so the recovery capability the comment promises does not actually run today.

Requirements

Wire backfillOrbInstallations to a real trigger -- an admin route is the natural fit given /v1/internal/orb/instances already exists in src/api/routes.ts -- so the documented recovery capability is actually reachable. If a manually-invoked admin route is the intended shape (rather than an automatic cron), that's an acceptable fix, but the function must have a real, reachable caller after this PR; leaving it unwired and only updating the comment does not resolve this issue.

Deliverables

  • backfillOrbInstallations is wired to a real admin route (or cron) in src/api/routes.ts / src/index.ts
  • A test exercising the new route/trigger end-to-end, asserting it actually invokes backfillOrbInstallations and reconciles a missing installation

All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.

Test Coverage Requirements

src/** -- 99%+ patch coverage, branch-counted, on the new route/trigger wiring.

Expected Outcome

backfillOrbInstallations's documented reconciliation capability is reachable via a real admin route, not just present as dead, tested-but-unreferenced code.

Links & Resources

  • src/orb/installations.ts:44-65
  • src/api/routes.ts
  • test/unit/orb-app-auth.test.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions