Skip to content

operationalize dealbot subgraph #498

@SgtPooki

Description

@SgtPooki

Description

apps/subgraph is the dealbot-specific subgraph (currently powering retrieval++, likely more later). It has no CI, no deploy automation, no operational monitoring, and no schema-migration discipline. Operationalize it using the conventions already in use on FilOzone/filecoin-pay-explorer (newer pattern, tag-driven Goldsky deploys) and FilOzone/pdp-explorer (per-network manifests).

Impact

Manual goldsky subgraph deploy runs are non-reproducible and untracked. PRs touching apps/subgraph can land schema regressions or compile failures unnoticed. When the deployed subgraph falls behind, lags, or errors, no one is alerted. As we expand the subgraph past retrieval++, this drift compounds.

Proposed Approach

Mirror the conventions from filecoin-pay-explorer.

CI on PRs (path-filtered to apps/subgraph/**)

  • graph codegen
  • graph build matrix across calibration + mainnet manifests
  • graph test (run only when test files exist)
  • biome + typecheck on the subgraph package
  • All required for merge

Deploy automation

  • Triggered by v* git tags
  • Matrix deploy to calibration + mainnet via Goldsky CLI (goldsky subgraph deploy "dealbot-${network}/$VERSION")
  • GOLDSKY_API_KEY from repo secrets
  • Build pulls network via env var (per filecoin-pay-explorer's NETWORK=${matrix.network})

Schema migration discipline

  • Per-network manifest pattern (pdp-explorer's subgraph_mainnet.yaml / subgraph_testnet.yaml)
  • Tag equals subgraph version. Versioned slugs in Goldsky.

Health monitoring + alerts (BetterStack, route to existing dealbot ops Slack)

  • Indexing lag: head block vs subgraph latest block, alert when >5 minutes behind
  • Goldsky deploy status: alert on failed redeploy
  • Subgraph error rate from Goldsky logs, alert on sustained 5xx

Acceptance

  • CI workflow at .github/workflows/subgraph.yml runs codegen + build + test + lint on PRs touching apps/subgraph
  • Deploy workflow on v* tags publishes to Goldsky for both networks; rollback is git revert then re-tag
  • Per-network manifest files committed
  • Three BetterStack alerts wired and verified, route to dealbot ops Slack
  • README in apps/subgraph/ documents how to deploy locally and how to cut a release tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-workTriaged: scope, plan, and DoD are clear; contributor can pick up

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    🐱 Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions